summaryrefslogtreecommitdiff
path: root/python/src
diff options
context:
space:
mode:
Diffstat (limited to 'python/src')
-rw-r--r--python/src/sa/_sa.c12628
-rw-r--r--python/src/sa/default_scorer.pxi74
-rw-r--r--python/src/sa/rulefactory.pxi122
-rw-r--r--python/src/sa/sym.pxi3
4 files changed, 7856 insertions, 4971 deletions
diff --git a/python/src/sa/_sa.c b/python/src/sa/_sa.c
index 15544970..89445b45 100644
--- a/python/src/sa/_sa.c
+++ b/python/src/sa/_sa.c
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.17.1 on Mon Jan 7 22:31:38 2013 */
+/* Generated by Cython 0.17.1 on Mon Jan 28 14:28:01 2013 */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
@@ -360,10 +360,10 @@ static const char *__pyx_f[] = {
struct __pyx_obj_3_sa_HieroCachingRuleFactory;
struct __pyx_obj_3_sa___pyx_scope_struct_9_decode_sentence;
struct __pyx_obj_3_sa___pyx_scope_struct_17_genexpr;
-struct __pyx_obj_3_sa___pyx_scope_struct_21_form_rule;
+struct __pyx_obj_3_sa___pyx_scope_struct_20_genexpr;
struct __pyx_obj_3_sa___pyx_scope_struct_3_compute_stats;
struct __pyx_obj_3_sa___pyx_scope_struct_12_genexpr;
-struct __pyx_obj_3_sa___pyx_scope_struct_22_genexpr;
+struct __pyx_obj_3_sa___pyx_scope_struct_29_genexpr;
struct __pyx_obj_3_sa_IntList;
struct __pyx_obj_3_sa_VEBIterator;
struct __pyx_obj_3_sa_BiLex;
@@ -372,8 +372,8 @@ struct __pyx_obj_3_sa___pyx_scope_struct_11_encode_words;
struct __pyx_obj_3_sa_LCP;
struct __pyx_obj_3_sa_DataArray;
struct __pyx_obj_3_sa_BitSetIterator;
+struct __pyx_obj_3_sa___pyx_scope_struct_23_genexpr;
struct __pyx_obj_3_sa_Precomputation;
-struct __pyx_obj_3_sa___pyx_scope_struct_20_add_instance;
struct __pyx_obj_3_sa___pyx_scope_struct_18_alignments;
struct __pyx_obj_3_sa___pyx_scope_struct_14_genexpr;
struct __pyx_obj_3_sa_SuffixArray;
@@ -381,11 +381,14 @@ struct __pyx_obj_3_sa___pyx_scope_struct_16___str__;
struct __pyx_obj_3_sa_Alphabet;
struct __pyx_obj_3_sa_Rule;
struct __pyx_obj_3_sa___pyx_scope_struct_6_genexpr;
+struct __pyx_obj_3_sa___pyx_scope_struct_21_add_instance;
struct __pyx_obj_3_sa___pyx_scope_struct_2_genexpr;
struct __pyx_obj_3_sa_PhraseLocation;
struct __pyx_obj_3_sa___pyx_scope_struct_15___iter__;
-struct __pyx_obj_3_sa___pyx_scope_struct_23_fmt_rule;
-struct __pyx_obj_3_sa___pyx_scope_struct_24_genexpr;
+struct __pyx_obj_3_sa___pyx_scope_struct_22_form_rule;
+struct __pyx_obj_3_sa___pyx_scope_struct_25_genexpr;
+struct __pyx_obj_3_sa___pyx_scope_struct_24_fmt_rule;
+struct __pyx_obj_3_sa___pyx_scope_struct_28___str__;
struct __pyx_obj_3_sa___pyx_scope_struct_1_read_bitext;
struct __pyx_obj_3_sa___pyx_scope_struct_13_decode_words;
struct __pyx_obj_3_sa_FeatureVector;
@@ -396,19 +399,18 @@ struct __pyx_obj_3_sa_Alignment;
struct __pyx_obj_3_sa_BitSet;
struct __pyx_obj_3_sa_Sampler;
struct __pyx_obj_3_sa_StringMap;
+struct __pyx_obj_3_sa___pyx_scope_struct_26_get_f_phrases;
struct __pyx_obj_3_sa_TrieNode;
struct __pyx_obj_3_sa_ExtendedTrieNode;
struct __pyx_obj_3_sa_TrieMap;
-struct __pyx_obj_3_sa___pyx_scope_struct_26___str__;
struct __pyx_obj_3_sa___pyx_scope_struct_8_genexpr;
struct __pyx_obj_3_sa___pyx_scope_struct_4_make_lattice;
-struct __pyx_obj_3_sa___pyx_scope_struct_27_genexpr;
struct __pyx_obj_3_sa_Phrase;
+struct __pyx_obj_3_sa___pyx_scope_struct_27___iter__;
struct __pyx_obj_3_sa___pyx_scope_struct____iter__;
struct __pyx_obj_3_sa_TrieTable;
struct __pyx_obj_3_sa___pyx_scope_struct_5_genexpr;
struct __pyx_obj_3_sa___pyx_scope_struct_10_genexpr;
-struct __pyx_obj_3_sa___pyx_scope_struct_25___iter__;
struct __pyx_obj_3_sa_FloatList;
struct __pyx_t_3_sa__node;
struct __pyx_t_3_sa__BitSet;
@@ -490,7 +492,7 @@ struct __pyx_t_3_sa__Trie_Node {
int arr_len;
};
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":66
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":76
*
* # linked list structure for storing matches in BaselineRuleFactory
* cdef struct match_node: # <<<<<<<<<<<<<<
@@ -502,7 +504,7 @@ struct __pyx_t_3_sa_match_node {
struct __pyx_t_3_sa_match_node *next;
};
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":162
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":172
*
* # struct used to encapsulate a single matching
* cdef struct Matching: # <<<<<<<<<<<<<<
@@ -517,7 +519,7 @@ struct __pyx_t_3_sa_Matching {
int size;
};
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":218
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":228
*
*
* cdef class HieroCachingRuleFactory: # <<<<<<<<<<<<<<
@@ -563,6 +565,8 @@ struct __pyx_obj_3_sa_HieroCachingRuleFactory {
int require_aligned_chunks;
struct __pyx_obj_3_sa_IntList *findexes;
struct __pyx_obj_3_sa_IntList *findexes1;
+ int online;
+ PyObject *samples_f;
PyObject *phrases_f;
PyObject *phrases_e;
PyObject *phrases_fe;
@@ -573,7 +577,7 @@ struct __pyx_obj_3_sa_HieroCachingRuleFactory {
};
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":115
+/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":118
* for arc in node for node in lattice)
*
* def decode_sentence(lattice): # <<<<<<<<<<<<<<
@@ -603,17 +607,20 @@ struct __pyx_obj_3_sa___pyx_scope_struct_17_genexpr {
};
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1992
- *
- * # 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
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1182
+ * # Online rule extraction and scoring
+ * if self.online:
+ * f_syms = tuple(word[0][0] for word in fwords) # <<<<<<<<<<<<<<
+ * for (f, lex_i, lex_j) in self.get_f_phrases(f_syms):
+ * spanlen = (lex_j - lex_i) + 1
*/
-struct __pyx_obj_3_sa___pyx_scope_struct_21_form_rule {
+struct __pyx_obj_3_sa___pyx_scope_struct_20_genexpr {
PyObject_HEAD
- PyObject *__pyx_v_links;
- struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self;
+ struct __pyx_obj_3_sa___pyx_scope_struct_19_input *__pyx_outer_scope;
+ PyObject *__pyx_v_word;
+ PyObject *__pyx_t_0;
+ Py_ssize_t __pyx_t_1;
+ PyObject *(*__pyx_t_2)(PyObject *);
};
@@ -648,7 +655,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_3_compute_stats {
};
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":119
+/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":122
*
* def encode_words(words):
* return tuple(sym_fromstring(word, True) for word in words) # <<<<<<<<<<<<<<
@@ -665,18 +672,17 @@ struct __pyx_obj_3_sa___pyx_scope_struct_12_genexpr {
};
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2053
- * 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)
+/* "/home/m/workspace/cdec/python/src/sa/features.pxi":21
+ *
+ * def __str__(self):
+ * return ' '.join('%s=%s' % feat for feat in self) # <<<<<<<<<<<<<<
*
+ * cdef class Scorer:
*/
-struct __pyx_obj_3_sa___pyx_scope_struct_22_genexpr {
+struct __pyx_obj_3_sa___pyx_scope_struct_29_genexpr {
PyObject_HEAD
- struct __pyx_obj_3_sa___pyx_scope_struct_21_form_rule *__pyx_outer_scope;
- PyObject *__pyx_v_i;
- PyObject *__pyx_v_j;
+ struct __pyx_obj_3_sa___pyx_scope_struct_28___str__ *__pyx_outer_scope;
+ PyObject *__pyx_v_feat;
PyObject *__pyx_t_0;
Py_ssize_t __pyx_t_1;
PyObject *(*__pyx_t_2)(PyObject *);
@@ -749,7 +755,7 @@ struct __pyx_obj_3_sa_VEB {
};
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":118
+/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":121
* return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice)
*
* def encode_words(words): # <<<<<<<<<<<<<<
@@ -809,6 +815,24 @@ struct __pyx_obj_3_sa_BitSetIterator {
};
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2110
+ * 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_3_sa___pyx_scope_struct_23_genexpr {
+ PyObject_HEAD
+ struct __pyx_obj_3_sa___pyx_scope_struct_22_form_rule *__pyx_outer_scope;
+ PyObject *__pyx_v_i;
+ PyObject *__pyx_v_j;
+ PyObject *__pyx_t_0;
+ Py_ssize_t __pyx_t_1;
+ PyObject *(*__pyx_t_2)(PyObject *);
+};
+
+
/* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":188
*
*
@@ -830,29 +854,6 @@ struct __pyx_obj_3_sa_Precomputation {
};
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1829
- * # Aggregate stats from a training instance
- * # (Extract rules, update counts)
- * def add_instance(self, f_words, e_words, alignment): # <<<<<<<<<<<<<<
- *
- * # Rules extracted from this instance
- */
-struct __pyx_obj_3_sa___pyx_scope_struct_20_add_instance {
- PyObject_HEAD
- PyObject *__pyx_v_al;
- PyObject *__pyx_v_cover;
- PyObject *__pyx_v_e_nt_cover;
- PyObject *__pyx_v_e_words;
- PyObject *__pyx_v_ef_span;
- PyObject *__pyx_v_extract;
- PyObject *__pyx_v_f_len;
- PyObject *__pyx_v_f_words;
- PyObject *__pyx_v_fe_span;
- PyObject *__pyx_v_rules;
- struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self;
-};
-
-
/* "/home/m/workspace/cdec/python/src/sa/rule.pxi":190
* return ' ||| '.join(fields)
*
@@ -870,7 +871,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_18_alignments {
};
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":122
+/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":125
*
* def decode_words(syms):
* return tuple(sym_tostring(sym) for sym in syms) # <<<<<<<<<<<<<<
@@ -950,7 +951,7 @@ struct __pyx_obj_3_sa_Rule {
};
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":109
+/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":112
* def make_lattice(words):
* word_ids = (sym_fromstring(word, True) for word in words)
* return tuple(((word, None, 1), ) for word in word_ids) # <<<<<<<<<<<<<<
@@ -967,6 +968,29 @@ struct __pyx_obj_3_sa___pyx_scope_struct_6_genexpr {
};
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1879
+ * # Aggregate stats from a training instance
+ * # (Extract rules, update counts)
+ * def add_instance(self, f_words, e_words, alignment): # <<<<<<<<<<<<<<
+ *
+ * self.online = True
+ */
+struct __pyx_obj_3_sa___pyx_scope_struct_21_add_instance {
+ PyObject_HEAD
+ PyObject *__pyx_v_al;
+ PyObject *__pyx_v_cover;
+ PyObject *__pyx_v_e_nt_cover;
+ PyObject *__pyx_v_e_words;
+ PyObject *__pyx_v_ef_span;
+ PyObject *__pyx_v_extract;
+ PyObject *__pyx_v_f_len;
+ PyObject *__pyx_v_f_words;
+ PyObject *__pyx_v_fe_span;
+ PyObject *__pyx_v_rules;
+ struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self;
+};
+
+
/* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":74
* def read_bitext(self, char* filename, int side):
* with gzip_or_text(filename) as fp:
@@ -983,6 +1007,14 @@ struct __pyx_obj_3_sa___pyx_scope_struct_2_genexpr {
PyObject *(*__pyx_t_2)(PyObject *);
};
+
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":84
+ * # in the suffix array; if discontiguous, it is the set of
+ * # actual locations (packed into an array)
+ * cdef class PhraseLocation: # <<<<<<<<<<<<<<
+ * cdef int sa_low
+ * cdef int sa_high
+ */
struct __pyx_obj_3_sa_PhraseLocation {
PyObject_HEAD
struct __pyx_vtabstruct_3_sa_PhraseLocation *__pyx_vtab;
@@ -1010,30 +1042,30 @@ struct __pyx_obj_3_sa___pyx_scope_struct_15___iter__ {
};
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2057
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2049
*
- * # 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)
+ * # 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_3_sa___pyx_scope_struct_23_fmt_rule {
+struct __pyx_obj_3_sa___pyx_scope_struct_22_form_rule {
PyObject_HEAD
- PyObject *__pyx_v_a;
+ PyObject *__pyx_v_links;
struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self;
};
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2058
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2115
* # 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_3_sa___pyx_scope_struct_24_genexpr {
+struct __pyx_obj_3_sa___pyx_scope_struct_25_genexpr {
PyObject_HEAD
- struct __pyx_obj_3_sa___pyx_scope_struct_23_fmt_rule *__pyx_outer_scope;
+ struct __pyx_obj_3_sa___pyx_scope_struct_24_fmt_rule *__pyx_outer_scope;
PyObject *__pyx_v_packed;
PyObject *__pyx_t_0;
Py_ssize_t __pyx_t_1;
@@ -1041,6 +1073,33 @@ struct __pyx_obj_3_sa___pyx_scope_struct_24_genexpr {
};
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2114
+ *
+ * # 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_3_sa___pyx_scope_struct_24_fmt_rule {
+ PyObject_HEAD
+ PyObject *__pyx_v_a;
+ struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self;
+};
+
+
+/* "/home/m/workspace/cdec/python/src/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_3_sa___pyx_scope_struct_28___str__ {
+ PyObject_HEAD
+ struct __pyx_obj_3_sa_FeatureVector *__pyx_v_self;
+};
+
+
/* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":72
* self.read_text_data(fp)
*
@@ -1055,7 +1114,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_1_read_bitext {
};
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":121
+/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":124
* return tuple(sym_fromstring(word, True) for word in words)
*
* def decode_words(syms): # <<<<<<<<<<<<<<
@@ -1081,7 +1140,7 @@ struct __pyx_obj_3_sa_FeatureVector {
};
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":111
+/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":114
* return tuple(((word, None, 1), ) for word in word_ids)
*
* def decode_lattice(lattice): # <<<<<<<<<<<<<<
@@ -1094,7 +1153,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_7_decode_lattice {
};
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":954
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":972
* return sorted(result);
*
* def input(self, fwords, meta): # <<<<<<<<<<<<<<
@@ -1118,12 +1177,14 @@ struct __pyx_obj_3_sa___pyx_scope_struct_19_input {
PyObject *__pyx_v_extract_stop;
PyObject *__pyx_v_extracts;
PyObject *__pyx_v_f;
+ PyObject *__pyx_v_f_syms;
PyObject *__pyx_v_fcount;
int __pyx_v_flen;
PyObject *__pyx_v_fphrases;
PyObject *__pyx_v_frontier;
PyObject *__pyx_v_frontier_nodes;
PyObject *__pyx_v_fwords;
+ PyObject *__pyx_v_genexpr;
struct __pyx_obj_3_sa_Phrase *__pyx_v_hiero_phrase;
long __pyx_v_hit;
int __pyx_v_i;
@@ -1132,6 +1193,8 @@ struct __pyx_obj_3_sa___pyx_scope_struct_19_input {
int __pyx_v_j;
int __pyx_v_k;
PyObject *__pyx_v_key;
+ PyObject *__pyx_v_lex_i;
+ PyObject *__pyx_v_lex_j;
PyObject *__pyx_v_loc;
PyObject *__pyx_v_locs;
int __pyx_v_lookup_required;
@@ -1154,6 +1217,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_19_input {
PyObject *__pyx_v_sa_range;
struct __pyx_obj_3_sa_IntList *__pyx_v_sample;
struct __pyx_obj_3_sa_FeatureVector *__pyx_v_scores;
+ PyObject *__pyx_v_seen_phrases;
struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self;
PyObject *__pyx_v_spanlen;
float __pyx_v_start_time;
@@ -1177,6 +1241,8 @@ struct __pyx_obj_3_sa___pyx_scope_struct_19_input {
Py_ssize_t __pyx_t_7;
Py_ssize_t __pyx_t_8;
Py_ssize_t __pyx_t_9;
+ PyObject *(*__pyx_t_10)(PyObject *);
+ PyObject *(*__pyx_t_11)(PyObject *);
};
@@ -1222,7 +1288,7 @@ struct __pyx_obj_3_sa_BitSet {
};
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":96
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":106
*
*
* cdef class Sampler: # <<<<<<<<<<<<<<
@@ -1250,7 +1316,24 @@ struct __pyx_obj_3_sa_StringMap {
};
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":36
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2161
+ * # (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_3_sa___pyx_scope_struct_26_get_f_phrases {
+ PyObject_HEAD
+ PyObject *__pyx_v_extract;
+ PyObject *__pyx_v_f_len;
+ PyObject *__pyx_v_f_words;
+ PyObject *__pyx_v_phrases;
+ struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self;
+};
+
+
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":46
* cdef int EPSILON = sym_fromstring('*EPS*', True)
*
* cdef class TrieNode: # <<<<<<<<<<<<<<
@@ -1263,7 +1346,7 @@ struct __pyx_obj_3_sa_TrieNode {
};
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":42
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":52
* self.children = {}
*
* cdef class ExtendedTrieNode(TrieNode): # <<<<<<<<<<<<<<
@@ -1293,20 +1376,7 @@ struct __pyx_obj_3_sa_TrieMap {
};
-/* "/home/m/workspace/cdec/python/src/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_3_sa___pyx_scope_struct_26___str__ {
- PyObject_HEAD
- struct __pyx_obj_3_sa_FeatureVector *__pyx_v_self;
-};
-
-
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":112
+/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":115
*
* def decode_lattice(lattice):
* return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc # <<<<<<<<<<<<<<
@@ -1333,8 +1403,8 @@ struct __pyx_obj_3_sa___pyx_scope_struct_8_genexpr {
};
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":107
- * return ALPHABET.fromstring(string, terminal)
+/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":110
+ * return sym_isvar(sym)
*
* def make_lattice(words): # <<<<<<<<<<<<<<
* word_ids = (sym_fromstring(word, True) for word in words)
@@ -1347,23 +1417,6 @@ struct __pyx_obj_3_sa___pyx_scope_struct_4_make_lattice {
};
-/* "/home/m/workspace/cdec/python/src/sa/features.pxi":21
- *
- * def __str__(self):
- * return ' '.join('%s=%s' % feat for feat in self) # <<<<<<<<<<<<<<
- *
- * cdef class Scorer:
- */
-struct __pyx_obj_3_sa___pyx_scope_struct_27_genexpr {
- PyObject_HEAD
- struct __pyx_obj_3_sa___pyx_scope_struct_26___str__ *__pyx_outer_scope;
- PyObject *__pyx_v_feat;
- PyObject *__pyx_t_0;
- Py_ssize_t __pyx_t_1;
- PyObject *(*__pyx_t_2)(PyObject *);
-};
-
-
/* "_sa.pxd":29
* cdef FloatList values
*
@@ -1381,6 +1434,22 @@ struct __pyx_obj_3_sa_Phrase {
};
+/* "/home/m/workspace/cdec/python/src/sa/features.pxi":15
+ * self.values.append(value)
+ *
+ * def __iter__(self): # <<<<<<<<<<<<<<
+ * cdef unsigned i
+ * for i in range(self.names.len):
+ */
+struct __pyx_obj_3_sa___pyx_scope_struct_27___iter__ {
+ PyObject_HEAD
+ unsigned int __pyx_v_i;
+ struct __pyx_obj_3_sa_FeatureVector *__pyx_v_self;
+ int __pyx_t_0;
+ unsigned int __pyx_t_1;
+};
+
+
/* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":81
* free(self.arr)
*
@@ -1397,7 +1466,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct____iter__ {
};
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":53
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":63
*
*
* cdef class TrieTable: # <<<<<<<<<<<<<<
@@ -1412,7 +1481,7 @@ struct __pyx_obj_3_sa_TrieTable {
};
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":108
+/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":111
*
* def make_lattice(words):
* word_ids = (sym_fromstring(word, True) for word in words) # <<<<<<<<<<<<<<
@@ -1429,7 +1498,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_5_genexpr {
};
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":116
+/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":119
*
* def decode_sentence(lattice):
* return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice) # <<<<<<<<<<<<<<
@@ -1447,22 +1516,6 @@ struct __pyx_obj_3_sa___pyx_scope_struct_10_genexpr {
};
-/* "/home/m/workspace/cdec/python/src/sa/features.pxi":15
- * self.values.append(value)
- *
- * def __iter__(self): # <<<<<<<<<<<<<<
- * cdef unsigned i
- * for i in range(self.names.len):
- */
-struct __pyx_obj_3_sa___pyx_scope_struct_25___iter__ {
- PyObject_HEAD
- unsigned int __pyx_v_i;
- struct __pyx_obj_3_sa_FeatureVector *__pyx_v_self;
- int __pyx_t_0;
- unsigned int __pyx_t_1;
-};
-
-
/* "_sa.pxd":3
* from libc.stdio cimport FILE
*
@@ -1596,7 +1649,7 @@ struct __pyx_vtabstruct_3_sa_Phrase {
static struct __pyx_vtabstruct_3_sa_Phrase *__pyx_vtabptr_3_sa_Phrase;
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":74
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":84
* # in the suffix array; if discontiguous, it is the set of
* # actual locations (packed into an array)
* cdef class PhraseLocation: # <<<<<<<<<<<<<<
@@ -1694,7 +1747,7 @@ struct __pyx_vtabstruct_3_sa_Alphabet {
static struct __pyx_vtabstruct_3_sa_Alphabet *__pyx_vtabptr_3_sa_Alphabet;
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":218
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":228
*
*
* cdef class HieroCachingRuleFactory: # <<<<<<<<<<<<<<
@@ -2370,14 +2423,16 @@ static PyTypeObject *__pyx_ptype_3_sa___pyx_scope_struct_16___str__ = 0;
static PyTypeObject *__pyx_ptype_3_sa___pyx_scope_struct_17_genexpr = 0;
static PyTypeObject *__pyx_ptype_3_sa___pyx_scope_struct_18_alignments = 0;
static PyTypeObject *__pyx_ptype_3_sa___pyx_scope_struct_19_input = 0;
-static PyTypeObject *__pyx_ptype_3_sa___pyx_scope_struct_20_add_instance = 0;
-static PyTypeObject *__pyx_ptype_3_sa___pyx_scope_struct_21_form_rule = 0;
-static PyTypeObject *__pyx_ptype_3_sa___pyx_scope_struct_22_genexpr = 0;
-static PyTypeObject *__pyx_ptype_3_sa___pyx_scope_struct_23_fmt_rule = 0;
-static PyTypeObject *__pyx_ptype_3_sa___pyx_scope_struct_24_genexpr = 0;
-static PyTypeObject *__pyx_ptype_3_sa___pyx_scope_struct_25___iter__ = 0;
-static PyTypeObject *__pyx_ptype_3_sa___pyx_scope_struct_26___str__ = 0;
-static PyTypeObject *__pyx_ptype_3_sa___pyx_scope_struct_27_genexpr = 0;
+static PyTypeObject *__pyx_ptype_3_sa___pyx_scope_struct_20_genexpr = 0;
+static PyTypeObject *__pyx_ptype_3_sa___pyx_scope_struct_21_add_instance = 0;
+static PyTypeObject *__pyx_ptype_3_sa___pyx_scope_struct_22_form_rule = 0;
+static PyTypeObject *__pyx_ptype_3_sa___pyx_scope_struct_23_genexpr = 0;
+static PyTypeObject *__pyx_ptype_3_sa___pyx_scope_struct_24_fmt_rule = 0;
+static PyTypeObject *__pyx_ptype_3_sa___pyx_scope_struct_25_genexpr = 0;
+static PyTypeObject *__pyx_ptype_3_sa___pyx_scope_struct_26_get_f_phrases = 0;
+static PyTypeObject *__pyx_ptype_3_sa___pyx_scope_struct_27___iter__ = 0;
+static PyTypeObject *__pyx_ptype_3_sa___pyx_scope_struct_28___str__ = 0;
+static PyTypeObject *__pyx_ptype_3_sa___pyx_scope_struct_29_genexpr = 0;
static int __pyx_v_3_sa_MIN_BOTTOM_SIZE;
static int __pyx_v_3_sa_MIN_BOTTOM_BITS;
static int __pyx_v_3_sa_LOWER_MASK[32];
@@ -2541,17 +2596,18 @@ static int __pyx_pf_3_sa_8Alphabet___cinit__(struct __pyx_obj_3_sa_Alphabet *__p
static void __pyx_pf_3_sa_8Alphabet_2__dealloc__(CYTHON_UNUSED struct __pyx_obj_3_sa_Alphabet *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3_sa_8Alphabet_9terminals___get__(struct __pyx_obj_3_sa_Alphabet *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3_sa_8Alphabet_12nonterminals___get__(struct __pyx_obj_3_sa_Alphabet *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_3_sa_2isvar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sym); /* proto */
static PyObject *__pyx_pf_3_sa_12make_lattice_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_3_sa_12make_lattice_3genexpr(PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_pf_3_sa_2make_lattice(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_words); /* proto */
+static PyObject *__pyx_pf_3_sa_4make_lattice(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_words); /* proto */
static PyObject *__pyx_pf_3_sa_14decode_lattice_genexpr(PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_pf_3_sa_4decode_lattice(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lattice); /* proto */
+static PyObject *__pyx_pf_3_sa_6decode_lattice(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lattice); /* proto */
static PyObject *__pyx_pf_3_sa_15decode_sentence_genexpr(PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_pf_3_sa_6decode_sentence(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lattice); /* proto */
+static PyObject *__pyx_pf_3_sa_8decode_sentence(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lattice); /* proto */
static PyObject *__pyx_pf_3_sa_12encode_words_genexpr(PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_pf_3_sa_8encode_words(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_words); /* proto */
+static PyObject *__pyx_pf_3_sa_10encode_words(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_words); /* proto */
static PyObject *__pyx_pf_3_sa_12decode_words_genexpr(PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_pf_3_sa_10decode_words(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_syms); /* proto */
+static PyObject *__pyx_pf_3_sa_12decode_words(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_syms); /* proto */
static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_words); /* proto */
static void __pyx_pf_3_sa_6Phrase_2__dealloc__(struct __pyx_obj_3_sa_Phrase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3_sa_6Phrase_4__str__(struct __pyx_obj_3_sa_Phrase *__pyx_v_self); /* proto */
@@ -2643,6 +2699,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc
static PyObject *__pyx_lambda_funcdef_lambda5(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda4(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
+static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_5input_2genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_22input(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_fwords, PyObject *__pyx_v_meta); /* proto */
static PyObject *__pyx_pf_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_3_sa_23HieroCachingRuleFactory_25add_instance(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_f_words, PyObject *__pyx_v_e_words, PyObject *__pyx_v_alignment); /* proto */
@@ -2653,9 +2710,13 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8fmt_rule_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_29fmt_rule(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_f, PyObject *__pyx_v_e, PyObject *__pyx_v_a); /* proto */
static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_3_sa_12span_check(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vec, PyObject *__pyx_v_i, PyObject *__pyx_v_j); /* proto */
-static PyObject *__pyx_pf_3_sa_14span_inc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vec, PyObject *__pyx_v_i, PyObject *__pyx_v_j); /* proto */
-static PyObject *__pyx_pf_3_sa_16span_dec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vec, PyObject *__pyx_v_i, PyObject *__pyx_v_j); /* proto */
+static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_33dump_online_rules(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_35online_ctx_lookup(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_f, PyObject *__pyx_v_e); /* proto */
+static PyObject *__pyx_pf_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); /* proto */
+static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_37get_f_phrases(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_f_words); /* proto */
+static PyObject *__pyx_pf_3_sa_14span_check(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vec, PyObject *__pyx_v_i, PyObject *__pyx_v_j); /* proto */
+static PyObject *__pyx_pf_3_sa_16span_inc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vec, PyObject *__pyx_v_i, PyObject *__pyx_v_j); /* proto */
+static PyObject *__pyx_pf_3_sa_18span_dec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vec, PyObject *__pyx_v_i, PyObject *__pyx_v_j); /* proto */
static int __pyx_pf_3_sa_13FeatureVector___cinit__(struct __pyx_obj_3_sa_FeatureVector *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3_sa_13FeatureVector_2set(struct __pyx_obj_3_sa_FeatureVector *__pyx_v_self, unsigned int __pyx_v_name, float __pyx_v_value); /* proto */
static PyObject *__pyx_pf_3_sa_13FeatureVector_4__iter__(struct __pyx_obj_3_sa_FeatureVector *__pyx_v_self); /* proto */
@@ -2766,11 +2827,12 @@ static char __pyx_k_138[] = "[X] ||| {0} ||| {1} ||| {2}";
static char __pyx_k_139[] = "------------------------------";
static char __pyx_k_141[] = " Online Stats ";
static char __pyx_k_145[] = " : ";
-static char __pyx_k_151[] = "%s=%s";
-static char __pyx_k_154[] = "/home/m/workspace/cdec/python/src/sa/_sa.pyx";
-static char __pyx_k_155[] = "cdec.sa";
-static char __pyx_k_159[] = "/home/m/workspace/cdec/python/src/sa/sym.pxi";
-static char __pyx_k_168[] = "*EPS*";
+static char __pyx_k_151[] = "OnlineFeatureContext";
+static char __pyx_k_154[] = "%s=%s";
+static char __pyx_k_157[] = "/home/m/workspace/cdec/python/src/sa/_sa.pyx";
+static char __pyx_k_158[] = "cdec.sa";
+static char __pyx_k_162[] = "/home/m/workspace/cdec/python/src/sa/sym.pxi";
+static char __pyx_k_173[] = "*EPS*";
static char __pyx_k__FE[] = "FE";
static char __pyx_k__al[] = "al";
static char __pyx_k__fe[] = "fe";
@@ -2788,6 +2850,7 @@ static char __pyx_k__e_j[] = "e_j";
static char __pyx_k__end[] = "end";
static char __pyx_k__f_i[] = "f_i";
static char __pyx_k__f_j[] = "f_j";
+static char __pyx_k__get[] = "get";
static char __pyx_k__isa[] = "isa";
static char __pyx_k__ito[] = "ito";
static char __pyx_k__key[] = "key";
@@ -2795,10 +2858,12 @@ static char __pyx_k__lhs[] = "lhs";
static char __pyx_k__low[] = "low";
static char __pyx_k__map[] = "map";
static char __pyx_k__max[] = "max";
+static char __pyx_k__ntc[] = "ntc";
static char __pyx_k__pad[] = "pad";
static char __pyx_k__pop[] = "pop";
static char __pyx_k__res[] = "res";
static char __pyx_k__set[] = "set";
+static char __pyx_k__sym[] = "sym";
static char __pyx_k__vec[] = "vec";
static char __pyx_k__zip[] = "zip";
static char __pyx_k__NULL[] = "NULL";
@@ -2827,6 +2892,9 @@ static char __pyx_k__eword[] = "eword";
static char __pyx_k__fword[] = "fword";
static char __pyx_k__ifrom[] = "ifrom";
static char __pyx_k__index[] = "index";
+static char __pyx_k__isvar[] = "isvar";
+static char __pyx_k__lex_i[] = "lex_i";
+static char __pyx_k__lex_j[] = "lex_j";
static char __pyx_k__links[] = "links";
static char __pyx_k__merge[] = "merge";
static char __pyx_k__range[] = "range";
@@ -2854,6 +2922,7 @@ static char __pyx_k__link_j[] = "link_j";
static char __pyx_k__logger[] = "logger";
static char __pyx_k__lookup[] = "lookup";
static char __pyx_k__offset[] = "offset";
+static char __pyx_k__online[] = "online";
static char __pyx_k__phrase[] = "phrase";
static char __pyx_k__q3sort[] = "q3sort";
static char __pyx_k__sa_low[] = "sa_low";
@@ -2867,6 +2936,8 @@ static char __pyx_k__unlink[] = "unlink";
static char __pyx_k__Counter[] = "Counter";
static char __pyx_k__advance[] = "advance";
static char __pyx_k__arr_low[] = "arr_low";
+static char __pyx_k__bilex_e[] = "bilex_e";
+static char __pyx_k__bilex_f[] = "bilex_f";
static char __pyx_k__collect[] = "collect";
static char __pyx_k__e_words[] = "e_words";
static char __pyx_k__edarray[] = "edarray";
@@ -2893,6 +2964,7 @@ static char __pyx_k____name__[] = "__name__";
static char __pyx_k____test__[] = "__test__";
static char __pyx_k___columns[] = "_columns";
static char __pyx_k__arr_high[] = "arr_high";
+static char __pyx_k__bilex_fe[] = "bilex_fe";
static char __pyx_k__category[] = "category";
static char __pyx_k__children[] = "children";
static char __pyx_k__curr_idx[] = "curr_idx";
@@ -2927,6 +2999,8 @@ static char __pyx_k__increment[] = "increment";
static char __pyx_k__iteritems[] = "iteritems";
static char __pyx_k__itertools[] = "itertools";
static char __pyx_k__min_bound[] = "min_bound";
+static char __pyx_k__new_lex_i[] = "new_lex_i";
+static char __pyx_k__new_lex_j[] = "new_lex_j";
static char __pyx_k__paircount[] = "paircount";
static char __pyx_k__partition[] = "partition";
static char __pyx_k__reachable[] = "reachable";
@@ -2971,6 +3045,7 @@ static char __pyx_k__StopIteration[] = "StopIteration";
static char __pyx_k__alphabet_size[] = "alphabet_size";
static char __pyx_k__from_iterable[] = "from_iterable";
static char __pyx_k__fsample_count[] = "fsample_count";
+static char __pyx_k__get_f_phrases[] = "get_f_phrases";
static char __pyx_k__new_min_bound[] = "new_min_bound";
static char __pyx_k__test_sentence[] = "test_sentence";
static char __pyx_k__tight_phrases[] = "tight_phrases";
@@ -2992,8 +3067,10 @@ static char __pyx_k__max_initial_size[] = "max_initial_size";
static char __pyx_k__max_nonterminals[] = "max_nonterminals";
static char __pyx_k__reachable_buffer[] = "reachable_buffer";
static char __pyx_k__use_collocations[] = "use_collocations";
+static char __pyx_k__dump_online_rules[] = "dump_online_rules";
static char __pyx_k__max_target_chunks[] = "max_target_chunks";
static char __pyx_k__max_target_length[] = "max_target_length";
+static char __pyx_k__online_ctx_lookup[] = "online_ctx_lookup";
static char __pyx_k__train_min_gap_size[] = "train_min_gap_size";
static char __pyx_k__pattern2phrase_plus[] = "pattern2phrase_plus";
static PyObject *__pyx_kp_s_1;
@@ -3035,10 +3112,11 @@ static PyObject *__pyx_kp_s_139;
static PyObject *__pyx_kp_s_14;
static PyObject *__pyx_kp_s_141;
static PyObject *__pyx_kp_s_145;
-static PyObject *__pyx_kp_s_151;
+static PyObject *__pyx_n_s_151;
static PyObject *__pyx_kp_s_154;
-static PyObject *__pyx_kp_s_155;
-static PyObject *__pyx_kp_s_159;
+static PyObject *__pyx_kp_s_157;
+static PyObject *__pyx_kp_s_158;
+static PyObject *__pyx_kp_s_162;
static PyObject *__pyx_kp_s_18;
static PyObject *__pyx_kp_s_2;
static PyObject *__pyx_kp_s_21;
@@ -3125,6 +3203,9 @@ static PyObject *__pyx_n_s__arity;
static PyObject *__pyx_n_s__arr;
static PyObject *__pyx_n_s__arr_high;
static PyObject *__pyx_n_s__arr_low;
+static PyObject *__pyx_n_s__bilex_e;
+static PyObject *__pyx_n_s__bilex_f;
+static PyObject *__pyx_n_s__bilex_fe;
static PyObject *__pyx_n_s__by_slack_factor;
static PyObject *__pyx_n_s__category;
static PyObject *__pyx_n_s__chain;
@@ -3140,6 +3221,7 @@ static PyObject *__pyx_n_s__decode_sentence;
static PyObject *__pyx_n_s__decode_words;
static PyObject *__pyx_n_s__defaultdict;
static PyObject *__pyx_n_s__dist;
+static PyObject *__pyx_n_s__dump_online_rules;
static PyObject *__pyx_n_s__e;
static PyObject *__pyx_n_s__e_i;
static PyObject *__pyx_n_s__e_j;
@@ -3181,9 +3263,11 @@ static PyObject *__pyx_n_s__fword;
static PyObject *__pyx_n_s__fwords;
static PyObject *__pyx_n_s__gc;
static PyObject *__pyx_n_s__genexpr;
+static PyObject *__pyx_n_s__get;
static PyObject *__pyx_n_s__getLogger;
static PyObject *__pyx_n_s__get_e_id;
static PyObject *__pyx_n_s__get_f_id;
+static PyObject *__pyx_n_s__get_f_phrases;
static PyObject *__pyx_n_s__get_id;
static PyObject *__pyx_n_s__get_next_states;
static PyObject *__pyx_n_s__get_word;
@@ -3203,6 +3287,7 @@ static PyObject *__pyx_n_s__input_match;
static PyObject *__pyx_n_s__input_span;
static PyObject *__pyx_n_s__insert;
static PyObject *__pyx_n_s__isa;
+static PyObject *__pyx_n_s__isvar;
static PyObject *__pyx_n_s__iteritems;
static PyObject *__pyx_n_s__itertools;
static PyObject *__pyx_n_s__itervalues;
@@ -3212,6 +3297,8 @@ static PyObject *__pyx_n_s__join;
static PyObject *__pyx_n_s__k;
static PyObject *__pyx_n_s__key;
static PyObject *__pyx_n_s__lattice;
+static PyObject *__pyx_n_s__lex_i;
+static PyObject *__pyx_n_s__lex_j;
static PyObject *__pyx_n_s__lhs;
static PyObject *__pyx_n_s__link;
static PyObject *__pyx_n_s__link_i;
@@ -3240,14 +3327,19 @@ static PyObject *__pyx_n_s__name;
static PyObject *__pyx_n_s__namedtuple;
static PyObject *__pyx_n_s__new_e_i;
static PyObject *__pyx_n_s__new_e_j;
+static PyObject *__pyx_n_s__new_lex_i;
+static PyObject *__pyx_n_s__new_lex_j;
static PyObject *__pyx_n_s__new_min_bound;
static PyObject *__pyx_n_s__next_states;
static PyObject *__pyx_n_s__nt;
static PyObject *__pyx_n_s__nt_collision;
static PyObject *__pyx_n_s__nt_open;
+static PyObject *__pyx_n_s__ntc;
static PyObject *__pyx_n_s__num_subpatterns;
static PyObject *__pyx_n_s__offset;
static PyObject *__pyx_n_s__old_last_nt;
+static PyObject *__pyx_n_s__online;
+static PyObject *__pyx_n_s__online_ctx_lookup;
static PyObject *__pyx_n_s__open;
static PyObject *__pyx_n_s__pad;
static PyObject *__pyx_n_s__paircount;
@@ -3302,6 +3394,7 @@ static PyObject *__pyx_n_s__start;
static PyObject *__pyx_n_s__stats;
static PyObject *__pyx_n_s__stop;
static PyObject *__pyx_n_s__suffix_link;
+static PyObject *__pyx_n_s__sym;
static PyObject *__pyx_n_s__syms;
static PyObject *__pyx_n_s__test_sentence;
static PyObject *__pyx_n_s__tight_phrases;
@@ -3397,25 +3490,29 @@ static PyObject *__pyx_k_tuple_148;
static PyObject *__pyx_k_tuple_149;
static PyObject *__pyx_k_tuple_150;
static PyObject *__pyx_k_tuple_152;
-static PyObject *__pyx_k_tuple_156;
-static PyObject *__pyx_k_tuple_157;
+static PyObject *__pyx_k_tuple_155;
+static PyObject *__pyx_k_tuple_159;
static PyObject *__pyx_k_tuple_160;
-static PyObject *__pyx_k_tuple_162;
-static PyObject *__pyx_k_tuple_164;
-static PyObject *__pyx_k_tuple_166;
+static PyObject *__pyx_k_tuple_163;
+static PyObject *__pyx_k_tuple_165;
+static PyObject *__pyx_k_tuple_167;
static PyObject *__pyx_k_tuple_169;
static PyObject *__pyx_k_tuple_171;
-static PyObject *__pyx_k_tuple_173;
+static PyObject *__pyx_k_tuple_174;
+static PyObject *__pyx_k_tuple_176;
+static PyObject *__pyx_k_tuple_178;
static PyObject *__pyx_k_codeobj_135;
static PyObject *__pyx_k_codeobj_153;
-static PyObject *__pyx_k_codeobj_158;
+static PyObject *__pyx_k_codeobj_156;
static PyObject *__pyx_k_codeobj_161;
-static PyObject *__pyx_k_codeobj_163;
-static PyObject *__pyx_k_codeobj_165;
-static PyObject *__pyx_k_codeobj_167;
+static PyObject *__pyx_k_codeobj_164;
+static PyObject *__pyx_k_codeobj_166;
+static PyObject *__pyx_k_codeobj_168;
static PyObject *__pyx_k_codeobj_170;
static PyObject *__pyx_k_codeobj_172;
-static PyObject *__pyx_k_codeobj_174;
+static PyObject *__pyx_k_codeobj_175;
+static PyObject *__pyx_k_codeobj_177;
+static PyObject *__pyx_k_codeobj_179;
/* "_sa.pyx":5
* import gzip
@@ -23624,7 +23721,7 @@ static int __pyx_f_3_sa_sym_fromstring(char *__pyx_v_string, int __pyx_v_termina
* cdef int sym_fromstring(char* string, bint terminal):
* return ALPHABET.fromstring(string, terminal) # <<<<<<<<<<<<<<
*
- * def make_lattice(words):
+ * def isvar(sym):
*/
__pyx_r = ((struct __pyx_vtabstruct_3_sa_Alphabet *)__pyx_v_3_sa_ALPHABET->__pyx_vtab)->fromstring(__pyx_v_3_sa_ALPHABET, __pyx_v_string, __pyx_v_terminal);
goto __pyx_L0;
@@ -23636,19 +23733,76 @@ static int __pyx_f_3_sa_sym_fromstring(char *__pyx_v_string, int __pyx_v_termina
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_3make_lattice(PyObject *__pyx_self, PyObject *__pyx_v_words); /*proto*/
-static PyMethodDef __pyx_mdef_3_sa_3make_lattice = {__Pyx_NAMESTR("make_lattice"), (PyCFunction)__pyx_pw_3_sa_3make_lattice, METH_O, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_3_sa_3make_lattice(PyObject *__pyx_self, PyObject *__pyx_v_words) {
+static PyObject *__pyx_pw_3_sa_3isvar(PyObject *__pyx_self, PyObject *__pyx_v_sym); /*proto*/
+static PyMethodDef __pyx_mdef_3_sa_3isvar = {__Pyx_NAMESTR("isvar"), (PyCFunction)__pyx_pw_3_sa_3isvar, METH_O, __Pyx_DOCSTR(0)};
+static PyObject *__pyx_pw_3_sa_3isvar(PyObject *__pyx_self, PyObject *__pyx_v_sym) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("isvar (wrapper)", 0);
+ __pyx_r = __pyx_pf_3_sa_2isvar(__pyx_self, ((PyObject *)__pyx_v_sym));
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":107
+ * return ALPHABET.fromstring(string, terminal)
+ *
+ * def isvar(sym): # <<<<<<<<<<<<<<
+ * return sym_isvar(sym)
+ *
+ */
+
+static PyObject *__pyx_pf_3_sa_2isvar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sym) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("isvar", 0);
+
+ /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":108
+ *
+ * def isvar(sym):
+ * return sym_isvar(sym) # <<<<<<<<<<<<<<
+ *
+ * def make_lattice(words):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_sym); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong(__pyx_f_3_sa_sym_isvar(__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("_sa.isvar", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3_sa_5make_lattice(PyObject *__pyx_self, PyObject *__pyx_v_words); /*proto*/
+static PyMethodDef __pyx_mdef_3_sa_5make_lattice = {__Pyx_NAMESTR("make_lattice"), (PyCFunction)__pyx_pw_3_sa_5make_lattice, METH_O, __Pyx_DOCSTR(0)};
+static PyObject *__pyx_pw_3_sa_5make_lattice(PyObject *__pyx_self, PyObject *__pyx_v_words) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("make_lattice (wrapper)", 0);
- __pyx_r = __pyx_pf_3_sa_2make_lattice(__pyx_self, ((PyObject *)__pyx_v_words));
+ __pyx_r = __pyx_pf_3_sa_4make_lattice(__pyx_self, ((PyObject *)__pyx_v_words));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_gb_3_sa_12make_lattice_2generator7(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":108
+/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":111
*
* def make_lattice(words):
* word_ids = (sym_fromstring(word, True) for word in words) # <<<<<<<<<<<<<<
@@ -23674,7 +23828,7 @@ static PyObject *__pyx_pf_3_sa_12make_lattice_genexpr(PyObject *__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_3_sa_12make_lattice_2generator7, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_3_sa_12make_lattice_2generator7, (PyObject *) __pyx_cur_scope); 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;
@@ -23711,13 +23865,13 @@ static PyObject *__pyx_gb_3_sa_12make_lattice_2generator7(__pyx_GeneratorObject
return NULL;
}
__pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_words)) { __Pyx_RaiseClosureNameError("words"); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_words)) { __Pyx_RaiseClosureNameError("words"); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
if (PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_words) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_words)) {
__pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_words; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
__pyx_t_3 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_words); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_words); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -23725,23 +23879,23 @@ static PyObject *__pyx_gb_3_sa_12make_lattice_2generator7(__pyx_GeneratorObject
if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 108; __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[10]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 108; __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[10]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 108; __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[10]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 108; __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[10]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_3(__pyx_t_1);
if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[10]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[10]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -23752,8 +23906,8 @@ static PyObject *__pyx_gb_3_sa_12make_lattice_2generator7(__pyx_GeneratorObject
__Pyx_GIVEREF(__pyx_t_4);
__pyx_cur_scope->__pyx_v_word = __pyx_t_4;
__pyx_t_4 = 0;
- __pyx_t_5 = PyBytes_AsString(__pyx_cur_scope->__pyx_v_word); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = PyInt_FromLong(__pyx_f_3_sa_sym_fromstring(__pyx_t_5, 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyBytes_AsString(__pyx_cur_scope->__pyx_v_word); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_f_3_sa_sym_fromstring(__pyx_t_5, 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
@@ -23772,7 +23926,7 @@ static PyObject *__pyx_gb_3_sa_12make_lattice_2generator7(__pyx_GeneratorObject
__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[10]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyErr_SetNone(PyExc_StopIteration);
@@ -23790,7 +23944,7 @@ static PyObject *__pyx_gb_3_sa_12make_lattice_2generator7(__pyx_GeneratorObject
}
static PyObject *__pyx_gb_3_sa_12make_lattice_5generator8(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":109
+/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":112
* def make_lattice(words):
* word_ids = (sym_fromstring(word, True) for word in words)
* return tuple(((word, None, 1), ) for word in word_ids) # <<<<<<<<<<<<<<
@@ -23816,7 +23970,7 @@ static PyObject *__pyx_pf_3_sa_12make_lattice_3genexpr(PyObject *__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_3_sa_12make_lattice_5generator8, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_3_sa_12make_lattice_5generator8, (PyObject *) __pyx_cur_scope); 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;
@@ -23853,13 +24007,13 @@ static PyObject *__pyx_gb_3_sa_12make_lattice_5generator8(__pyx_GeneratorObject
return NULL;
}
__pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_word_ids)) { __Pyx_RaiseClosureNameError("word_ids"); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_word_ids)) { __Pyx_RaiseClosureNameError("word_ids"); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
if (PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_word_ids) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_word_ids)) {
__pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_word_ids; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
__pyx_t_3 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_word_ids); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_word_ids); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -23867,23 +24021,23 @@ static PyObject *__pyx_gb_3_sa_12make_lattice_5generator8(__pyx_GeneratorObject
if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 109; __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[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 109; __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[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 109; __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[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 109; __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[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_3(__pyx_t_1);
if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[10]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -23894,7 +24048,7 @@ static PyObject *__pyx_gb_3_sa_12make_lattice_5generator8(__pyx_GeneratorObject
__Pyx_GIVEREF(__pyx_t_4);
__pyx_cur_scope->__pyx_v_word = __pyx_t_4;
__pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_word);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_word);
@@ -23905,7 +24059,7 @@ static PyObject *__pyx_gb_3_sa_12make_lattice_5generator8(__pyx_GeneratorObject
__Pyx_INCREF(__pyx_int_1);
PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_int_1);
__Pyx_GIVEREF(__pyx_int_1);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4));
__Pyx_GIVEREF(((PyObject *)__pyx_t_4));
@@ -23927,7 +24081,7 @@ static PyObject *__pyx_gb_3_sa_12make_lattice_5generator8(__pyx_GeneratorObject
__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[10]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyErr_SetNone(PyExc_StopIteration);
@@ -23945,15 +24099,15 @@ static PyObject *__pyx_gb_3_sa_12make_lattice_5generator8(__pyx_GeneratorObject
return NULL;
}
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":107
- * return ALPHABET.fromstring(string, terminal)
+/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":110
+ * return sym_isvar(sym)
*
* def make_lattice(words): # <<<<<<<<<<<<<<
* word_ids = (sym_fromstring(word, True) for word in words)
* return tuple(((word, None, 1), ) for word in word_ids)
*/
-static PyObject *__pyx_pf_3_sa_2make_lattice(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_words) {
+static PyObject *__pyx_pf_3_sa_4make_lattice(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_words) {
struct __pyx_obj_3_sa___pyx_scope_struct_4_make_lattice *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
@@ -23973,20 +24127,20 @@ static PyObject *__pyx_pf_3_sa_2make_lattice(CYTHON_UNUSED PyObject *__pyx_self,
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_words);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_words);
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":108
+ /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":111
*
* def make_lattice(words):
* word_ids = (sym_fromstring(word, True) for word in words) # <<<<<<<<<<<<<<
* return tuple(((word, None, 1), ) for word in word_ids)
*
*/
- __pyx_t_1 = __pyx_pf_3_sa_12make_lattice_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_pf_3_sa_12make_lattice_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_cur_scope->__pyx_v_word_ids = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":109
+ /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":112
* def make_lattice(words):
* word_ids = (sym_fromstring(word, True) for word in words)
* return tuple(((word, None, 1), ) for word in word_ids) # <<<<<<<<<<<<<<
@@ -23994,14 +24148,14 @@ static PyObject *__pyx_pf_3_sa_2make_lattice(CYTHON_UNUSED PyObject *__pyx_self,
* def decode_lattice(lattice):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_pf_3_sa_12make_lattice_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_pf_3_sa_12make_lattice_3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
@@ -24023,19 +24177,19 @@ static PyObject *__pyx_pf_3_sa_2make_lattice(CYTHON_UNUSED PyObject *__pyx_self,
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_5decode_lattice(PyObject *__pyx_self, PyObject *__pyx_v_lattice); /*proto*/
-static PyMethodDef __pyx_mdef_3_sa_5decode_lattice = {__Pyx_NAMESTR("decode_lattice"), (PyCFunction)__pyx_pw_3_sa_5decode_lattice, METH_O, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_3_sa_5decode_lattice(PyObject *__pyx_self, PyObject *__pyx_v_lattice) {
+static PyObject *__pyx_pw_3_sa_7decode_lattice(PyObject *__pyx_self, PyObject *__pyx_v_lattice); /*proto*/
+static PyMethodDef __pyx_mdef_3_sa_7decode_lattice = {__Pyx_NAMESTR("decode_lattice"), (PyCFunction)__pyx_pw_3_sa_7decode_lattice, METH_O, __Pyx_DOCSTR(0)};
+static PyObject *__pyx_pw_3_sa_7decode_lattice(PyObject *__pyx_self, PyObject *__pyx_v_lattice) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("decode_lattice (wrapper)", 0);
- __pyx_r = __pyx_pf_3_sa_4decode_lattice(__pyx_self, ((PyObject *)__pyx_v_lattice));
+ __pyx_r = __pyx_pf_3_sa_6decode_lattice(__pyx_self, ((PyObject *)__pyx_v_lattice));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":112
+/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":115
*
* def decode_lattice(lattice):
* return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc # <<<<<<<<<<<<<<
@@ -24061,7 +24215,7 @@ static PyObject *__pyx_pf_3_sa_14decode_lattice_genexpr(PyObject *__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_3_sa_14decode_lattice_2generator9, (PyObject *) __pyx_cur_scope); 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_3_sa_14decode_lattice_2generator9, (PyObject *) __pyx_cur_scope); 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;
@@ -24107,27 +24261,27 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec
return NULL;
}
__pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":113
+ /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":116
* def decode_lattice(lattice):
* return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc
* for arc in node for node in lattice) # <<<<<<<<<<<<<<
*
* def decode_sentence(lattice):
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_arc)) { __Pyx_RaiseUnboundLocalError("arc"); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ 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;} }
if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_arc) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_arc)) {
__pyx_t_1 = __pyx_cur_scope->__pyx_v_arc; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
__pyx_t_3 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_arc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_arc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
for (;;) {
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":112
+ /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":115
*
* def decode_lattice(lattice):
* return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc # <<<<<<<<<<<<<<
@@ -24137,23 +24291,23 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec
if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __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[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __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[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __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[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_3(__pyx_t_1);
if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -24169,7 +24323,7 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -24185,15 +24339,15 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(__pyx_t_7);
#else
- __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
@@ -24203,7 +24357,7 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec
__Pyx_GOTREF(__pyx_t_6);
index = 2; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed;
__Pyx_GOTREF(__pyx_t_7);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_9 = NULL;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
goto __pyx_L7_unpacking_done;
@@ -24211,7 +24365,7 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_9 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L7_unpacking_done:;
}
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_sym);
@@ -24230,19 +24384,19 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec
__pyx_cur_scope->__pyx_v_dist = __pyx_t_7;
__pyx_t_7 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":113
+ /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":116
* def decode_lattice(lattice):
* return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc
* for arc in node for node in lattice) # <<<<<<<<<<<<<<
*
* def decode_sentence(lattice):
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_node)) { __Pyx_RaiseUnboundLocalError("node"); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (unlikely(!__pyx_cur_scope->__pyx_v_node)) { __Pyx_RaiseUnboundLocalError("node"); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_node) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_node)) {
__pyx_t_4 = __pyx_cur_scope->__pyx_v_node; __Pyx_INCREF(__pyx_t_4); __pyx_t_10 = 0;
__pyx_t_11 = NULL;
} else {
- __pyx_t_10 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_node); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_node); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_11 = Py_TYPE(__pyx_t_4)->tp_iternext;
}
@@ -24250,23 +24404,23 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec
if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_4)) {
if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_4)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_4)) {
if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_7 = __pyx_t_11(__pyx_t_4);
if (unlikely(!__pyx_t_7)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[10]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -24277,12 +24431,12 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec
__Pyx_GIVEREF(__pyx_t_7);
__pyx_cur_scope->__pyx_v_arc = __pyx_t_7;
__pyx_t_7 = 0;
- if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_lattice)) { __Pyx_RaiseClosureNameError("lattice"); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_lattice)) { __Pyx_RaiseClosureNameError("lattice"); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
if (PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_lattice) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_lattice)) {
__pyx_t_7 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_lattice; __Pyx_INCREF(__pyx_t_7); __pyx_t_12 = 0;
__pyx_t_13 = NULL;
} else {
- __pyx_t_12 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_lattice); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_lattice); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_13 = Py_TYPE(__pyx_t_7)->tp_iternext;
}
@@ -24290,23 +24444,23 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec
if (!__pyx_t_13 && PyList_CheckExact(__pyx_t_7)) {
if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_7)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_6 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_12); __Pyx_INCREF(__pyx_t_6); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_12); __Pyx_INCREF(__pyx_t_6); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_13 && PyTuple_CheckExact(__pyx_t_7)) {
if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_12); __Pyx_INCREF(__pyx_t_6); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_12); __Pyx_INCREF(__pyx_t_6); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_6 = __pyx_t_13(__pyx_t_7);
if (unlikely(!__pyx_t_6)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[10]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -24318,17 +24472,17 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec
__pyx_cur_scope->__pyx_v_node = __pyx_t_6;
__pyx_t_6 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":112
+ /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":115
*
* def decode_lattice(lattice):
* return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc # <<<<<<<<<<<<<<
* for arc in node for node in lattice)
*
*/
- __pyx_t_14 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_sym); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_14)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_sym); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_14)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_6));
- __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_6));
__Pyx_GIVEREF(((PyObject *)__pyx_t_6));
@@ -24374,7 +24528,7 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec
__pyx_t_11 = __pyx_cur_scope->__pyx_t_6;
__pyx_t_12 = __pyx_cur_scope->__pyx_t_7;
__pyx_t_13 = __pyx_cur_scope->__pyx_t_8;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
@@ -24399,7 +24553,7 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec
return NULL;
}
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":111
+/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":114
* return tuple(((word, None, 1), ) for word in word_ids)
*
* def decode_lattice(lattice): # <<<<<<<<<<<<<<
@@ -24407,7 +24561,7 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec
* for arc in node for node in lattice)
*/
-static PyObject *__pyx_pf_3_sa_4decode_lattice(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lattice) {
+static PyObject *__pyx_pf_3_sa_6decode_lattice(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lattice) {
struct __pyx_obj_3_sa___pyx_scope_struct_7_decode_lattice *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
@@ -24427,7 +24581,7 @@ static PyObject *__pyx_pf_3_sa_4decode_lattice(CYTHON_UNUSED PyObject *__pyx_sel
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_lattice);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_lattice);
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":112
+ /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":115
*
* def decode_lattice(lattice):
* return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc # <<<<<<<<<<<<<<
@@ -24435,14 +24589,14 @@ static PyObject *__pyx_pf_3_sa_4decode_lattice(CYTHON_UNUSED PyObject *__pyx_sel
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_pf_3_sa_14decode_lattice_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_pf_3_sa_14decode_lattice_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
@@ -24464,19 +24618,19 @@ static PyObject *__pyx_pf_3_sa_4decode_lattice(CYTHON_UNUSED PyObject *__pyx_sel
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_7decode_sentence(PyObject *__pyx_self, PyObject *__pyx_v_lattice); /*proto*/
-static PyMethodDef __pyx_mdef_3_sa_7decode_sentence = {__Pyx_NAMESTR("decode_sentence"), (PyCFunction)__pyx_pw_3_sa_7decode_sentence, METH_O, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_3_sa_7decode_sentence(PyObject *__pyx_self, PyObject *__pyx_v_lattice) {
+static PyObject *__pyx_pw_3_sa_9decode_sentence(PyObject *__pyx_self, PyObject *__pyx_v_lattice); /*proto*/
+static PyMethodDef __pyx_mdef_3_sa_9decode_sentence = {__Pyx_NAMESTR("decode_sentence"), (PyCFunction)__pyx_pw_3_sa_9decode_sentence, METH_O, __Pyx_DOCSTR(0)};
+static PyObject *__pyx_pw_3_sa_9decode_sentence(PyObject *__pyx_self, PyObject *__pyx_v_lattice) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("decode_sentence (wrapper)", 0);
- __pyx_r = __pyx_pf_3_sa_6decode_sentence(__pyx_self, ((PyObject *)__pyx_v_lattice));
+ __pyx_r = __pyx_pf_3_sa_8decode_sentence(__pyx_self, ((PyObject *)__pyx_v_lattice));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_gb_3_sa_15decode_sentence_2generator10(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":116
+/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":119
*
* def decode_sentence(lattice):
* return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice) # <<<<<<<<<<<<<<
@@ -24502,7 +24656,7 @@ static PyObject *__pyx_pf_3_sa_15decode_sentence_genexpr(PyObject *__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_3_sa_15decode_sentence_2generator10, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_3_sa_15decode_sentence_2generator10, (PyObject *) __pyx_cur_scope); 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;
@@ -24545,13 +24699,13 @@ static PyObject *__pyx_gb_3_sa_15decode_sentence_2generator10(__pyx_GeneratorObj
return NULL;
}
__pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_lattice)) { __Pyx_RaiseClosureNameError("lattice"); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_lattice)) { __Pyx_RaiseClosureNameError("lattice"); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
if (PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_lattice) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_lattice)) {
__pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_lattice; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
__pyx_t_3 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_lattice); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_lattice); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -24559,23 +24713,23 @@ static PyObject *__pyx_gb_3_sa_15decode_sentence_2generator10(__pyx_GeneratorObj
if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __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[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __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[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __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[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __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[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_3(__pyx_t_1);
if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -24591,7 +24745,7 @@ static PyObject *__pyx_gb_3_sa_15decode_sentence_2generator10(__pyx_GeneratorObj
if (unlikely(size != 1)) {
if (size > 1) __Pyx_RaiseTooManyValuesError(1);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -24601,19 +24755,19 @@ static PyObject *__pyx_gb_3_sa_15decode_sentence_2generator10(__pyx_GeneratorObj
}
__Pyx_INCREF(__pyx_t_5);
#else
- __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
index = 0; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed;
__Pyx_GOTREF(__pyx_t_5);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_7 = NULL;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
goto __pyx_L7_unpacking_done;
@@ -24621,7 +24775,7 @@ static PyObject *__pyx_gb_3_sa_15decode_sentence_2generator10(__pyx_GeneratorObj
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_7 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L7_unpacking_done:;
}
if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
@@ -24634,7 +24788,7 @@ static PyObject *__pyx_gb_3_sa_15decode_sentence_2generator10(__pyx_GeneratorObj
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -24650,15 +24804,15 @@ static PyObject *__pyx_gb_3_sa_15decode_sentence_2generator10(__pyx_GeneratorObj
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(__pyx_t_9);
#else
- __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_10 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_7 = Py_TYPE(__pyx_t_10)->tp_iternext;
@@ -24668,7 +24822,7 @@ static PyObject *__pyx_gb_3_sa_15decode_sentence_2generator10(__pyx_GeneratorObj
__Pyx_GOTREF(__pyx_t_8);
index = 2; __pyx_t_9 = __pyx_t_7(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L8_unpacking_failed;
__Pyx_GOTREF(__pyx_t_9);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_10), 3) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_10), 3) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_7 = NULL;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
goto __pyx_L9_unpacking_done;
@@ -24676,7 +24830,7 @@ static PyObject *__pyx_gb_3_sa_15decode_sentence_2generator10(__pyx_GeneratorObj
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_7 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L9_unpacking_done:;
}
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_sym);
@@ -24694,8 +24848,8 @@ static PyObject *__pyx_gb_3_sa_15decode_sentence_2generator10(__pyx_GeneratorObj
__Pyx_GIVEREF(__pyx_t_9);
__pyx_cur_scope->__pyx_v__ = __pyx_t_9;
__pyx_t_9 = 0;
- __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_sym); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_11)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_sym); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_11)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
__pyx_r = ((PyObject *)__pyx_t_4);
__pyx_t_4 = 0;
@@ -24714,7 +24868,7 @@ static PyObject *__pyx_gb_3_sa_15decode_sentence_2generator10(__pyx_GeneratorObj
__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[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyErr_SetNone(PyExc_StopIteration);
@@ -24736,7 +24890,7 @@ static PyObject *__pyx_gb_3_sa_15decode_sentence_2generator10(__pyx_GeneratorObj
return NULL;
}
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":115
+/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":118
* for arc in node for node in lattice)
*
* def decode_sentence(lattice): # <<<<<<<<<<<<<<
@@ -24744,7 +24898,7 @@ static PyObject *__pyx_gb_3_sa_15decode_sentence_2generator10(__pyx_GeneratorObj
*
*/
-static PyObject *__pyx_pf_3_sa_6decode_sentence(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lattice) {
+static PyObject *__pyx_pf_3_sa_8decode_sentence(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lattice) {
struct __pyx_obj_3_sa___pyx_scope_struct_9_decode_sentence *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
@@ -24764,7 +24918,7 @@ static PyObject *__pyx_pf_3_sa_6decode_sentence(CYTHON_UNUSED PyObject *__pyx_se
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_lattice);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_lattice);
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":116
+ /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":119
*
* def decode_sentence(lattice):
* return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice) # <<<<<<<<<<<<<<
@@ -24772,14 +24926,14 @@ static PyObject *__pyx_pf_3_sa_6decode_sentence(CYTHON_UNUSED PyObject *__pyx_se
* def encode_words(words):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_pf_3_sa_15decode_sentence_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_pf_3_sa_15decode_sentence_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
@@ -24801,19 +24955,19 @@ static PyObject *__pyx_pf_3_sa_6decode_sentence(CYTHON_UNUSED PyObject *__pyx_se
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_9encode_words(PyObject *__pyx_self, PyObject *__pyx_v_words); /*proto*/
-static PyMethodDef __pyx_mdef_3_sa_9encode_words = {__Pyx_NAMESTR("encode_words"), (PyCFunction)__pyx_pw_3_sa_9encode_words, METH_O, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_3_sa_9encode_words(PyObject *__pyx_self, PyObject *__pyx_v_words) {
+static PyObject *__pyx_pw_3_sa_11encode_words(PyObject *__pyx_self, PyObject *__pyx_v_words); /*proto*/
+static PyMethodDef __pyx_mdef_3_sa_11encode_words = {__Pyx_NAMESTR("encode_words"), (PyCFunction)__pyx_pw_3_sa_11encode_words, METH_O, __Pyx_DOCSTR(0)};
+static PyObject *__pyx_pw_3_sa_11encode_words(PyObject *__pyx_self, PyObject *__pyx_v_words) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("encode_words (wrapper)", 0);
- __pyx_r = __pyx_pf_3_sa_8encode_words(__pyx_self, ((PyObject *)__pyx_v_words));
+ __pyx_r = __pyx_pf_3_sa_10encode_words(__pyx_self, ((PyObject *)__pyx_v_words));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_gb_3_sa_12encode_words_2generator11(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":119
+/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":122
*
* def encode_words(words):
* return tuple(sym_fromstring(word, True) for word in words) # <<<<<<<<<<<<<<
@@ -24839,7 +24993,7 @@ static PyObject *__pyx_pf_3_sa_12encode_words_genexpr(PyObject *__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_3_sa_12encode_words_2generator11, (PyObject *) __pyx_cur_scope); 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_3_sa_12encode_words_2generator11, (PyObject *) __pyx_cur_scope); 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;
@@ -24876,13 +25030,13 @@ static PyObject *__pyx_gb_3_sa_12encode_words_2generator11(__pyx_GeneratorObject
return NULL;
}
__pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_words)) { __Pyx_RaiseClosureNameError("words"); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_words)) { __Pyx_RaiseClosureNameError("words"); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
if (PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_words) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_words)) {
__pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_words; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
__pyx_t_3 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_words); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_words); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -24890,23 +25044,23 @@ static PyObject *__pyx_gb_3_sa_12encode_words_2generator11(__pyx_GeneratorObject
if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __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[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __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[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_3(__pyx_t_1);
if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -24917,8 +25071,8 @@ static PyObject *__pyx_gb_3_sa_12encode_words_2generator11(__pyx_GeneratorObject
__Pyx_GIVEREF(__pyx_t_4);
__pyx_cur_scope->__pyx_v_word = __pyx_t_4;
__pyx_t_4 = 0;
- __pyx_t_5 = PyBytes_AsString(__pyx_cur_scope->__pyx_v_word); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = PyInt_FromLong(__pyx_f_3_sa_sym_fromstring(__pyx_t_5, 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyBytes_AsString(__pyx_cur_scope->__pyx_v_word); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_f_3_sa_sym_fromstring(__pyx_t_5, 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
@@ -24937,7 +25091,7 @@ static PyObject *__pyx_gb_3_sa_12encode_words_2generator11(__pyx_GeneratorObject
__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[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyErr_SetNone(PyExc_StopIteration);
@@ -24954,7 +25108,7 @@ static PyObject *__pyx_gb_3_sa_12encode_words_2generator11(__pyx_GeneratorObject
return NULL;
}
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":118
+/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":121
* return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice)
*
* def encode_words(words): # <<<<<<<<<<<<<<
@@ -24962,7 +25116,7 @@ static PyObject *__pyx_gb_3_sa_12encode_words_2generator11(__pyx_GeneratorObject
*
*/
-static PyObject *__pyx_pf_3_sa_8encode_words(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_words) {
+static PyObject *__pyx_pf_3_sa_10encode_words(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_words) {
struct __pyx_obj_3_sa___pyx_scope_struct_11_encode_words *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
@@ -24982,7 +25136,7 @@ static PyObject *__pyx_pf_3_sa_8encode_words(CYTHON_UNUSED PyObject *__pyx_self,
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_words);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_words);
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":119
+ /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":122
*
* def encode_words(words):
* return tuple(sym_fromstring(word, True) for word in words) # <<<<<<<<<<<<<<
@@ -24990,14 +25144,14 @@ static PyObject *__pyx_pf_3_sa_8encode_words(CYTHON_UNUSED PyObject *__pyx_self,
* def decode_words(syms):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_pf_3_sa_12encode_words_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_pf_3_sa_12encode_words_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
@@ -25019,19 +25173,19 @@ static PyObject *__pyx_pf_3_sa_8encode_words(CYTHON_UNUSED PyObject *__pyx_self,
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_11decode_words(PyObject *__pyx_self, PyObject *__pyx_v_syms); /*proto*/
-static PyMethodDef __pyx_mdef_3_sa_11decode_words = {__Pyx_NAMESTR("decode_words"), (PyCFunction)__pyx_pw_3_sa_11decode_words, METH_O, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_3_sa_11decode_words(PyObject *__pyx_self, PyObject *__pyx_v_syms) {
+static PyObject *__pyx_pw_3_sa_13decode_words(PyObject *__pyx_self, PyObject *__pyx_v_syms); /*proto*/
+static PyMethodDef __pyx_mdef_3_sa_13decode_words = {__Pyx_NAMESTR("decode_words"), (PyCFunction)__pyx_pw_3_sa_13decode_words, METH_O, __Pyx_DOCSTR(0)};
+static PyObject *__pyx_pw_3_sa_13decode_words(PyObject *__pyx_self, PyObject *__pyx_v_syms) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("decode_words (wrapper)", 0);
- __pyx_r = __pyx_pf_3_sa_10decode_words(__pyx_self, ((PyObject *)__pyx_v_syms));
+ __pyx_r = __pyx_pf_3_sa_12decode_words(__pyx_self, ((PyObject *)__pyx_v_syms));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_gb_3_sa_12decode_words_2generator12(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":122
+/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":125
*
* def decode_words(syms):
* return tuple(sym_tostring(sym) for sym in syms) # <<<<<<<<<<<<<<
@@ -25055,7 +25209,7 @@ static PyObject *__pyx_pf_3_sa_12decode_words_genexpr(PyObject *__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_3_sa_12decode_words_2generator12, (PyObject *) __pyx_cur_scope); 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_3_sa_12decode_words_2generator12, (PyObject *) __pyx_cur_scope); 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;
@@ -25092,13 +25246,13 @@ static PyObject *__pyx_gb_3_sa_12decode_words_2generator12(__pyx_GeneratorObject
return NULL;
}
__pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_syms)) { __Pyx_RaiseClosureNameError("syms"); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_syms)) { __Pyx_RaiseClosureNameError("syms"); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
if (PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_syms) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_syms)) {
__pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_syms; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
__pyx_t_3 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_syms); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_syms); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -25106,23 +25260,23 @@ static PyObject *__pyx_gb_3_sa_12decode_words_2generator12(__pyx_GeneratorObject
if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __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[10]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __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[10]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_3(__pyx_t_1);
if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[10]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -25133,8 +25287,8 @@ static PyObject *__pyx_gb_3_sa_12decode_words_2generator12(__pyx_GeneratorObject
__Pyx_GIVEREF(__pyx_t_4);
__pyx_cur_scope->__pyx_v_sym = __pyx_t_4;
__pyx_t_4 = 0;
- __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_sym); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_sym); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
__pyx_r = ((PyObject *)__pyx_t_4);
__pyx_t_4 = 0;
@@ -25153,7 +25307,7 @@ static PyObject *__pyx_gb_3_sa_12decode_words_2generator12(__pyx_GeneratorObject
__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[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyErr_SetNone(PyExc_StopIteration);
@@ -25170,14 +25324,14 @@ static PyObject *__pyx_gb_3_sa_12decode_words_2generator12(__pyx_GeneratorObject
return NULL;
}
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":121
+/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":124
* return tuple(sym_fromstring(word, True) for word in words)
*
* def decode_words(syms): # <<<<<<<<<<<<<<
* return tuple(sym_tostring(sym) for sym in syms)
*/
-static PyObject *__pyx_pf_3_sa_10decode_words(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_syms) {
+static PyObject *__pyx_pf_3_sa_12decode_words(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_syms) {
struct __pyx_obj_3_sa___pyx_scope_struct_13_decode_words *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
@@ -25197,20 +25351,20 @@ static PyObject *__pyx_pf_3_sa_10decode_words(CYTHON_UNUSED PyObject *__pyx_self
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_syms);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_syms);
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":122
+ /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":125
*
* def decode_words(syms):
* return tuple(sym_tostring(sym) for sym in syms) # <<<<<<<<<<<<<<
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_pf_3_sa_12decode_words_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_pf_3_sa_12decode_words_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
@@ -36566,7 +36720,7 @@ static int __pyx_pw_3_sa_8TrieNode_1__cinit__(PyObject *__pyx_v_self, PyObject *
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":39
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":49
* cdef public children
*
* def __cinit__(self): # <<<<<<<<<<<<<<
@@ -36583,14 +36737,14 @@ static int __pyx_pf_3_sa_8TrieNode___cinit__(struct __pyx_obj_3_sa_TrieNode *__p
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":40
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":50
*
* def __cinit__(self):
* self.children = {} # <<<<<<<<<<<<<<
*
* cdef class ExtendedTrieNode(TrieNode):
*/
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__Pyx_GIVEREF(((PyObject *)__pyx_t_1));
__Pyx_GOTREF(__pyx_v_self->children);
@@ -36620,7 +36774,7 @@ static PyObject *__pyx_pw_3_sa_8TrieNode_8children_1__get__(PyObject *__pyx_v_se
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":37
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":47
*
* cdef class TrieNode:
* cdef public children # <<<<<<<<<<<<<<
@@ -36709,7 +36863,7 @@ static int __pyx_pw_3_sa_16ExtendedTrieNode_1__cinit__(PyObject *__pyx_v_self, P
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__phrase,&__pyx_n_s__phrase_location,&__pyx_n_s__suffix_link,0};
PyObject* values[3] = {0,0,0};
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":47
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":57
* cdef public suffix_link
*
* def __cinit__(self, phrase=None, phrase_location=None, suffix_link=None): # <<<<<<<<<<<<<<
@@ -36748,7 +36902,7 @@ static int __pyx_pw_3_sa_16ExtendedTrieNode_1__cinit__(PyObject *__pyx_v_self, P
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -36765,7 +36919,7 @@ static int __pyx_pw_3_sa_16ExtendedTrieNode_1__cinit__(PyObject *__pyx_v_self, P
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.ExtendedTrieNode.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -36781,7 +36935,7 @@ static int __pyx_pf_3_sa_16ExtendedTrieNode___cinit__(struct __pyx_obj_3_sa_Exte
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":48
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":58
*
* def __cinit__(self, phrase=None, phrase_location=None, suffix_link=None):
* self.phrase = phrase # <<<<<<<<<<<<<<
@@ -36794,7 +36948,7 @@ static int __pyx_pf_3_sa_16ExtendedTrieNode___cinit__(struct __pyx_obj_3_sa_Exte
__Pyx_DECREF(__pyx_v_self->phrase);
__pyx_v_self->phrase = __pyx_v_phrase;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":49
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":59
* def __cinit__(self, phrase=None, phrase_location=None, suffix_link=None):
* self.phrase = phrase
* self.phrase_location = phrase_location # <<<<<<<<<<<<<<
@@ -36807,7 +36961,7 @@ static int __pyx_pf_3_sa_16ExtendedTrieNode___cinit__(struct __pyx_obj_3_sa_Exte
__Pyx_DECREF(__pyx_v_self->phrase_location);
__pyx_v_self->phrase_location = __pyx_v_phrase_location;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":50
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":60
* self.phrase = phrase
* self.phrase_location = phrase_location
* self.suffix_link = suffix_link # <<<<<<<<<<<<<<
@@ -36836,7 +36990,7 @@ static PyObject *__pyx_pw_3_sa_16ExtendedTrieNode_6phrase_1__get__(PyObject *__p
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":43
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":53
*
* cdef class ExtendedTrieNode(TrieNode):
* cdef public phrase # <<<<<<<<<<<<<<
@@ -36923,7 +37077,7 @@ static PyObject *__pyx_pw_3_sa_16ExtendedTrieNode_15phrase_location_1__get__(PyO
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":44
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":54
* cdef class ExtendedTrieNode(TrieNode):
* cdef public phrase
* cdef public phrase_location # <<<<<<<<<<<<<<
@@ -37010,7 +37164,7 @@ static PyObject *__pyx_pw_3_sa_16ExtendedTrieNode_11suffix_link_1__get__(PyObjec
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":45
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":55
* cdef public phrase
* cdef public phrase_location
* cdef public suffix_link # <<<<<<<<<<<<<<
@@ -37114,7 +37268,7 @@ static int __pyx_pw_3_sa_9TrieTable_1__cinit__(PyObject *__pyx_v_self, PyObject
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -37127,7 +37281,7 @@ static int __pyx_pw_3_sa_9TrieTable_1__cinit__(PyObject *__pyx_v_self, PyObject
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.TrieTable.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -37138,7 +37292,7 @@ static int __pyx_pw_3_sa_9TrieTable_1__cinit__(PyObject *__pyx_v_self, PyObject
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":57
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":67
* cdef public int count
* cdef public root
* def __cinit__(self, extended=False): # <<<<<<<<<<<<<<
@@ -37157,7 +37311,7 @@ static int __pyx_pf_3_sa_9TrieTable___cinit__(struct __pyx_obj_3_sa_TrieTable *_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":58
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":68
* cdef public root
* def __cinit__(self, extended=False):
* self.count = 0 # <<<<<<<<<<<<<<
@@ -37166,34 +37320,34 @@ static int __pyx_pf_3_sa_9TrieTable___cinit__(struct __pyx_obj_3_sa_TrieTable *_
*/
__pyx_v_self->count = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":59
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":69
* def __cinit__(self, extended=False):
* self.count = 0
* self.extended = extended # <<<<<<<<<<<<<<
* if extended:
* self.root = ExtendedTrieNode()
*/
- __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_extended); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_extended); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->extended = __pyx_t_1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":60
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":70
* self.count = 0
* self.extended = extended
* if extended: # <<<<<<<<<<<<<<
* self.root = ExtendedTrieNode()
* else:
*/
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_extended); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_extended); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":61
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":71
* self.extended = extended
* if extended:
* self.root = ExtendedTrieNode() # <<<<<<<<<<<<<<
* else:
* self.root = TrieNode()
*/
- __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__Pyx_GOTREF(__pyx_v_self->root);
@@ -37204,14 +37358,14 @@ static int __pyx_pf_3_sa_9TrieTable___cinit__(struct __pyx_obj_3_sa_TrieTable *_
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":63
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":73
* self.root = ExtendedTrieNode()
* else:
* self.root = TrieNode() # <<<<<<<<<<<<<<
*
* # linked list structure for storing matches in BaselineRuleFactory
*/
- __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_TrieNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_TrieNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__Pyx_GOTREF(__pyx_v_self->root);
@@ -37243,7 +37397,7 @@ static PyObject *__pyx_pw_3_sa_9TrieTable_8extended_1__get__(PyObject *__pyx_v_s
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":54
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":64
*
* cdef class TrieTable:
* cdef public int extended # <<<<<<<<<<<<<<
@@ -37260,7 +37414,7 @@ static PyObject *__pyx_pf_3_sa_9TrieTable_8extended___get__(struct __pyx_obj_3_s
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyInt_FromLong(__pyx_v_self->extended); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_v_self->extended); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -37297,7 +37451,7 @@ static int __pyx_pf_3_sa_9TrieTable_8extended_2__set__(struct __pyx_obj_3_sa_Tri
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
- __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->extended = __pyx_t_1;
__pyx_r = 0;
@@ -37321,7 +37475,7 @@ static PyObject *__pyx_pw_3_sa_9TrieTable_5count_1__get__(PyObject *__pyx_v_self
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":55
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":65
* cdef class TrieTable:
* cdef public int extended
* cdef public int count # <<<<<<<<<<<<<<
@@ -37338,7 +37492,7 @@ static PyObject *__pyx_pf_3_sa_9TrieTable_5count___get__(struct __pyx_obj_3_sa_T
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyInt_FromLong(__pyx_v_self->count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_v_self->count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -37375,7 +37529,7 @@ static int __pyx_pf_3_sa_9TrieTable_5count_2__set__(struct __pyx_obj_3_sa_TrieTa
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
- __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->count = __pyx_t_1;
__pyx_r = 0;
@@ -37399,7 +37553,7 @@ static PyObject *__pyx_pw_3_sa_9TrieTable_4root_1__get__(PyObject *__pyx_v_self)
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":56
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":66
* cdef public int extended
* cdef public int count
* cdef public root # <<<<<<<<<<<<<<
@@ -37475,7 +37629,7 @@ static int __pyx_pf_3_sa_9TrieTable_4root_4__del__(struct __pyx_obj_3_sa_TrieTab
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":83
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":93
*
* # returns true if sent_id is contained
* cdef int contains(self, int sent_id): # <<<<<<<<<<<<<<
@@ -37488,7 +37642,7 @@ static int __pyx_f_3_sa_14PhraseLocation_contains(CYTHON_UNUSED struct __pyx_obj
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("contains", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":84
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":94
* # returns true if sent_id is contained
* cdef int contains(self, int sent_id):
* return 1 # <<<<<<<<<<<<<<
@@ -37520,7 +37674,7 @@ static int __pyx_pw_3_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v_self, PyO
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__sa_low,&__pyx_n_s__sa_high,&__pyx_n_s__arr_low,&__pyx_n_s__arr_high,&__pyx_n_s__arr,&__pyx_n_s__num_subpatterns,0};
PyObject* values[6] = {0,0,0,0,0,0};
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":87
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":97
*
* def __cinit__(self, int sa_low=-1, int sa_high=-1, int arr_low=-1, int arr_high=-1,
* arr=None, int num_subpatterns=1): # <<<<<<<<<<<<<<
@@ -37575,7 +37729,7 @@ static int __pyx_pw_3_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v_self, PyO
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -37590,35 +37744,35 @@ static int __pyx_pw_3_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v_self, PyO
}
}
if (values[0]) {
- __pyx_v_sa_low = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_sa_low == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_sa_low = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_sa_low == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_sa_low = ((int)-1);
}
if (values[1]) {
- __pyx_v_sa_high = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_sa_high == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_sa_high = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_sa_high == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_sa_high = ((int)-1);
}
if (values[2]) {
- __pyx_v_arr_low = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_arr_low == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_arr_low = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_arr_low == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_arr_low = ((int)-1);
}
if (values[3]) {
- __pyx_v_arr_high = __Pyx_PyInt_AsInt(values[3]); if (unlikely((__pyx_v_arr_high == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_arr_high = __Pyx_PyInt_AsInt(values[3]); if (unlikely((__pyx_v_arr_high == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_arr_high = ((int)-1);
}
__pyx_v_arr = values[4];
if (values[5]) {
- __pyx_v_num_subpatterns = __Pyx_PyInt_AsInt(values[5]); if (unlikely((__pyx_v_num_subpatterns == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_num_subpatterns = __Pyx_PyInt_AsInt(values[5]); if (unlikely((__pyx_v_num_subpatterns == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_num_subpatterns = ((int)1);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.PhraseLocation.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -37629,7 +37783,7 @@ static int __pyx_pw_3_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v_self, PyO
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":86
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":96
* return 1
*
* def __cinit__(self, int sa_low=-1, int sa_high=-1, int arr_low=-1, int arr_high=-1, # <<<<<<<<<<<<<<
@@ -37645,7 +37799,7 @@ static int __pyx_pf_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_3_sa_Phrase
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":88
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":98
* def __cinit__(self, int sa_low=-1, int sa_high=-1, int arr_low=-1, int arr_high=-1,
* arr=None, int num_subpatterns=1):
* self.sa_low = sa_low # <<<<<<<<<<<<<<
@@ -37654,7 +37808,7 @@ static int __pyx_pf_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_3_sa_Phrase
*/
__pyx_v_self->sa_low = __pyx_v_sa_low;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":89
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":99
* arr=None, int num_subpatterns=1):
* self.sa_low = sa_low
* self.sa_high = sa_high # <<<<<<<<<<<<<<
@@ -37663,7 +37817,7 @@ static int __pyx_pf_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_3_sa_Phrase
*/
__pyx_v_self->sa_high = __pyx_v_sa_high;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":90
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":100
* self.sa_low = sa_low
* self.sa_high = sa_high
* self.arr_low = arr_low # <<<<<<<<<<<<<<
@@ -37672,7 +37826,7 @@ static int __pyx_pf_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_3_sa_Phrase
*/
__pyx_v_self->arr_low = __pyx_v_arr_low;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":91
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":101
* self.sa_high = sa_high
* self.arr_low = arr_low
* self.arr_high = arr_high # <<<<<<<<<<<<<<
@@ -37681,21 +37835,21 @@ static int __pyx_pf_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_3_sa_Phrase
*/
__pyx_v_self->arr_high = __pyx_v_arr_high;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":92
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":102
* self.arr_low = arr_low
* self.arr_high = arr_high
* self.arr = arr # <<<<<<<<<<<<<<
* self.num_subpatterns = num_subpatterns
*
*/
- if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_INCREF(__pyx_v_arr);
__Pyx_GIVEREF(__pyx_v_arr);
__Pyx_GOTREF(__pyx_v_self->arr);
__Pyx_DECREF(((PyObject *)__pyx_v_self->arr));
__pyx_v_self->arr = ((struct __pyx_obj_3_sa_IntList *)__pyx_v_arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":93
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":103
* self.arr_high = arr_high
* self.arr = arr
* self.num_subpatterns = num_subpatterns # <<<<<<<<<<<<<<
@@ -37742,11 +37896,11 @@ static int __pyx_pw_3_sa_7Sampler_1__cinit__(PyObject *__pyx_v_self, PyObject *_
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fsarray)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
@@ -37754,18 +37908,18 @@ static int __pyx_pw_3_sa_7Sampler_1__cinit__(PyObject *__pyx_v_self, PyObject *_
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
- __pyx_v_sample_size = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_sample_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_sample_size = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_sample_size == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_v_fsarray = ((struct __pyx_obj_3_sa_SuffixArray *)values[1]);
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.Sampler.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fsarray), __pyx_ptype_3_sa_SuffixArray, 1, "fsarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fsarray), __pyx_ptype_3_sa_SuffixArray, 1, "fsarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_r = __pyx_pf_3_sa_7Sampler___cinit__(((struct __pyx_obj_3_sa_Sampler *)__pyx_v_self), __pyx_v_sample_size, __pyx_v_fsarray);
goto __pyx_L0;
__pyx_L1_error:;
@@ -37775,7 +37929,7 @@ static int __pyx_pw_3_sa_7Sampler_1__cinit__(PyObject *__pyx_v_self, PyObject *_
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":103
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":113
* cdef IntList sa
*
* def __cinit__(self, int sample_size, SuffixArray fsarray): # <<<<<<<<<<<<<<
@@ -37795,7 +37949,7 @@ static int __pyx_pf_3_sa_7Sampler___cinit__(struct __pyx_obj_3_sa_Sampler *__pyx
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":104
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":114
*
* def __cinit__(self, int sample_size, SuffixArray fsarray):
* self.sample_size = sample_size # <<<<<<<<<<<<<<
@@ -37804,7 +37958,7 @@ static int __pyx_pf_3_sa_7Sampler___cinit__(struct __pyx_obj_3_sa_Sampler *__pyx
*/
__pyx_v_self->sample_size = __pyx_v_sample_size;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":105
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":115
* def __cinit__(self, int sample_size, SuffixArray fsarray):
* self.sample_size = sample_size
* self.sa = fsarray.sa # <<<<<<<<<<<<<<
@@ -37817,7 +37971,7 @@ static int __pyx_pf_3_sa_7Sampler___cinit__(struct __pyx_obj_3_sa_Sampler *__pyx
__Pyx_DECREF(((PyObject *)__pyx_v_self->sa));
__pyx_v_self->sa = __pyx_v_fsarray->sa;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":106
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":116
* self.sample_size = sample_size
* self.sa = fsarray.sa
* if sample_size > 0: # <<<<<<<<<<<<<<
@@ -37827,21 +37981,21 @@ static int __pyx_pf_3_sa_7Sampler___cinit__(struct __pyx_obj_3_sa_Sampler *__pyx
__pyx_t_1 = (__pyx_v_sample_size > 0);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":107
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":117
* self.sa = fsarray.sa
* if sample_size > 0:
* logger.info("Sampling strategy: uniform, max sample size = %d", sample_size) # <<<<<<<<<<<<<<
* else:
* logger.info("Sampling strategy: no sampling")
*/
- __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyInt_FromLong(__pyx_v_sample_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong(__pyx_v_sample_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_100));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_100));
@@ -37849,7 +38003,7 @@ static int __pyx_pf_3_sa_7Sampler___cinit__(struct __pyx_obj_3_sa_Sampler *__pyx
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
@@ -37858,19 +38012,19 @@ static int __pyx_pf_3_sa_7Sampler___cinit__(struct __pyx_obj_3_sa_Sampler *__pyx
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":109
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":119
* logger.info("Sampling strategy: uniform, max sample size = %d", sample_size)
* else:
* logger.info("Sampling strategy: no sampling") # <<<<<<<<<<<<<<
*
* def sample(self, PhraseLocation phrase_location):
*/
- __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__info); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__info); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_102), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_102), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -37897,7 +38051,7 @@ static PyObject *__pyx_pw_3_sa_7Sampler_3sample(PyObject *__pyx_v_self, PyObject
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("sample (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_phrase_location), __pyx_ptype_3_sa_PhraseLocation, 1, "phrase_location", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_phrase_location), __pyx_ptype_3_sa_PhraseLocation, 1, "phrase_location", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_r = __pyx_pf_3_sa_7Sampler_2sample(((struct __pyx_obj_3_sa_Sampler *)__pyx_v_self), ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_v_phrase_location));
goto __pyx_L0;
__pyx_L1_error:;
@@ -37907,7 +38061,7 @@ static PyObject *__pyx_pw_3_sa_7Sampler_3sample(PyObject *__pyx_v_self, PyObject
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":111
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":121
* logger.info("Sampling strategy: no sampling")
*
* def sample(self, PhraseLocation phrase_location): # <<<<<<<<<<<<<<
@@ -37934,19 +38088,19 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("sample", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":124
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":134
* cdef int num_locations, val, j
*
* sample = IntList() # <<<<<<<<<<<<<<
* if phrase_location.arr is None:
* num_locations = phrase_location.sa_high - phrase_location.sa_low
*/
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_sample = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":125
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":135
*
* sample = IntList()
* if phrase_location.arr is None: # <<<<<<<<<<<<<<
@@ -37956,7 +38110,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
__pyx_t_2 = (((PyObject *)__pyx_v_phrase_location->arr) == Py_None);
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":126
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":136
* sample = IntList()
* if phrase_location.arr is None:
* num_locations = phrase_location.sa_high - phrase_location.sa_low # <<<<<<<<<<<<<<
@@ -37965,7 +38119,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
*/
__pyx_v_num_locations = (__pyx_v_phrase_location->sa_high - __pyx_v_phrase_location->sa_low);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":127
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":137
* if phrase_location.arr is None:
* num_locations = phrase_location.sa_high - phrase_location.sa_low
* if self.sample_size == -1 or num_locations <= self.sample_size: # <<<<<<<<<<<<<<
@@ -37981,7 +38135,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
}
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":128
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":138
* num_locations = phrase_location.sa_high - phrase_location.sa_low
* if self.sample_size == -1 or num_locations <= self.sample_size:
* sample._extend_arr(self.sa.arr + phrase_location.sa_low, num_locations) # <<<<<<<<<<<<<<
@@ -37993,7 +38147,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":130
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":140
* sample._extend_arr(self.sa.arr + phrase_location.sa_low, num_locations)
* else:
* stepsize = float(num_locations)/float(self.sample_size) # <<<<<<<<<<<<<<
@@ -38002,11 +38156,11 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
*/
if (unlikely(((double)__pyx_v_self->sample_size) == 0)) {
PyErr_Format(PyExc_ZeroDivisionError, "float division");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_v_stepsize = (((double)__pyx_v_num_locations) / ((double)__pyx_v_self->sample_size));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":131
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":141
* else:
* stepsize = float(num_locations)/float(self.sample_size)
* i = phrase_location.sa_low # <<<<<<<<<<<<<<
@@ -38015,7 +38169,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
*/
__pyx_v_i = __pyx_v_phrase_location->sa_low;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":132
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":142
* stepsize = float(num_locations)/float(self.sample_size)
* i = phrase_location.sa_low
* while i < phrase_location.sa_high and sample.len < self.sample_size: # <<<<<<<<<<<<<<
@@ -38032,7 +38186,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
}
if (!__pyx_t_3) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":135
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":145
* '''Note: int(i) not guaranteed to have the desired
* effect, according to the python documentation'''
* if fmod(i,1.0) > 0.5: # <<<<<<<<<<<<<<
@@ -38042,7 +38196,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
__pyx_t_3 = (fmod(__pyx_v_i, 1.0) > 0.5);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":136
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":146
* effect, according to the python documentation'''
* if fmod(i,1.0) > 0.5:
* val = int(ceil(i)) # <<<<<<<<<<<<<<
@@ -38054,7 +38208,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":138
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":148
* val = int(ceil(i))
* else:
* val = int(floor(i)) # <<<<<<<<<<<<<<
@@ -38065,7 +38219,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
}
__pyx_L7:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":139
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":149
* else:
* val = int(floor(i))
* sample._append(self.sa.arr[val]) # <<<<<<<<<<<<<<
@@ -38074,7 +38228,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_sample->__pyx_vtab)->_append(__pyx_v_sample, (__pyx_v_self->sa->arr[__pyx_v_val]));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":140
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":150
* val = int(floor(i))
* sample._append(self.sa.arr[val])
* i = i + stepsize # <<<<<<<<<<<<<<
@@ -38089,7 +38243,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":142
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":152
* i = i + stepsize
* else:
* num_locations = (phrase_location.arr_high - phrase_location.arr_low) / phrase_location.num_subpatterns # <<<<<<<<<<<<<<
@@ -38099,15 +38253,15 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
__pyx_t_5 = (__pyx_v_phrase_location->arr_high - __pyx_v_phrase_location->arr_low);
if (unlikely(__pyx_v_phrase_location->num_subpatterns == 0)) {
PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
else if (sizeof(int) == sizeof(long) && unlikely(__pyx_v_phrase_location->num_subpatterns == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_5))) {
PyErr_Format(PyExc_OverflowError, "value too large to perform division");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_v_num_locations = __Pyx_div_int(__pyx_t_5, __pyx_v_phrase_location->num_subpatterns);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":143
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":153
* else:
* num_locations = (phrase_location.arr_high - phrase_location.arr_low) / phrase_location.num_subpatterns
* if self.sample_size == -1 or num_locations <= self.sample_size: # <<<<<<<<<<<<<<
@@ -38123,7 +38277,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
}
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":144
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":154
* num_locations = (phrase_location.arr_high - phrase_location.arr_low) / phrase_location.num_subpatterns
* if self.sample_size == -1 or num_locations <= self.sample_size:
* sample = phrase_location.arr # <<<<<<<<<<<<<<
@@ -38137,7 +38291,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":146
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":156
* sample = phrase_location.arr
* else:
* stepsize = float(num_locations)/float(self.sample_size) # <<<<<<<<<<<<<<
@@ -38146,11 +38300,11 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
*/
if (unlikely(((double)__pyx_v_self->sample_size) == 0)) {
PyErr_Format(PyExc_ZeroDivisionError, "float division");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_v_stepsize = (((double)__pyx_v_num_locations) / ((double)__pyx_v_self->sample_size));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":147
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":157
* else:
* stepsize = float(num_locations)/float(self.sample_size)
* i = phrase_location.arr_low # <<<<<<<<<<<<<<
@@ -38159,7 +38313,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
*/
__pyx_v_i = __pyx_v_phrase_location->arr_low;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":148
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":158
* stepsize = float(num_locations)/float(self.sample_size)
* i = phrase_location.arr_low
* while i < num_locations and sample.len < self.sample_size * phrase_location.num_subpatterns: # <<<<<<<<<<<<<<
@@ -38176,7 +38330,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
}
if (!__pyx_t_4) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":151
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":161
* '''Note: int(i) not guaranteed to have the desired
* effect, according to the python documentation'''
* if fmod(i,1.0) > 0.5: # <<<<<<<<<<<<<<
@@ -38186,7 +38340,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
__pyx_t_4 = (fmod(__pyx_v_i, 1.0) > 0.5);
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":152
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":162
* effect, according to the python documentation'''
* if fmod(i,1.0) > 0.5:
* val = int(ceil(i)) # <<<<<<<<<<<<<<
@@ -38198,7 +38352,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":154
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":164
* val = int(ceil(i))
* else:
* val = int(floor(i)) # <<<<<<<<<<<<<<
@@ -38209,7 +38363,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
}
__pyx_L11:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":155
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":165
* else:
* val = int(floor(i))
* j = phrase_location.arr_low + (val*phrase_location.num_subpatterns) # <<<<<<<<<<<<<<
@@ -38218,7 +38372,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
*/
__pyx_v_j = (__pyx_v_phrase_location->arr_low + (__pyx_v_val * __pyx_v_phrase_location->num_subpatterns));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":156
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":166
* val = int(floor(i))
* j = phrase_location.arr_low + (val*phrase_location.num_subpatterns)
* sample._extend_arr(phrase_location.arr.arr + j, phrase_location.num_subpatterns) # <<<<<<<<<<<<<<
@@ -38227,7 +38381,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_sample->__pyx_vtab)->_extend_arr(__pyx_v_sample, (__pyx_v_phrase_location->arr->arr + __pyx_v_j), __pyx_v_phrase_location->num_subpatterns);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":157
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":167
* j = phrase_location.arr_low + (val*phrase_location.num_subpatterns)
* sample._extend_arr(phrase_location.arr.arr + j, phrase_location.num_subpatterns)
* i = i + stepsize # <<<<<<<<<<<<<<
@@ -38241,7 +38395,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":158
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":168
* sample._extend_arr(phrase_location.arr.arr + j, phrase_location.num_subpatterns)
* i = i + stepsize
* return sample # <<<<<<<<<<<<<<
@@ -38266,7 +38420,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":170
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":180
*
*
* cdef void assign_matching(Matching* m, int* arr, int start, int step, int* sent_id_arr): # <<<<<<<<<<<<<<
@@ -38278,7 +38432,7 @@ static void __pyx_f_3_sa_assign_matching(struct __pyx_t_3_sa_Matching *__pyx_v_m
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("assign_matching", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":171
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":181
*
* cdef void assign_matching(Matching* m, int* arr, int start, int step, int* sent_id_arr):
* m.arr = arr # <<<<<<<<<<<<<<
@@ -38287,7 +38441,7 @@ static void __pyx_f_3_sa_assign_matching(struct __pyx_t_3_sa_Matching *__pyx_v_m
*/
__pyx_v_m->arr = __pyx_v_arr;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":172
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":182
* cdef void assign_matching(Matching* m, int* arr, int start, int step, int* sent_id_arr):
* m.arr = arr
* m.start = start # <<<<<<<<<<<<<<
@@ -38296,7 +38450,7 @@ static void __pyx_f_3_sa_assign_matching(struct __pyx_t_3_sa_Matching *__pyx_v_m
*/
__pyx_v_m->start = __pyx_v_start;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":173
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":183
* m.arr = arr
* m.start = start
* m.end = start + step # <<<<<<<<<<<<<<
@@ -38305,7 +38459,7 @@ static void __pyx_f_3_sa_assign_matching(struct __pyx_t_3_sa_Matching *__pyx_v_m
*/
__pyx_v_m->end = (__pyx_v_start + __pyx_v_step);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":174
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":184
* m.start = start
* m.end = start + step
* m.sent_id = sent_id_arr[arr[start]] # <<<<<<<<<<<<<<
@@ -38314,7 +38468,7 @@ static void __pyx_f_3_sa_assign_matching(struct __pyx_t_3_sa_Matching *__pyx_v_m
*/
__pyx_v_m->sent_id = (__pyx_v_sent_id_arr[(__pyx_v_arr[__pyx_v_start])]);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":175
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":185
* m.end = start + step
* m.sent_id = sent_id_arr[arr[start]]
* m.size = step # <<<<<<<<<<<<<<
@@ -38326,7 +38480,7 @@ static void __pyx_f_3_sa_assign_matching(struct __pyx_t_3_sa_Matching *__pyx_v_m
__Pyx_RefNannyFinishContext();
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":178
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":188
*
*
* cdef int* append_combined_matching(int* arr, Matching* loc1, Matching* loc2, # <<<<<<<<<<<<<<
@@ -38343,7 +38497,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx
int __pyx_t_2;
__Pyx_RefNannySetupContext("append_combined_matching", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":182
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":192
* cdef int i, new_len
*
* new_len = result_len[0] + num_subpatterns # <<<<<<<<<<<<<<
@@ -38352,7 +38506,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx
*/
__pyx_v_new_len = ((__pyx_v_result_len[0]) + __pyx_v_num_subpatterns);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":183
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":193
*
* new_len = result_len[0] + num_subpatterns
* arr = <int*> realloc(arr, new_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -38361,7 +38515,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx
*/
__pyx_v_arr = ((int *)realloc(__pyx_v_arr, (__pyx_v_new_len * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":185
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":195
* arr = <int*> realloc(arr, new_len*sizeof(int))
*
* for i from 0 <= i < loc1.size: # <<<<<<<<<<<<<<
@@ -38371,7 +38525,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx
__pyx_t_1 = __pyx_v_loc1->size;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":186
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":196
*
* for i from 0 <= i < loc1.size:
* arr[result_len[0]+i] = loc1.arr[loc1.start+i] # <<<<<<<<<<<<<<
@@ -38381,7 +38535,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx
(__pyx_v_arr[((__pyx_v_result_len[0]) + __pyx_v_i)]) = (__pyx_v_loc1->arr[(__pyx_v_loc1->start + __pyx_v_i)]);
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":187
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":197
* for i from 0 <= i < loc1.size:
* arr[result_len[0]+i] = loc1.arr[loc1.start+i]
* if num_subpatterns > loc1.size: # <<<<<<<<<<<<<<
@@ -38391,7 +38545,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx
__pyx_t_2 = (__pyx_v_num_subpatterns > __pyx_v_loc1->size);
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":188
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":198
* arr[result_len[0]+i] = loc1.arr[loc1.start+i]
* if num_subpatterns > loc1.size:
* arr[new_len-1] = loc2.arr[loc2.end-1] # <<<<<<<<<<<<<<
@@ -38403,7 +38557,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":189
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":199
* if num_subpatterns > loc1.size:
* arr[new_len-1] = loc2.arr[loc2.end-1]
* result_len[0] = new_len # <<<<<<<<<<<<<<
@@ -38412,7 +38566,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx
*/
(__pyx_v_result_len[0]) = __pyx_v_new_len;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":190
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":200
* arr[new_len-1] = loc2.arr[loc2.end-1]
* result_len[0] = new_len
* return arr # <<<<<<<<<<<<<<
@@ -38428,7 +38582,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":193
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":203
*
*
* cdef int* extend_arr(int* arr, int* arr_len, int* appendix, int appendix_len): # <<<<<<<<<<<<<<
@@ -38442,7 +38596,7 @@ static int *__pyx_f_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr_len, int
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("extend_arr", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":196
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":206
* cdef int new_len
*
* new_len = arr_len[0] + appendix_len # <<<<<<<<<<<<<<
@@ -38451,7 +38605,7 @@ static int *__pyx_f_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr_len, int
*/
__pyx_v_new_len = ((__pyx_v_arr_len[0]) + __pyx_v_appendix_len);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":197
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":207
*
* new_len = arr_len[0] + appendix_len
* arr = <int*> realloc(arr, new_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -38460,7 +38614,7 @@ static int *__pyx_f_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr_len, int
*/
__pyx_v_arr = ((int *)realloc(__pyx_v_arr, (__pyx_v_new_len * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":198
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":208
* 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)) # <<<<<<<<<<<<<<
@@ -38469,7 +38623,7 @@ static int *__pyx_f_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr_len, int
*/
memcpy((__pyx_v_arr + (__pyx_v_arr_len[0])), __pyx_v_appendix, (__pyx_v_appendix_len * (sizeof(int))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":199
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":209
* arr = <int*> realloc(arr, new_len*sizeof(int))
* memcpy(arr+arr_len[0], appendix, appendix_len*sizeof(int))
* arr_len[0] = new_len # <<<<<<<<<<<<<<
@@ -38478,7 +38632,7 @@ static int *__pyx_f_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr_len, int
*/
(__pyx_v_arr_len[0]) = __pyx_v_new_len;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":200
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":210
* memcpy(arr+arr_len[0], appendix, appendix_len*sizeof(int))
* arr_len[0] = new_len
* return arr # <<<<<<<<<<<<<<
@@ -38494,7 +38648,7 @@ static int *__pyx_f_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr_len, int
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":202
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":212
* return arr
*
* cdef int median(int low, int high, int step): # <<<<<<<<<<<<<<
@@ -38511,7 +38665,7 @@ static int __pyx_f_3_sa_median(int __pyx_v_low, int __pyx_v_high, int __pyx_v_st
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("median", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":203
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":213
*
* cdef int median(int low, int high, int step):
* return low + (((high - low)/step)/2)*step # <<<<<<<<<<<<<<
@@ -38521,11 +38675,11 @@ static int __pyx_f_3_sa_median(int __pyx_v_low, int __pyx_v_high, int __pyx_v_st
__pyx_t_1 = (__pyx_v_high - __pyx_v_low);
if (unlikely(__pyx_v_step == 0)) {
PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
else if (sizeof(int) == sizeof(long) && unlikely(__pyx_v_step == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_1))) {
PyErr_Format(PyExc_OverflowError, "value too large to perform division");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_r = (__pyx_v_low + (__Pyx_div_long(__Pyx_div_int(__pyx_t_1, __pyx_v_step), 2) * __pyx_v_step));
goto __pyx_L0;
@@ -38540,7 +38694,7 @@ static int __pyx_f_3_sa_median(int __pyx_v_low, int __pyx_v_high, int __pyx_v_st
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":206
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":216
*
*
* cdef void find_comparable_matchings(int low, int high, int* arr, int step, int loc, int* loc_minus, int* loc_plus): # <<<<<<<<<<<<<<
@@ -38555,7 +38709,7 @@ static void __pyx_f_3_sa_find_comparable_matchings(int __pyx_v_low, int __pyx_v_
int __pyx_t_3;
__Pyx_RefNannySetupContext("find_comparable_matchings", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":210
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":220
* # in which all matchings have the same first index as the one
* # starting at loc
* loc_plus[0] = loc + step # <<<<<<<<<<<<<<
@@ -38564,7 +38718,7 @@ static void __pyx_f_3_sa_find_comparable_matchings(int __pyx_v_low, int __pyx_v_
*/
(__pyx_v_loc_plus[0]) = (__pyx_v_loc + __pyx_v_step);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":211
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":221
* # starting at loc
* loc_plus[0] = loc + step
* while loc_plus[0] < high and arr[loc_plus[0]] == arr[loc]: # <<<<<<<<<<<<<<
@@ -38581,7 +38735,7 @@ static void __pyx_f_3_sa_find_comparable_matchings(int __pyx_v_low, int __pyx_v_
}
if (!__pyx_t_3) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":212
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":222
* loc_plus[0] = loc + step
* while loc_plus[0] < high and arr[loc_plus[0]] == arr[loc]:
* loc_plus[0] = loc_plus[0] + step # <<<<<<<<<<<<<<
@@ -38591,7 +38745,7 @@ static void __pyx_f_3_sa_find_comparable_matchings(int __pyx_v_low, int __pyx_v_
(__pyx_v_loc_plus[0]) = ((__pyx_v_loc_plus[0]) + __pyx_v_step);
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":213
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":223
* while loc_plus[0] < high and arr[loc_plus[0]] == arr[loc]:
* loc_plus[0] = loc_plus[0] + step
* loc_minus[0] = loc # <<<<<<<<<<<<<<
@@ -38600,7 +38754,7 @@ static void __pyx_f_3_sa_find_comparable_matchings(int __pyx_v_low, int __pyx_v_
*/
(__pyx_v_loc_minus[0]) = __pyx_v_loc;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":214
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":224
* loc_plus[0] = loc_plus[0] + step
* loc_minus[0] = loc
* while loc_minus[0]-step >= low and arr[loc_minus[0]-step] == arr[loc]: # <<<<<<<<<<<<<<
@@ -38617,7 +38771,7 @@ static void __pyx_f_3_sa_find_comparable_matchings(int __pyx_v_low, int __pyx_v_
}
if (!__pyx_t_2) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":215
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":225
* loc_minus[0] = loc
* while loc_minus[0]-step >= low and arr[loc_minus[0]-step] == arr[loc]:
* loc_minus[0] = loc_minus[0] - step # <<<<<<<<<<<<<<
@@ -38661,7 +38815,7 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__alignment,&__pyx_n_s__by_slack_factor,&__pyx_n_s__category,&__pyx_n_s__max_chunks,&__pyx_n_s__max_initial_size,&__pyx_n_s__max_length,&__pyx_n_s__max_nonterminals,&__pyx_n_s__max_target_chunks,&__pyx_n_s__max_target_length,&__pyx_n_s__min_gap_size,&__pyx_n_s__precompute_file,&__pyx_n_s_70,&__pyx_n_s__precompute_rank,&__pyx_n_s_103,&__pyx_n_s_104,&__pyx_n_s_71,&__pyx_n_s__train_min_gap_size,&__pyx_n_s__tight_phrases,&__pyx_n_s__use_baeza_yates,&__pyx_n_s__use_collocations,&__pyx_n_s__use_index,0};
PyObject* values[21] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":283
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":295
* 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, # <<<<<<<<<<<<<<
@@ -38670,7 +38824,7 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_
*/
values[3] = ((PyObject *)Py_None);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":291
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":303
* 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, # <<<<<<<<<<<<<<
@@ -38679,7 +38833,7 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_
*/
values[7] = ((PyObject *)Py_None);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":293
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":305
* 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, # <<<<<<<<<<<<<<
@@ -38688,7 +38842,7 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_
*/
values[8] = ((PyObject *)Py_None);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":297
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":309
* unsigned min_gap_size=2,
* # filename of file containing precomputed collocations
* precompute_file=None, # <<<<<<<<<<<<<<
@@ -38831,7 +38985,7 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -38862,10 +39016,10 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_
}
__pyx_v_alignment = ((struct __pyx_obj_3_sa_Alignment *)values[0]);
if (values[1]) {
- __pyx_v_by_slack_factor = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_by_slack_factor == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_by_slack_factor = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_by_slack_factor == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":279
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":291
* Alignment alignment,
* # parameter for double-binary search; doesn't seem to matter much
* float by_slack_factor=1.0, # <<<<<<<<<<<<<<
@@ -38875,49 +39029,49 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_
__pyx_v_by_slack_factor = ((float)1.0);
}
if (values[2]) {
- __pyx_v_category = PyBytes_AsString(values[2]); if (unlikely((!__pyx_v_category) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_category = PyBytes_AsString(values[2]); if (unlikely((!__pyx_v_category) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_category = ((char *)__pyx_k_105);
}
__pyx_v_max_chunks = values[3];
if (values[4]) {
- __pyx_v_max_initial_size = __Pyx_PyInt_AsUnsignedInt(values[4]); if (unlikely((__pyx_v_max_initial_size == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_max_initial_size = __Pyx_PyInt_AsUnsignedInt(values[4]); if (unlikely((__pyx_v_max_initial_size == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_max_initial_size = ((unsigned int)10);
}
if (values[5]) {
- __pyx_v_max_length = __Pyx_PyInt_AsUnsignedInt(values[5]); if (unlikely((__pyx_v_max_length == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_max_length = __Pyx_PyInt_AsUnsignedInt(values[5]); if (unlikely((__pyx_v_max_length == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_max_length = ((unsigned int)5);
}
if (values[6]) {
- __pyx_v_max_nonterminals = __Pyx_PyInt_AsUnsignedInt(values[6]); if (unlikely((__pyx_v_max_nonterminals == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_max_nonterminals = __Pyx_PyInt_AsUnsignedInt(values[6]); if (unlikely((__pyx_v_max_nonterminals == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_max_nonterminals = ((unsigned int)2);
}
__pyx_v_max_target_chunks = values[7];
__pyx_v_max_target_length = values[8];
if (values[9]) {
- __pyx_v_min_gap_size = __Pyx_PyInt_AsUnsignedInt(values[9]); if (unlikely((__pyx_v_min_gap_size == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_min_gap_size = __Pyx_PyInt_AsUnsignedInt(values[9]); if (unlikely((__pyx_v_min_gap_size == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_min_gap_size = ((unsigned int)2);
}
__pyx_v_precompute_file = values[10];
if (values[11]) {
- __pyx_v_precompute_secondary_rank = __Pyx_PyInt_AsUnsignedInt(values[11]); if (unlikely((__pyx_v_precompute_secondary_rank == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_precompute_secondary_rank = __Pyx_PyInt_AsUnsignedInt(values[11]); if (unlikely((__pyx_v_precompute_secondary_rank == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_precompute_secondary_rank = ((unsigned int)20);
}
if (values[12]) {
- __pyx_v_precompute_rank = __Pyx_PyInt_AsUnsignedInt(values[12]); if (unlikely((__pyx_v_precompute_rank == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_precompute_rank = __Pyx_PyInt_AsUnsignedInt(values[12]); if (unlikely((__pyx_v_precompute_rank == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_precompute_rank = ((unsigned int)100);
}
if (values[13]) {
- __pyx_v_require_aligned_terminal = __Pyx_PyObject_IsTrue(values[13]); if (unlikely((__pyx_v_require_aligned_terminal == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_require_aligned_terminal = __Pyx_PyObject_IsTrue(values[13]); if (unlikely((__pyx_v_require_aligned_terminal == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":303
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":315
* unsigned precompute_rank=100,
* # require extracted rules to have at least one aligned word
* bint require_aligned_terminal=True, # <<<<<<<<<<<<<<
@@ -38927,10 +39081,10 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_
__pyx_v_require_aligned_terminal = ((int)1);
}
if (values[14]) {
- __pyx_v_require_aligned_chunks = __Pyx_PyObject_IsTrue(values[14]); if (unlikely((__pyx_v_require_aligned_chunks == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_require_aligned_chunks = __Pyx_PyObject_IsTrue(values[14]); if (unlikely((__pyx_v_require_aligned_chunks == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":305
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":317
* bint require_aligned_terminal=True,
* # require each contiguous chunk of extracted rules to have at least one aligned word
* bint require_aligned_chunks=False, # <<<<<<<<<<<<<<
@@ -38940,20 +39094,20 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_
__pyx_v_require_aligned_chunks = ((int)0);
}
if (values[15]) {
- __pyx_v_train_max_initial_size = __Pyx_PyInt_AsUnsignedInt(values[15]); if (unlikely((__pyx_v_train_max_initial_size == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_train_max_initial_size = __Pyx_PyInt_AsUnsignedInt(values[15]); if (unlikely((__pyx_v_train_max_initial_size == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_train_max_initial_size = ((unsigned int)10);
}
if (values[16]) {
- __pyx_v_train_min_gap_size = __Pyx_PyInt_AsUnsignedInt(values[16]); if (unlikely((__pyx_v_train_min_gap_size == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_train_min_gap_size = __Pyx_PyInt_AsUnsignedInt(values[16]); if (unlikely((__pyx_v_train_min_gap_size == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_train_min_gap_size = ((unsigned int)2);
}
if (values[17]) {
- __pyx_v_tight_phrases = __Pyx_PyObject_IsTrue(values[17]); if (unlikely((__pyx_v_tight_phrases == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_tight_phrases = __Pyx_PyObject_IsTrue(values[17]); if (unlikely((__pyx_v_tight_phrases == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":311
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":323
* unsigned train_min_gap_size=2,
* # False if phrases should be loose (better but slower), True otherwise
* bint tight_phrases=True, # <<<<<<<<<<<<<<
@@ -38963,10 +39117,10 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_
__pyx_v_tight_phrases = ((int)1);
}
if (values[18]) {
- __pyx_v_use_baeza_yates = __Pyx_PyObject_IsTrue(values[18]); if (unlikely((__pyx_v_use_baeza_yates == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_use_baeza_yates = __Pyx_PyObject_IsTrue(values[18]); if (unlikely((__pyx_v_use_baeza_yates == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":313
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":325
* bint tight_phrases=True,
* # True to require use of double-binary alg, false otherwise
* bint use_baeza_yates=True, # <<<<<<<<<<<<<<
@@ -38976,10 +39130,10 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_
__pyx_v_use_baeza_yates = ((int)1);
}
if (values[19]) {
- __pyx_v_use_collocations = __Pyx_PyObject_IsTrue(values[19]); if (unlikely((__pyx_v_use_collocations == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_use_collocations = __Pyx_PyObject_IsTrue(values[19]); if (unlikely((__pyx_v_use_collocations == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":315
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":327
* bint use_baeza_yates=True,
* # True to enable used of precomputed collocations
* bint use_collocations=True, # <<<<<<<<<<<<<<
@@ -38989,10 +39143,10 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_
__pyx_v_use_collocations = ((int)1);
}
if (values[20]) {
- __pyx_v_use_index = __Pyx_PyObject_IsTrue(values[20]); if (unlikely((__pyx_v_use_index == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_use_index = __Pyx_PyObject_IsTrue(values[20]); if (unlikely((__pyx_v_use_index == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":317
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":329
* bint use_collocations=True,
* # True to enable use of precomputed inverted indices
* bint use_index=True): # <<<<<<<<<<<<<<
@@ -39004,13 +39158,13 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 21, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 21, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.HieroCachingRuleFactory.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_alignment), __pyx_ptype_3_sa_Alignment, 1, "alignment", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_alignment), __pyx_ptype_3_sa_Alignment, 1, "alignment", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_r = __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(((struct __pyx_obj_3_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_alignment, __pyx_v_by_slack_factor, __pyx_v_category, __pyx_v_max_chunks, __pyx_v_max_initial_size, __pyx_v_max_length, __pyx_v_max_nonterminals, __pyx_v_max_target_chunks, __pyx_v_max_target_length, __pyx_v_min_gap_size, __pyx_v_precompute_file, __pyx_v_precompute_secondary_rank, __pyx_v_precompute_rank, __pyx_v_require_aligned_terminal, __pyx_v_require_aligned_chunks, __pyx_v_train_max_initial_size, __pyx_v_train_min_gap_size, __pyx_v_tight_phrases, __pyx_v_use_baeza_yates, __pyx_v_use_collocations, __pyx_v_use_index);
goto __pyx_L0;
__pyx_L1_error:;
@@ -39032,7 +39186,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9__cinit___lambda1(PyOb
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":387
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":405
* self.phrases_f = defaultdict(int)
* self.phrases_e = defaultdict(int)
* self.phrases_fe = defaultdict(lambda: defaultdict(int)) # <<<<<<<<<<<<<<
@@ -39051,14 +39205,14 @@ static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("lambda1", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyInt_Type))));
__Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
@@ -39092,7 +39246,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9__cinit___1lambda2(PyO
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":388
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":406
* self.phrases_e = defaultdict(int)
* self.phrases_fe = defaultdict(lambda: defaultdict(int))
* self.phrases_al = defaultdict(lambda: defaultdict(tuple)) # <<<<<<<<<<<<<<
@@ -39111,14 +39265,14 @@ static PyObject *__pyx_lambda_funcdef_lambda2(CYTHON_UNUSED PyObject *__pyx_self
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("lambda2", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)((PyObject*)(&PyTuple_Type))));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyTuple_Type))));
__Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyTuple_Type))));
- __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
@@ -39152,7 +39306,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9__cinit___2lambda3(PyO
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":393
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":411
* self.bilex_f = defaultdict(int)
* self.bilex_e = defaultdict(int)
* self.bilex_fe = defaultdict(lambda: defaultdict(int)) # <<<<<<<<<<<<<<
@@ -39171,14 +39325,14 @@ static PyObject *__pyx_lambda_funcdef_lambda3(CYTHON_UNUSED PyObject *__pyx_self
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("lambda3", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyInt_Type))));
__Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
@@ -39200,7 +39354,7 @@ static PyObject *__pyx_lambda_funcdef_lambda3(CYTHON_UNUSED PyObject *__pyx_self
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":275
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":287
* cdef bilex_fe
*
* def __cinit__(self, # <<<<<<<<<<<<<<
@@ -39221,21 +39375,21 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":323
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":335
* respectively. This is because Chiang's model does not require
* them to be the same, therefore we don't either.'''
* self.rules = TrieTable(True) # cache # <<<<<<<<<<<<<<
* self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation())
* if alignment is None:
*/
- __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_TrieTable)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_TrieTable)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__Pyx_GIVEREF(__pyx_t_1);
@@ -39244,20 +39398,20 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
__pyx_v_self->rules = ((struct __pyx_obj_3_sa_TrieTable *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":324
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":336
* them to be the same, therefore we don't either.'''
* self.rules = TrieTable(True) # cache
* self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation()) # <<<<<<<<<<<<<<
* if alignment is None:
* raise Exception("Must specify an alignment object")
*/
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_GIVEREF(__pyx_t_2);
@@ -39266,7 +39420,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
__pyx_v_self->rules->root = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":325
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":337
* self.rules = TrieTable(True) # cache
* self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation())
* if alignment is None: # <<<<<<<<<<<<<<
@@ -39276,23 +39430,23 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
__pyx_t_3 = (((PyObject *)__pyx_v_alignment) == Py_None);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":326
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":338
* self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation())
* if alignment is None:
* raise Exception("Must specify an alignment object") # <<<<<<<<<<<<<<
* self.alignment = alignment
*
*/
- __pyx_t_2 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_107), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_107), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L3;
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":327
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":339
* if alignment is None:
* raise Exception("Must specify an alignment object")
* self.alignment = alignment # <<<<<<<<<<<<<<
@@ -39305,7 +39459,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
__Pyx_DECREF(((PyObject *)__pyx_v_self->alignment));
__pyx_v_self->alignment = __pyx_v_alignment;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":331
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":343
* # grammar parameters and settings
* # NOTE: setting max_nonterminals > 2 is not currently supported in Hiero
* self.max_length = max_length # <<<<<<<<<<<<<<
@@ -39314,7 +39468,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
*/
__pyx_v_self->max_length = __pyx_v_max_length;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":332
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":344
* # NOTE: setting max_nonterminals > 2 is not currently supported in Hiero
* self.max_length = max_length
* self.max_nonterminals = max_nonterminals # <<<<<<<<<<<<<<
@@ -39323,7 +39477,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
*/
__pyx_v_self->max_nonterminals = __pyx_v_max_nonterminals;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":333
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":345
* self.max_length = max_length
* self.max_nonterminals = max_nonterminals
* self.max_initial_size = max_initial_size # <<<<<<<<<<<<<<
@@ -39332,7 +39486,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
*/
__pyx_v_self->max_initial_size = __pyx_v_max_initial_size;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":334
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":346
* self.max_nonterminals = max_nonterminals
* self.max_initial_size = max_initial_size
* self.train_max_initial_size = train_max_initial_size # <<<<<<<<<<<<<<
@@ -39341,7 +39495,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
*/
__pyx_v_self->train_max_initial_size = __pyx_v_train_max_initial_size;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":335
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":347
* self.max_initial_size = max_initial_size
* self.train_max_initial_size = train_max_initial_size
* self.min_gap_size = min_gap_size # <<<<<<<<<<<<<<
@@ -39350,7 +39504,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
*/
__pyx_v_self->min_gap_size = __pyx_v_min_gap_size;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":336
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":348
* 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 # <<<<<<<<<<<<<<
@@ -39359,7 +39513,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
*/
__pyx_v_self->train_min_gap_size = __pyx_v_train_min_gap_size;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":337
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":349
* self.min_gap_size = min_gap_size
* self.train_min_gap_size = train_min_gap_size
* self.category = sym_fromstring(category, False) # <<<<<<<<<<<<<<
@@ -39368,7 +39522,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
*/
__pyx_v_self->category = __pyx_f_3_sa_sym_fromstring(__pyx_v_category, 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":339
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":351
* self.category = sym_fromstring(category, False)
*
* if max_chunks is None: # <<<<<<<<<<<<<<
@@ -39378,7 +39532,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
__pyx_t_3 = (__pyx_v_max_chunks == Py_None);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":340
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":352
*
* if max_chunks is None:
* self.max_chunks = self.max_nonterminals + 1 # <<<<<<<<<<<<<<
@@ -39390,19 +39544,19 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":342
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":354
* self.max_chunks = self.max_nonterminals + 1
* else:
* self.max_chunks = max_chunks # <<<<<<<<<<<<<<
*
* if max_target_chunks is None:
*/
- __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_max_chunks); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_max_chunks); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->max_chunks = __pyx_t_4;
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":344
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":356
* self.max_chunks = max_chunks
*
* if max_target_chunks is None: # <<<<<<<<<<<<<<
@@ -39412,7 +39566,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
__pyx_t_3 = (__pyx_v_max_target_chunks == Py_None);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":345
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":357
*
* if max_target_chunks is None:
* self.max_target_chunks = self.max_nonterminals + 1 # <<<<<<<<<<<<<<
@@ -39424,19 +39578,19 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":347
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":359
* self.max_target_chunks = self.max_nonterminals + 1
* else:
* self.max_target_chunks = max_target_chunks # <<<<<<<<<<<<<<
*
* if max_target_length is None:
*/
- __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_max_target_chunks); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_max_target_chunks); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->max_target_chunks = __pyx_t_4;
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":349
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":361
* self.max_target_chunks = max_target_chunks
*
* if max_target_length is None: # <<<<<<<<<<<<<<
@@ -39446,7 +39600,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
__pyx_t_3 = (__pyx_v_max_target_length == Py_None);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":350
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":362
*
* if max_target_length is None:
* self.max_target_length = max_initial_size # <<<<<<<<<<<<<<
@@ -39458,26 +39612,26 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":352
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":364
* self.max_target_length = max_initial_size
* else:
* self.max_target_length = max_target_length # <<<<<<<<<<<<<<
*
* # algorithmic parameters and settings
*/
- __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_max_target_length); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_max_target_length); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->max_target_length = __pyx_t_4;
}
__pyx_L6:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":355
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":367
*
* # algorithmic parameters and settings
* self.precomputed_collocations = {} # <<<<<<<<<<<<<<
* self.precomputed_index = {}
* self.use_index = use_index
*/
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
__Pyx_GIVEREF(((PyObject *)__pyx_t_2));
__Pyx_GOTREF(__pyx_v_self->precomputed_collocations);
@@ -39485,14 +39639,14 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
__pyx_v_self->precomputed_collocations = ((PyObject *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":356
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":368
* # algorithmic parameters and settings
* self.precomputed_collocations = {}
* self.precomputed_index = {} # <<<<<<<<<<<<<<
* self.use_index = use_index
* self.use_collocations = use_collocations
*/
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
__Pyx_GIVEREF(((PyObject *)__pyx_t_2));
__Pyx_GOTREF(__pyx_v_self->precomputed_index);
@@ -39500,7 +39654,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
__pyx_v_self->precomputed_index = ((PyObject *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":357
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":369
* self.precomputed_collocations = {}
* self.precomputed_index = {}
* self.use_index = use_index # <<<<<<<<<<<<<<
@@ -39509,7 +39663,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
*/
__pyx_v_self->use_index = __pyx_v_use_index;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":358
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":370
* self.precomputed_index = {}
* self.use_index = use_index
* self.use_collocations = use_collocations # <<<<<<<<<<<<<<
@@ -39518,14 +39672,14 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
*/
__pyx_v_self->use_collocations = __pyx_v_use_collocations;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":359
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":371
* self.use_index = use_index
* self.use_collocations = use_collocations
* self.max_rank = {} # <<<<<<<<<<<<<<
* self.precompute_file = precompute_file
* self.precompute_rank = precompute_rank
*/
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
__Pyx_GIVEREF(((PyObject *)__pyx_t_2));
__Pyx_GOTREF(__pyx_v_self->max_rank);
@@ -39533,7 +39687,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
__pyx_v_self->max_rank = ((PyObject *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":360
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":372
* self.use_collocations = use_collocations
* self.max_rank = {}
* self.precompute_file = precompute_file # <<<<<<<<<<<<<<
@@ -39546,7 +39700,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
__Pyx_DECREF(__pyx_v_self->precompute_file);
__pyx_v_self->precompute_file = __pyx_v_precompute_file;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":361
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":373
* self.max_rank = {}
* self.precompute_file = precompute_file
* self.precompute_rank = precompute_rank # <<<<<<<<<<<<<<
@@ -39555,7 +39709,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
*/
__pyx_v_self->precompute_rank = __pyx_v_precompute_rank;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":362
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":374
* self.precompute_file = precompute_file
* self.precompute_rank = precompute_rank
* self.precompute_secondary_rank = precompute_secondary_rank # <<<<<<<<<<<<<<
@@ -39564,7 +39718,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
*/
__pyx_v_self->precompute_secondary_rank = __pyx_v_precompute_secondary_rank;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":363
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":375
* self.precompute_rank = precompute_rank
* self.precompute_secondary_rank = precompute_secondary_rank
* self.use_baeza_yates = use_baeza_yates # <<<<<<<<<<<<<<
@@ -39573,7 +39727,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
*/
__pyx_v_self->use_baeza_yates = __pyx_v_use_baeza_yates;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":364
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":376
* self.precompute_secondary_rank = precompute_secondary_rank
* self.use_baeza_yates = use_baeza_yates
* self.by_slack_factor = by_slack_factor # <<<<<<<<<<<<<<
@@ -39582,7 +39736,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
*/
__pyx_v_self->by_slack_factor = __pyx_v_by_slack_factor;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":365
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":377
* self.use_baeza_yates = use_baeza_yates
* self.by_slack_factor = by_slack_factor
* self.tight_phrases = tight_phrases # <<<<<<<<<<<<<<
@@ -39591,7 +39745,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
*/
__pyx_v_self->tight_phrases = __pyx_v_tight_phrases;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":367
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":379
* self.tight_phrases = tight_phrases
*
* if require_aligned_chunks: # <<<<<<<<<<<<<<
@@ -39600,7 +39754,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
*/
if (__pyx_v_require_aligned_chunks) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":369
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":381
* if require_aligned_chunks:
* # one condition is a stronger version of the other.
* self.require_aligned_chunks = self.require_aligned_terminal = True # <<<<<<<<<<<<<<
@@ -39612,7 +39766,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
goto __pyx_L7;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":370
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":382
* # one condition is a stronger version of the other.
* self.require_aligned_chunks = self.require_aligned_terminal = True
* elif require_aligned_terminal: # <<<<<<<<<<<<<<
@@ -39621,7 +39775,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
*/
if (__pyx_v_require_aligned_terminal) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":371
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":383
* self.require_aligned_chunks = self.require_aligned_terminal = True
* elif require_aligned_terminal:
* self.require_aligned_chunks = False # <<<<<<<<<<<<<<
@@ -39630,7 +39784,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
*/
__pyx_v_self->require_aligned_chunks = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":372
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":384
* elif require_aligned_terminal:
* self.require_aligned_chunks = False
* self.require_aligned_terminal = True # <<<<<<<<<<<<<<
@@ -39642,7 +39796,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":374
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":386
* self.require_aligned_terminal = True
* else:
* self.require_aligned_chunks = self.require_aligned_terminal = False # <<<<<<<<<<<<<<
@@ -39654,7 +39808,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
}
__pyx_L7:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":377
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":389
*
* # diagnostics
* self.prev_norm_prefix = () # <<<<<<<<<<<<<<
@@ -39667,17 +39821,17 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
__Pyx_DECREF(__pyx_v_self->prev_norm_prefix);
__pyx_v_self->prev_norm_prefix = ((PyObject *)__pyx_empty_tuple);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":379
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":391
* self.prev_norm_prefix = ()
*
* self.findexes = IntList(initial_len=10) # <<<<<<<<<<<<<<
* self.findexes1 = IntList(initial_len=10)
*
*/
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
- if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__initial_len), __pyx_int_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__initial_len), __pyx_int_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__Pyx_GIVEREF(__pyx_t_1);
@@ -39686,17 +39840,17 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
__pyx_v_self->findexes = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":380
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":392
*
* self.findexes = IntList(initial_len=10)
* self.findexes1 = IntList(initial_len=10) # <<<<<<<<<<<<<<
*
* # Online stats
*/
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__initial_len), __pyx_int_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__initial_len), __pyx_int_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_GIVEREF(__pyx_t_2);
@@ -39705,179 +39859,212 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
__pyx_v_self->findexes1 = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":385
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":397
+ *
+ * # True after data is added
+ * self.online = False # <<<<<<<<<<<<<<
+ *
+ * # Keep track of everything that can be sampled:
+ */
+ __pyx_v_self->online = 0;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":400
+ *
+ * # Keep track of everything that can be sampled:
+ * self.samples_f = defaultdict(int) # <<<<<<<<<<<<<<
*
* # Phrase counts
- * self.phrases_f = defaultdict(int) # <<<<<<<<<<<<<<
- * self.phrases_e = defaultdict(int)
- * self.phrases_fe = defaultdict(lambda: defaultdict(int))
*/
- __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)(&PyInt_Type))));
__Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_GIVEREF(__pyx_t_5);
- __Pyx_GOTREF(__pyx_v_self->phrases_f);
- __Pyx_DECREF(__pyx_v_self->phrases_f);
- __pyx_v_self->phrases_f = __pyx_t_5;
+ __Pyx_GOTREF(__pyx_v_self->samples_f);
+ __Pyx_DECREF(__pyx_v_self->samples_f);
+ __pyx_v_self->samples_f = __pyx_t_5;
__pyx_t_5 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":386
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":403
+ *
* # Phrase counts
- * self.phrases_f = defaultdict(int)
- * self.phrases_e = defaultdict(int) # <<<<<<<<<<<<<<
+ * self.phrases_f = defaultdict(int) # <<<<<<<<<<<<<<
+ * self.phrases_e = defaultdict(int)
* self.phrases_fe = defaultdict(lambda: defaultdict(int))
- * self.phrases_al = defaultdict(lambda: defaultdict(tuple))
*/
- __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)(&PyInt_Type))));
__Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_GIVEREF(__pyx_t_2);
+ __Pyx_GOTREF(__pyx_v_self->phrases_f);
+ __Pyx_DECREF(__pyx_v_self->phrases_f);
+ __pyx_v_self->phrases_f = __pyx_t_2;
+ __pyx_t_2 = 0;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":404
+ * # Phrase counts
+ * self.phrases_f = defaultdict(int)
+ * self.phrases_e = defaultdict(int) # <<<<<<<<<<<<<<
+ * self.phrases_fe = defaultdict(lambda: defaultdict(int))
+ * self.phrases_al = defaultdict(lambda: defaultdict(tuple))
+ */
+ __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
+ PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)(&PyInt_Type))));
+ __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
+ __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+ __Pyx_GIVEREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_v_self->phrases_e);
__Pyx_DECREF(__pyx_v_self->phrases_e);
- __pyx_v_self->phrases_e = __pyx_t_2;
- __pyx_t_2 = 0;
+ __pyx_v_self->phrases_e = __pyx_t_5;
+ __pyx_t_5 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":387
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":405
* self.phrases_f = defaultdict(int)
* self.phrases_e = defaultdict(int)
* self.phrases_fe = defaultdict(lambda: defaultdict(int)) # <<<<<<<<<<<<<<
* self.phrases_al = defaultdict(lambda: defaultdict(tuple))
*
*/
- __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_9__cinit___lambda1, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
+ __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_9__cinit___lambda1, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->phrases_fe);
__Pyx_DECREF(__pyx_v_self->phrases_fe);
__pyx_v_self->phrases_fe = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":388
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":406
* self.phrases_e = defaultdict(int)
* self.phrases_fe = defaultdict(lambda: defaultdict(int))
* self.phrases_al = defaultdict(lambda: defaultdict(tuple)) # <<<<<<<<<<<<<<
*
* # Bilexical counts
*/
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_9__cinit___1lambda2, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_9__cinit___1lambda2, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __Pyx_GIVEREF(__pyx_t_5);
+ __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+ __Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_self->phrases_al);
__Pyx_DECREF(__pyx_v_self->phrases_al);
- __pyx_v_self->phrases_al = __pyx_t_5;
- __pyx_t_5 = 0;
+ __pyx_v_self->phrases_al = __pyx_t_2;
+ __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":391
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":409
*
* # Bilexical counts
* self.bilex_f = defaultdict(int) # <<<<<<<<<<<<<<
* self.bilex_e = defaultdict(int)
* self.bilex_fe = defaultdict(lambda: defaultdict(int))
*/
- __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyInt_Type))));
+ PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)((PyObject*)(&PyInt_Type))));
__Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->bilex_f);
__Pyx_DECREF(__pyx_v_self->bilex_f);
__pyx_v_self->bilex_f = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":392
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":410
* # Bilexical counts
* self.bilex_f = defaultdict(int)
* self.bilex_e = defaultdict(int) # <<<<<<<<<<<<<<
* self.bilex_fe = defaultdict(lambda: defaultdict(int))
*
*/
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyInt_Type))));
+ PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)((PyObject*)(&PyInt_Type))));
__Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __Pyx_GIVEREF(__pyx_t_5);
+ __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+ __Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_self->bilex_e);
__Pyx_DECREF(__pyx_v_self->bilex_e);
- __pyx_v_self->bilex_e = __pyx_t_5;
- __pyx_t_5 = 0;
+ __pyx_v_self->bilex_e = __pyx_t_2;
+ __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":393
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":411
* self.bilex_f = defaultdict(int)
* self.bilex_e = defaultdict(int)
* self.bilex_fe = defaultdict(lambda: defaultdict(int)) # <<<<<<<<<<<<<<
*
* def configure(self, SuffixArray fsarray, DataArray edarray,
*/
- __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_9__cinit___2lambda3, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_9__cinit___2lambda3, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __Pyx_GIVEREF(__pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_v_self->bilex_fe);
__Pyx_DECREF(__pyx_v_self->bilex_fe);
- __pyx_v_self->bilex_fe = __pyx_t_2;
- __pyx_t_2 = 0;
+ __pyx_v_self->bilex_fe = __pyx_t_5;
+ __pyx_t_5 = 0;
__pyx_r = 0;
goto __pyx_L0;
@@ -39925,21 +40112,21 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_3configure(PyObject *__
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__edarray)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sampler)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__scorer)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "configure") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "configure") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
goto __pyx_L5_argtuple_error;
@@ -39956,16 +40143,16 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_3configure(PyObject *__
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.HieroCachingRuleFactory.configure", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fsarray), __pyx_ptype_3_sa_SuffixArray, 1, "fsarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edarray), __pyx_ptype_3_sa_DataArray, 1, "edarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sampler), __pyx_ptype_3_sa_Sampler, 1, "sampler", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_scorer), __pyx_ptype_3_sa_Scorer, 1, "scorer", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fsarray), __pyx_ptype_3_sa_SuffixArray, 1, "fsarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edarray), __pyx_ptype_3_sa_DataArray, 1, "edarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sampler), __pyx_ptype_3_sa_Sampler, 1, "sampler", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_scorer), __pyx_ptype_3_sa_Scorer, 1, "scorer", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_r = __pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(((struct __pyx_obj_3_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_fsarray, __pyx_v_edarray, __pyx_v_sampler, __pyx_v_scorer);
goto __pyx_L0;
__pyx_L1_error:;
@@ -39975,7 +40162,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_3configure(PyObject *__
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":395
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":413
* self.bilex_fe = defaultdict(lambda: defaultdict(int))
*
* def configure(self, SuffixArray fsarray, DataArray edarray, # <<<<<<<<<<<<<<
@@ -39993,7 +40180,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("configure", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":400
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":418
* Here we also use it to precompute the most expensive intersections
* in the corpus quickly.'''
* self.fsa = fsarray # <<<<<<<<<<<<<<
@@ -40006,7 +40193,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx
__Pyx_DECREF(((PyObject *)__pyx_v_self->fsa));
__pyx_v_self->fsa = __pyx_v_fsarray;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":401
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":419
* in the corpus quickly.'''
* self.fsa = fsarray
* self.fda = fsarray.darray # <<<<<<<<<<<<<<
@@ -40019,7 +40206,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx
__Pyx_DECREF(((PyObject *)__pyx_v_self->fda));
__pyx_v_self->fda = __pyx_v_fsarray->darray;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":402
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":420
* self.fsa = fsarray
* self.fda = fsarray.darray
* self.eda = edarray # <<<<<<<<<<<<<<
@@ -40032,7 +40219,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx
__Pyx_DECREF(((PyObject *)__pyx_v_self->eda));
__pyx_v_self->eda = __pyx_v_edarray;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":403
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":421
* self.fda = fsarray.darray
* self.eda = edarray
* self.fid2symid = self.set_idmap(self.fda) # <<<<<<<<<<<<<<
@@ -40041,17 +40228,17 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx
*/
__pyx_t_1 = ((PyObject *)__pyx_v_self->fda);
__Pyx_INCREF(__pyx_t_1);
- __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->set_idmap(__pyx_v_self, ((struct __pyx_obj_3_sa_DataArray *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->set_idmap(__pyx_v_self, ((struct __pyx_obj_3_sa_DataArray *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_self->fid2symid);
__Pyx_DECREF(((PyObject *)__pyx_v_self->fid2symid));
__pyx_v_self->fid2symid = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":404
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":422
* self.eda = edarray
* self.fid2symid = self.set_idmap(self.fda)
* self.eid2symid = self.set_idmap(self.eda) # <<<<<<<<<<<<<<
@@ -40060,31 +40247,31 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx
*/
__pyx_t_2 = ((PyObject *)__pyx_v_self->eda);
__Pyx_INCREF(__pyx_t_2);
- __pyx_t_1 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->set_idmap(__pyx_v_self, ((struct __pyx_obj_3_sa_DataArray *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->set_idmap(__pyx_v_self, ((struct __pyx_obj_3_sa_DataArray *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->eid2symid);
__Pyx_DECREF(((PyObject *)__pyx_v_self->eid2symid));
__pyx_v_self->eid2symid = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":405
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":423
* self.fid2symid = self.set_idmap(self.fda)
* self.eid2symid = self.set_idmap(self.eda)
* self.precompute() # <<<<<<<<<<<<<<
* self.sampler = sampler
* self.scorer = scorer
*/
- __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__precompute); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__precompute); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":406
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":424
* self.eid2symid = self.set_idmap(self.eda)
* self.precompute()
* self.sampler = sampler # <<<<<<<<<<<<<<
@@ -40097,7 +40284,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx
__Pyx_DECREF(((PyObject *)__pyx_v_self->sampler));
__pyx_v_self->sampler = __pyx_v_sampler;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":407
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":425
* self.precompute()
* self.sampler = sampler
* self.scorer = scorer # <<<<<<<<<<<<<<
@@ -40123,7 +40310,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":409
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":427
* self.scorer = scorer
*
* cdef set_idmap(self, DataArray darray): # <<<<<<<<<<<<<<
@@ -40148,7 +40335,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_set_idmap(CYTHON_UNUSED
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("set_idmap", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":413
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":431
* cdef IntList idmap
*
* N = len(darray.id2word) # <<<<<<<<<<<<<<
@@ -40157,30 +40344,30 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_set_idmap(CYTHON_UNUSED
*/
__pyx_t_1 = __pyx_v_darray->id2word;
__Pyx_INCREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_N = __pyx_t_2;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":414
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":432
*
* N = len(darray.id2word)
* idmap = IntList(initial_len=N) # <<<<<<<<<<<<<<
* for word_id from 0 <= word_id < N:
* new_word_id = sym_fromstring(darray.id2word[word_id], True)
*/
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_t_3 = PyInt_FromLong(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__pyx_v_idmap = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":415
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":433
* N = len(darray.id2word)
* idmap = IntList(initial_len=N)
* for word_id from 0 <= word_id < N: # <<<<<<<<<<<<<<
@@ -40190,20 +40377,20 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_set_idmap(CYTHON_UNUSED
__pyx_t_4 = __pyx_v_N;
for (__pyx_v_word_id = 0; __pyx_v_word_id < __pyx_t_4; __pyx_v_word_id++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":416
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":434
* idmap = IntList(initial_len=N)
* for word_id from 0 <= word_id < N:
* new_word_id = sym_fromstring(darray.id2word[word_id], True) # <<<<<<<<<<<<<<
* idmap.arr[word_id] = new_word_id
* return idmap
*/
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_darray->id2word, __pyx_v_word_id, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_darray->id2word, __pyx_v_word_id, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyBytes_AsString(__pyx_t_3); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyBytes_AsString(__pyx_t_3); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_new_word_id = __pyx_f_3_sa_sym_fromstring(__pyx_t_5, 1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":417
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":435
* 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 # <<<<<<<<<<<<<<
@@ -40213,7 +40400,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_set_idmap(CYTHON_UNUSED
(__pyx_v_idmap->arr[__pyx_v_word_id]) = __pyx_v_new_word_id;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":418
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":436
* new_word_id = sym_fromstring(darray.id2word[word_id], True)
* idmap.arr[word_id] = new_word_id
* return idmap # <<<<<<<<<<<<<<
@@ -40250,7 +40437,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_5pattern2phrase(PyObjec
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":421
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":439
*
*
* def pattern2phrase(self, pattern): # <<<<<<<<<<<<<<
@@ -40278,7 +40465,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("pattern2phrase", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":423
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":441
* def pattern2phrase(self, pattern):
* # pattern is a tuple, which we must convert to a hiero Phrase
* result = () # <<<<<<<<<<<<<<
@@ -40288,7 +40475,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct
__Pyx_INCREF(((PyObject *)__pyx_empty_tuple));
__pyx_v_result = __pyx_empty_tuple;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":424
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":442
* # pattern is a tuple, which we must convert to a hiero Phrase
* result = ()
* arity = 0 # <<<<<<<<<<<<<<
@@ -40298,7 +40485,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct
__Pyx_INCREF(__pyx_int_0);
__pyx_v_arity = __pyx_int_0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":425
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":443
* result = ()
* arity = 0
* for word_id in pattern: # <<<<<<<<<<<<<<
@@ -40309,7 +40496,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct
__pyx_t_1 = __pyx_v_pattern; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
__pyx_t_3 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -40317,23 +40504,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct
if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_3(__pyx_t_1);
if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -40343,74 +40530,74 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct
__pyx_v_word_id = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":426
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":444
* arity = 0
* for word_id in pattern:
* if word_id == -1: # <<<<<<<<<<<<<<
* arity = arity + 1
* new_id = sym_setindex(self.category, arity)
*/
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_word_id, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_v_word_id, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":427
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":445
* for word_id in pattern:
* if word_id == -1:
* arity = arity + 1 # <<<<<<<<<<<<<<
* new_id = sym_setindex(self.category, arity)
* else:
*/
- __pyx_t_4 = PyNumber_Add(__pyx_v_arity, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Add(__pyx_v_arity, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_v_arity);
__pyx_v_arity = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":428
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":446
* if word_id == -1:
* arity = arity + 1
* new_id = sym_setindex(self.category, arity) # <<<<<<<<<<<<<<
* else:
* new_id = sym_fromstring(self.fda.id2word[word_id], True)
*/
- __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_arity); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_arity); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_new_id = __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_t_6);
goto __pyx_L5;
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":430
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":448
* new_id = sym_setindex(self.category, arity)
* else:
* new_id = sym_fromstring(self.fda.id2word[word_id], True) # <<<<<<<<<<<<<<
* result = result + (new_id,)
* return Phrase(result)
*/
- __pyx_t_4 = PyObject_GetItem(__pyx_v_self->fda->id2word, __pyx_v_word_id); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetItem(__pyx_v_self->fda->id2word, __pyx_v_word_id); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = PyBytes_AsString(__pyx_t_4); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyBytes_AsString(__pyx_t_4); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_new_id = __pyx_f_3_sa_sym_fromstring(__pyx_t_7, 1);
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":431
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":449
* else:
* new_id = sym_fromstring(self.fda.id2word[word_id], True)
* result = result + (new_id,) # <<<<<<<<<<<<<<
* return Phrase(result)
*
*/
- __pyx_t_4 = PyInt_FromLong(__pyx_v_new_id); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_v_new_id); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_v_result), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_v_result), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
__Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
__Pyx_DECREF(((PyObject *)__pyx_v_result));
@@ -40419,7 +40606,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":432
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":450
* new_id = sym_fromstring(self.fda.id2word[word_id], True)
* result = result + (new_id,)
* return Phrase(result) # <<<<<<<<<<<<<<
@@ -40427,12 +40614,12 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct
* def pattern2phrase_plus(self, pattern):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_result));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_result));
__Pyx_GIVEREF(((PyObject *)__pyx_v_result));
- __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__pyx_r = __pyx_t_4;
@@ -40467,7 +40654,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_7pattern2phrase_plus(Py
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":434
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":452
* return Phrase(result)
*
* def pattern2phrase_plus(self, pattern): # <<<<<<<<<<<<<<
@@ -40497,19 +40684,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(st
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("pattern2phrase_plus", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":437
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":455
* # returns a list containing both the pattern, and pattern
* # suffixed/prefixed with the NT category.
* patterns = [] # <<<<<<<<<<<<<<
* result = ()
* arity = 0
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_patterns = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":438
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":456
* # suffixed/prefixed with the NT category.
* patterns = []
* result = () # <<<<<<<<<<<<<<
@@ -40519,7 +40706,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(st
__Pyx_INCREF(((PyObject *)__pyx_empty_tuple));
__pyx_v_result = __pyx_empty_tuple;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":439
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":457
* patterns = []
* result = ()
* arity = 0 # <<<<<<<<<<<<<<
@@ -40529,7 +40716,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(st
__Pyx_INCREF(__pyx_int_0);
__pyx_v_arity = __pyx_int_0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":440
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":458
* result = ()
* arity = 0
* for word_id in pattern: # <<<<<<<<<<<<<<
@@ -40540,7 +40727,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(st
__pyx_t_1 = __pyx_v_pattern; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
__pyx_t_3 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -40548,23 +40735,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(st
if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_3(__pyx_t_1);
if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -40574,74 +40761,74 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(st
__pyx_v_word_id = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":441
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":459
* arity = 0
* for word_id in pattern:
* if word_id == -1: # <<<<<<<<<<<<<<
* arity = arity + 1
* new_id = sym_setindex(self.category, arity)
*/
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_word_id, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_v_word_id, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":442
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":460
* for word_id in pattern:
* if word_id == -1:
* arity = arity + 1 # <<<<<<<<<<<<<<
* new_id = sym_setindex(self.category, arity)
* else:
*/
- __pyx_t_4 = PyNumber_Add(__pyx_v_arity, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Add(__pyx_v_arity, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_v_arity);
__pyx_v_arity = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":443
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":461
* if word_id == -1:
* arity = arity + 1
* new_id = sym_setindex(self.category, arity) # <<<<<<<<<<<<<<
* else:
* new_id = sym_fromstring(self.fda.id2word[word_id], True)
*/
- __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_arity); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_arity); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_new_id = __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_t_6);
goto __pyx_L5;
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":445
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":463
* new_id = sym_setindex(self.category, arity)
* else:
* new_id = sym_fromstring(self.fda.id2word[word_id], True) # <<<<<<<<<<<<<<
* result = result + (new_id,)
* patterns.append(Phrase(result))
*/
- __pyx_t_4 = PyObject_GetItem(__pyx_v_self->fda->id2word, __pyx_v_word_id); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetItem(__pyx_v_self->fda->id2word, __pyx_v_word_id); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = PyBytes_AsString(__pyx_t_4); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyBytes_AsString(__pyx_t_4); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_new_id = __pyx_f_3_sa_sym_fromstring(__pyx_t_7, 1);
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":446
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":464
* else:
* new_id = sym_fromstring(self.fda.id2word[word_id], True)
* result = result + (new_id,) # <<<<<<<<<<<<<<
* patterns.append(Phrase(result))
* patterns.append(Phrase(result + (sym_setindex(self.category, 1),)))
*/
- __pyx_t_4 = PyInt_FromLong(__pyx_v_new_id); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_v_new_id); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_v_result), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_v_result), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
__Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
__Pyx_DECREF(((PyObject *)__pyx_v_result));
@@ -40650,81 +40837,81 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(st
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":447
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":465
* new_id = sym_fromstring(self.fda.id2word[word_id], True)
* result = result + (new_id,)
* patterns.append(Phrase(result)) # <<<<<<<<<<<<<<
* patterns.append(Phrase(result + (sym_setindex(self.category, 1),)))
* patterns.append(Phrase((sym_setindex(self.category, 1),) + result))
*/
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_result));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_result));
__Pyx_GIVEREF(((PyObject *)__pyx_v_result));
- __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_t_9 = PyList_Append(__pyx_v_patterns, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyList_Append(__pyx_v_patterns, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":448
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":466
* result = result + (new_id,)
* patterns.append(Phrase(result))
* patterns.append(Phrase(result + (sym_setindex(self.category, 1),))) # <<<<<<<<<<<<<<
* patterns.append(Phrase((sym_setindex(self.category, 1),) + result))
* return patterns
*/
- __pyx_t_4 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_v_result), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_v_result), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_4));
__Pyx_GIVEREF(((PyObject *)__pyx_t_4));
__pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_t_9 = PyList_Append(__pyx_v_patterns, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyList_Append(__pyx_v_patterns, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":449
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":467
* patterns.append(Phrase(result))
* patterns.append(Phrase(result + (sym_setindex(self.category, 1),)))
* patterns.append(Phrase((sym_setindex(self.category, 1),) + result)) # <<<<<<<<<<<<<<
* return patterns
*
*/
- __pyx_t_4 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_v_result)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_v_result)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_4));
__Pyx_GIVEREF(((PyObject *)__pyx_t_4));
__pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_t_9 = PyList_Append(__pyx_v_patterns, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyList_Append(__pyx_v_patterns, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":450
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":468
* patterns.append(Phrase(result + (sym_setindex(self.category, 1),)))
* patterns.append(Phrase((sym_setindex(self.category, 1),) + result))
* return patterns # <<<<<<<<<<<<<<
@@ -40765,7 +40952,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9precompute(PyObject *_
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":452
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":470
* return patterns
*
* def precompute(self): # <<<<<<<<<<<<<<
@@ -40799,7 +40986,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("precompute", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":455
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":473
* cdef Precomputation pre
*
* if self.precompute_file is not None: # <<<<<<<<<<<<<<
@@ -40809,31 +40996,31 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
__pyx_t_1 = (__pyx_v_self->precompute_file != Py_None);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":456
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":474
*
* if self.precompute_file is not None:
* start_time = monitor_cpu() # <<<<<<<<<<<<<<
* logger.info("Reading precomputed data from file %s... ", self.precompute_file)
* pre = Precomputation(from_binary=self.precompute_file)
*/
- __pyx_t_2 = PyFloat_FromDouble(__pyx_f_3_sa_monitor_cpu()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyFloat_FromDouble(__pyx_f_3_sa_monitor_cpu()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_start_time = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":457
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":475
* if self.precompute_file is not None:
* start_time = monitor_cpu()
* logger.info("Reading precomputed data from file %s... ", self.precompute_file) # <<<<<<<<<<<<<<
* pre = Precomputation(from_binary=self.precompute_file)
* # check parameters of precomputation -- some are critical and some are not
*/
- __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_108));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_108));
@@ -40841,29 +41028,29 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
__Pyx_INCREF(__pyx_v_self->precompute_file);
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self->precompute_file);
__Pyx_GIVEREF(__pyx_v_self->precompute_file);
- __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":458
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":476
* start_time = monitor_cpu()
* logger.info("Reading precomputed data from file %s... ", self.precompute_file)
* pre = Precomputation(from_binary=self.precompute_file) # <<<<<<<<<<<<<<
* # check parameters of precomputation -- some are critical and some are not
* if pre.max_nonterminals != self.max_nonterminals:
*/
- __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
- if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__from_binary), __pyx_v_self->precompute_file) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Precomputation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__from_binary), __pyx_v_self->precompute_file) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Precomputation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__pyx_v_pre = ((struct __pyx_obj_3_sa_Precomputation *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":460
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":478
* 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: # <<<<<<<<<<<<<<
@@ -40873,23 +41060,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
__pyx_t_1 = (__pyx_v_pre->max_nonterminals != __pyx_v_self->max_nonterminals);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":461
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":479
* # check parameters of precomputation -- some are critical and some are not
* if pre.max_nonterminals != self.max_nonterminals:
* logger.warn("Precomputation done with max nonterminals %d, decoder uses %d", pre.max_nonterminals, self.max_nonterminals) # <<<<<<<<<<<<<<
* if pre.max_length != self.max_length:
* logger.warn("Precomputation done with max terminals %d, decoder uses %d", pre.max_length, self.max_length)
*/
- __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__warn); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__warn); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyInt_FromLong(__pyx_v_pre->max_nonterminals); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong(__pyx_v_pre->max_nonterminals); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyInt_FromLong(__pyx_v_self->max_nonterminals); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong(__pyx_v_self->max_nonterminals); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_109));
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_109));
@@ -40900,7 +41087,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_2 = 0;
__pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
@@ -40909,7 +41096,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":462
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":480
* 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: # <<<<<<<<<<<<<<
@@ -40919,23 +41106,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
__pyx_t_1 = (__pyx_v_pre->max_length != __pyx_v_self->max_length);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":463
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":481
* logger.warn("Precomputation done with max nonterminals %d, decoder uses %d", pre.max_nonterminals, self.max_nonterminals)
* if pre.max_length != self.max_length:
* logger.warn("Precomputation done with max terminals %d, decoder uses %d", pre.max_length, self.max_length) # <<<<<<<<<<<<<<
* if pre.train_max_initial_size != self.train_max_initial_size:
* raise Exception("Precomputation done with max initial size %d, decoder uses %d" % (pre.train_max_initial_size, self.train_max_initial_size))
*/
- __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__warn); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__warn); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyInt_FromLong(__pyx_v_pre->max_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong(__pyx_v_pre->max_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyInt_FromLong(__pyx_v_self->max_length); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_v_self->max_length); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_110));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_110));
@@ -40946,7 +41133,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_3 = 0;
__pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
@@ -40955,7 +41142,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":464
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":482
* 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: # <<<<<<<<<<<<<<
@@ -40965,18 +41152,18 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
__pyx_t_1 = (__pyx_v_pre->train_max_initial_size != __pyx_v_self->train_max_initial_size);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":465
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":483
* logger.warn("Precomputation done with max terminals %d, decoder uses %d", pre.max_length, self.max_length)
* if pre.train_max_initial_size != self.train_max_initial_size:
* raise Exception("Precomputation done with max initial size %d, decoder uses %d" % (pre.train_max_initial_size, self.train_max_initial_size)) # <<<<<<<<<<<<<<
* if pre.train_min_gap_size != self.train_min_gap_size:
* raise Exception("Precomputation done with min gap size %d, decoder uses %d" % (pre.train_min_gap_size, self.train_min_gap_size))
*/
- __pyx_t_4 = PyInt_FromLong(__pyx_v_pre->train_max_initial_size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_v_pre->train_max_initial_size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = PyInt_FromLong(__pyx_v_self->train_max_initial_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong(__pyx_v_self->train_max_initial_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
@@ -40984,25 +41171,25 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_4 = 0;
__pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_111), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_111), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_2));
__Pyx_GIVEREF(((PyObject *)__pyx_t_2));
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L6;
}
__pyx_L6:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":466
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":484
* 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: # <<<<<<<<<<<<<<
@@ -41012,18 +41199,18 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
__pyx_t_1 = (__pyx_v_pre->train_min_gap_size != __pyx_v_self->train_min_gap_size);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":467
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":485
* raise Exception("Precomputation done with max initial size %d, decoder uses %d" % (pre.train_max_initial_size, self.train_max_initial_size))
* if pre.train_min_gap_size != self.train_min_gap_size:
* raise Exception("Precomputation done with min gap size %d, decoder uses %d" % (pre.train_min_gap_size, self.train_min_gap_size)) # <<<<<<<<<<<<<<
* if self.use_index:
* logger.info("Converting %d hash keys on precomputed inverted index... ", len(pre.precomputed_index))
*/
- __pyx_t_2 = PyInt_FromLong(__pyx_v_pre->train_min_gap_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong(__pyx_v_pre->train_min_gap_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = PyInt_FromLong(__pyx_v_self->train_min_gap_size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyInt_FromLong(__pyx_v_self->train_min_gap_size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
@@ -41031,25 +41218,25 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
__Pyx_GIVEREF(__pyx_t_5);
__pyx_t_2 = 0;
__pyx_t_5 = 0;
- __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_112), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_112), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_5));
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_5));
__Pyx_GIVEREF(((PyObject *)__pyx_t_5));
__pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L7;
}
__pyx_L7:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":468
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":486
* 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: # <<<<<<<<<<<<<<
@@ -41058,25 +41245,25 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
*/
if (__pyx_v_self->use_index) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":469
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":487
* raise Exception("Precomputation done with min gap size %d, decoder uses %d" % (pre.train_min_gap_size, self.train_min_gap_size))
* if self.use_index:
* logger.info("Converting %d hash keys on precomputed inverted index... ", len(pre.precomputed_index)) # <<<<<<<<<<<<<<
* for pattern, arr in pre.precomputed_index.iteritems():
* phrases = self.pattern2phrase_plus(pattern)
*/
- __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__info); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__info); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = __pyx_v_pre->precomputed_index;
__Pyx_INCREF(__pyx_t_5);
- __pyx_t_6 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_113));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_113));
@@ -41084,13 +41271,13 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
__pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":470
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":488
* 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(): # <<<<<<<<<<<<<<
@@ -41100,9 +41287,9 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
__pyx_t_6 = 0;
if (unlikely(__pyx_v_pre->precomputed_index == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_pre->precomputed_index, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_7), (&__pyx_t_8)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_pre->precomputed_index, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_7), (&__pyx_t_8)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_5);
__pyx_t_5 = __pyx_t_2;
@@ -41110,7 +41297,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
while (1) {
__pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_7, &__pyx_t_6, &__pyx_t_2, &__pyx_t_4, NULL, __pyx_t_8);
if (unlikely(__pyx_t_9 == 0)) break;
- if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_v_pattern);
@@ -41120,21 +41307,21 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
__pyx_v_arr = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":471
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":489
* logger.info("Converting %d hash keys on precomputed inverted index... ", len(pre.precomputed_index))
* for pattern, arr in pre.precomputed_index.iteritems():
* phrases = self.pattern2phrase_plus(pattern) # <<<<<<<<<<<<<<
* for phrase in phrases:
* self.precomputed_index[phrase] = arr
*/
- __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__pattern2phrase_plus); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__pattern2phrase_plus); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_pattern);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_pattern);
__Pyx_GIVEREF(__pyx_v_pattern);
- __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
@@ -41142,7 +41329,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
__pyx_v_phrases = __pyx_t_3;
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":472
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":490
* for pattern, arr in pre.precomputed_index.iteritems():
* phrases = self.pattern2phrase_plus(pattern)
* for phrase in phrases: # <<<<<<<<<<<<<<
@@ -41153,7 +41340,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
__pyx_t_3 = __pyx_v_phrases; __Pyx_INCREF(__pyx_t_3); __pyx_t_10 = 0;
__pyx_t_11 = NULL;
} else {
- __pyx_t_10 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_phrases); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_phrases); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_11 = Py_TYPE(__pyx_t_3)->tp_iternext;
}
@@ -41161,23 +41348,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_3)) {
if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_3)) {
if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_2 = __pyx_t_11(__pyx_t_3);
if (unlikely(!__pyx_t_2)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -41187,14 +41374,14 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
__pyx_v_phrase = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":473
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":491
* phrases = self.pattern2phrase_plus(pattern)
* for phrase in phrases:
* self.precomputed_index[phrase] = arr # <<<<<<<<<<<<<<
* if self.use_collocations:
* logger.info("Converting %d hash keys on precomputed collocations... ", len(pre.precomputed_collocations))
*/
- if (PyObject_SetItem(__pyx_v_self->precomputed_index, __pyx_v_phrase, __pyx_v_arr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_v_self->precomputed_index, __pyx_v_phrase, __pyx_v_arr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
@@ -41203,7 +41390,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
}
__pyx_L8:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":474
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":492
* for phrase in phrases:
* self.precomputed_index[phrase] = arr
* if self.use_collocations: # <<<<<<<<<<<<<<
@@ -41212,25 +41399,25 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
*/
if (__pyx_v_self->use_collocations) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":475
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":493
* self.precomputed_index[phrase] = arr
* if self.use_collocations:
* logger.info("Converting %d hash keys on precomputed collocations... ", len(pre.precomputed_collocations)) # <<<<<<<<<<<<<<
* for pattern, arr in pre.precomputed_collocations.iteritems():
* phrase = self.pattern2phrase(pattern)
*/
- __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = __pyx_v_pre->precomputed_collocations;
__Pyx_INCREF(__pyx_t_5);
- __pyx_t_7 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_114));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_114));
@@ -41238,13 +41425,13 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
__pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":476
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":494
* 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(): # <<<<<<<<<<<<<<
@@ -41254,9 +41441,9 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
__pyx_t_7 = 0;
if (unlikely(__pyx_v_pre->precomputed_collocations == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_pre->precomputed_collocations, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_6), (&__pyx_t_8)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_pre->precomputed_collocations, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_6), (&__pyx_t_8)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_5);
__pyx_t_5 = __pyx_t_2;
@@ -41264,7 +41451,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
while (1) {
__pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_6, &__pyx_t_7, &__pyx_t_2, &__pyx_t_3, NULL, __pyx_t_8);
if (unlikely(__pyx_t_9 == 0)) break;
- if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_v_pattern);
@@ -41274,21 +41461,21 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
__pyx_v_arr = __pyx_t_3;
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":477
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":495
* logger.info("Converting %d hash keys on precomputed collocations... ", len(pre.precomputed_collocations))
* for pattern, arr in pre.precomputed_collocations.iteritems():
* phrase = self.pattern2phrase(pattern) # <<<<<<<<<<<<<<
* self.precomputed_collocations[phrase] = arr
* stop_time = monitor_cpu()
*/
- __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__pattern2phrase); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__pattern2phrase); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_pattern);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_pattern);
__Pyx_GIVEREF(__pyx_v_pattern);
- __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
@@ -41296,47 +41483,47 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
__pyx_v_phrase = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":478
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":496
* for pattern, arr in pre.precomputed_collocations.iteritems():
* phrase = self.pattern2phrase(pattern)
* self.precomputed_collocations[phrase] = arr # <<<<<<<<<<<<<<
* stop_time = monitor_cpu()
* logger.info("Processing precomputations took %f seconds", stop_time - start_time)
*/
- if (PyObject_SetItem(__pyx_v_self->precomputed_collocations, __pyx_v_phrase, __pyx_v_arr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_v_self->precomputed_collocations, __pyx_v_phrase, __pyx_v_arr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
goto __pyx_L13;
}
__pyx_L13:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":479
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":497
* phrase = self.pattern2phrase(pattern)
* self.precomputed_collocations[phrase] = arr
* stop_time = monitor_cpu() # <<<<<<<<<<<<<<
* logger.info("Processing precomputations took %f seconds", stop_time - start_time)
*
*/
- __pyx_t_5 = PyFloat_FromDouble(__pyx_f_3_sa_monitor_cpu()); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyFloat_FromDouble(__pyx_f_3_sa_monitor_cpu()); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_v_stop_time = __pyx_t_5;
__pyx_t_5 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":480
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":498
* self.precomputed_collocations[phrase] = arr
* stop_time = monitor_cpu()
* logger.info("Processing precomputations took %f seconds", stop_time - start_time) # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__info); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__info); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyNumber_Subtract(__pyx_v_stop_time, __pyx_v_start_time); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyNumber_Subtract(__pyx_v_stop_time, __pyx_v_start_time); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_115));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_115));
@@ -41344,7 +41531,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
__pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
@@ -41386,7 +41573,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_11get_precomputed_collo
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":483
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":501
*
*
* def get_precomputed_collocation(self, phrase): # <<<<<<<<<<<<<<
@@ -41408,29 +41595,29 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_10get_precomputed_collo
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_precomputed_collocation", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":484
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":502
*
* def get_precomputed_collocation(self, phrase):
* if phrase in self.precomputed_collocations: # <<<<<<<<<<<<<<
* arr = self.precomputed_collocations[phrase]
* return PhraseLocation(arr=arr, arr_low=0, arr_high=len(arr), num_subpatterns=phrase.arity()+1)
*/
- __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_phrase, __pyx_v_self->precomputed_collocations, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_phrase, __pyx_v_self->precomputed_collocations, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":485
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":503
* def get_precomputed_collocation(self, phrase):
* if phrase in self.precomputed_collocations:
* arr = self.precomputed_collocations[phrase] # <<<<<<<<<<<<<<
* return PhraseLocation(arr=arr, arr_low=0, arr_high=len(arr), num_subpatterns=phrase.arity()+1)
* return None
*/
- __pyx_t_2 = PyObject_GetItem(__pyx_v_self->precomputed_collocations, __pyx_v_phrase); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetItem(__pyx_v_self->precomputed_collocations, __pyx_v_phrase); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_arr = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":486
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":504
* 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) # <<<<<<<<<<<<<<
@@ -41438,26 +41625,26 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_10get_precomputed_collo
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
- if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__arr), __pyx_v_arr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__arr_low), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_3 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__arr), __pyx_v_arr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__arr_low), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__arr_high), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__arr_high), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_GetAttr(__pyx_v_phrase, __pyx_n_s__arity); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetAttr(__pyx_v_phrase, __pyx_n_s__arity); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__num_subpatterns), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__num_subpatterns), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__pyx_r = __pyx_t_4;
@@ -41467,7 +41654,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_10get_precomputed_collo
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":487
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":505
* arr = self.precomputed_collocations[phrase]
* return PhraseLocation(arr=arr, arr_low=0, arr_high=len(arr), num_subpatterns=phrase.arity()+1)
* return None # <<<<<<<<<<<<<<
@@ -41494,7 +41681,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_10get_precomputed_collo
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":490
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":508
*
*
* cdef int* baeza_yates_helper(self, int low1, int high1, int* arr1, int step1, # <<<<<<<<<<<<<<
@@ -41540,7 +41727,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("baeza_yates_helper", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":503
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":521
* cdef Matching loc1, loc2
*
* result = <int*> malloc(0*sizeof(int*)) # <<<<<<<<<<<<<<
@@ -41549,7 +41736,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_result = ((int *)malloc((0 * (sizeof(int *)))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":505
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":523
* result = <int*> malloc(0*sizeof(int*))
*
* d_first = 0 # <<<<<<<<<<<<<<
@@ -41558,7 +41745,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_d_first = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":506
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":524
*
* d_first = 0
* if high1 - low1 > high2 - low2: # <<<<<<<<<<<<<<
@@ -41568,7 +41755,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_1 = ((__pyx_v_high1 - __pyx_v_low1) > (__pyx_v_high2 - __pyx_v_low2));
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":507
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":525
* d_first = 0
* if high1 - low1 > high2 - low2:
* d_first = 1 # <<<<<<<<<<<<<<
@@ -41580,7 +41767,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":511
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":529
* # 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: # <<<<<<<<<<<<<<
@@ -41596,7 +41783,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":512
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":530
* # Case 1: one of the sets is empty
* if low1 >= high1 or low2 >= high2:
* return result # <<<<<<<<<<<<<<
@@ -41609,7 +41796,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":515
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":533
*
* # Case 2: sets are non-overlapping
* assign_matching(&loc1, arr1, high1-step1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -41618,7 +41805,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_f_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, (__pyx_v_high1 - __pyx_v_step1), __pyx_v_step1, __pyx_v_self->fda->sent_id->arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":516
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":534
* # Case 2: sets are non-overlapping
* assign_matching(&loc1, arr1, high1-step1, step1, self.fda.sent_id.arr)
* assign_matching(&loc2, arr2, low2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -41627,7 +41814,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_low2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":517
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":535
* 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: # <<<<<<<<<<<<<<
@@ -41637,7 +41824,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_3 = (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last) == -1);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":518
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":536
* 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 # <<<<<<<<<<<<<<
@@ -41650,7 +41837,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":520
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":538
* return result
*
* assign_matching(&loc1, arr1, low1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -41659,7 +41846,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_f_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_low1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":521
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":539
*
* assign_matching(&loc1, arr1, low1, step1, self.fda.sent_id.arr)
* assign_matching(&loc2, arr2, high2-step2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -41668,7 +41855,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, (__pyx_v_high2 - __pyx_v_step2), __pyx_v_step2, __pyx_v_self->fda->sent_id->arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":522
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":540
* assign_matching(&loc1, arr1, low1, step1, self.fda.sent_id.arr)
* assign_matching(&loc2, arr2, high2-step2, step2, self.fda.sent_id.arr)
* if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) == 1: # <<<<<<<<<<<<<<
@@ -41678,7 +41865,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_3 = (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last) == 1);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":523
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":541
* 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 # <<<<<<<<<<<<<<
@@ -41691,7 +41878,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
__pyx_L6:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":527
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":545
* # Case 3: query set and data set do not meet size mismatch constraints;
* # We use mergesort instead in this case
* qsetsize = (high1-low1) / step1 # <<<<<<<<<<<<<<
@@ -41701,15 +41888,15 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_4 = (__pyx_v_high1 - __pyx_v_low1);
if (unlikely(__pyx_v_step1 == 0)) {
PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
else if (sizeof(int) == sizeof(long) && unlikely(__pyx_v_step1 == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_4))) {
PyErr_Format(PyExc_OverflowError, "value too large to perform division");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_v_qsetsize = __Pyx_div_int(__pyx_t_4, __pyx_v_step1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":528
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":546
* # We use mergesort instead in this case
* qsetsize = (high1-low1) / step1
* dsetsize = (high2-low2) / step2 # <<<<<<<<<<<<<<
@@ -41719,15 +41906,15 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_4 = (__pyx_v_high2 - __pyx_v_low2);
if (unlikely(__pyx_v_step2 == 0)) {
PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
else if (sizeof(int) == sizeof(long) && unlikely(__pyx_v_step2 == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_4))) {
PyErr_Format(PyExc_OverflowError, "value too large to perform division");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_v_dsetsize = __Pyx_div_int(__pyx_t_4, __pyx_v_step2);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":529
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":547
* qsetsize = (high1-low1) / step1
* dsetsize = (high2-low2) / step2
* if d_first: # <<<<<<<<<<<<<<
@@ -41736,7 +41923,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
if (__pyx_v_d_first) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":530
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":548
* dsetsize = (high2-low2) / step2
* if d_first:
* tmp = qsetsize # <<<<<<<<<<<<<<
@@ -41745,7 +41932,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_tmp = __pyx_v_qsetsize;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":531
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":549
* if d_first:
* tmp = qsetsize
* qsetsize = dsetsize # <<<<<<<<<<<<<<
@@ -41754,7 +41941,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_qsetsize = __pyx_v_dsetsize;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":532
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":550
* tmp = qsetsize
* qsetsize = dsetsize
* dsetsize = tmp # <<<<<<<<<<<<<<
@@ -41766,7 +41953,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
__pyx_L7:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":534
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":552
* dsetsize = tmp
*
* if self.by_slack_factor * qsetsize * log(dsetsize) / log(2) > dsetsize: # <<<<<<<<<<<<<<
@@ -41777,12 +41964,12 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_6 = log(2.0);
if (unlikely(__pyx_t_6 == 0)) {
PyErr_Format(PyExc_ZeroDivisionError, "float division");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_t_3 = ((__pyx_t_5 / __pyx_t_6) > __pyx_v_dsetsize);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":535
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":553
*
* if self.by_slack_factor * qsetsize * log(dsetsize) / log(2) > dsetsize:
* free(result) # <<<<<<<<<<<<<<
@@ -41791,7 +41978,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
free(__pyx_v_result);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":536
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":554
* 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) # <<<<<<<<<<<<<<
@@ -41804,7 +41991,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
__pyx_L8:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":540
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":558
* # binary search. There are two flavors, depending on
* # whether the queryset or dataset is first
* if d_first: # <<<<<<<<<<<<<<
@@ -41813,7 +42000,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
if (__pyx_v_d_first) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":541
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":559
* # whether the queryset or dataset is first
* if d_first:
* med2 = median(low2, high2, step2) # <<<<<<<<<<<<<<
@@ -41822,7 +42009,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_med2 = __pyx_f_3_sa_median(__pyx_v_low2, __pyx_v_high2, __pyx_v_step2);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":542
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":560
* if d_first:
* med2 = median(low2, high2, step2)
* assign_matching(&loc2, arr2, med2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -41831,7 +42018,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_med2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":544
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":562
* assign_matching(&loc2, arr2, med2, step2, self.fda.sent_id.arr)
*
* search_low = low1 # <<<<<<<<<<<<<<
@@ -41840,7 +42027,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_search_low = __pyx_v_low1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":545
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":563
*
* search_low = low1
* search_high = high1 # <<<<<<<<<<<<<<
@@ -41849,7 +42036,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_search_high = __pyx_v_high1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":546
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":564
* search_low = low1
* search_high = high1
* while search_low < search_high: # <<<<<<<<<<<<<<
@@ -41860,7 +42047,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_3 = (__pyx_v_search_low < __pyx_v_search_high);
if (!__pyx_t_3) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":547
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":565
* search_high = high1
* while search_low < search_high:
* med1 = median(search_low, search_high, step1) # <<<<<<<<<<<<<<
@@ -41869,7 +42056,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_med1 = __pyx_f_3_sa_median(__pyx_v_search_low, __pyx_v_search_high, __pyx_v_step1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":548
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":566
* while search_low < search_high:
* med1 = median(search_low, search_high, step1)
* find_comparable_matchings(low1, high1, arr1, step1, med1, &med1_minus, &med1_plus) # <<<<<<<<<<<<<<
@@ -41878,7 +42065,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_f_3_sa_find_comparable_matchings(__pyx_v_low1, __pyx_v_high1, __pyx_v_arr1, __pyx_v_step1, __pyx_v_med1, (&__pyx_v_med1_minus), (&__pyx_v_med1_plus));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":549
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":567
* 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) # <<<<<<<<<<<<<<
@@ -41887,7 +42074,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_comparison = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings_set(__pyx_v_self, __pyx_v_med1_minus, __pyx_v_med1_plus, __pyx_v_arr1, __pyx_v_step1, (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":552
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":570
* if comparison == -1:
* search_low = med1_plus
* elif comparison == 1: # <<<<<<<<<<<<<<
@@ -41896,7 +42083,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
switch (__pyx_v_comparison) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":550
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":568
* 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: # <<<<<<<<<<<<<<
@@ -41905,7 +42092,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
case -1:
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":551
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":569
* comparison = self.compare_matchings_set(med1_minus, med1_plus, arr1, step1, &loc2, offset_by_one, len_last)
* if comparison == -1:
* search_low = med1_plus # <<<<<<<<<<<<<<
@@ -41915,7 +42102,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_v_search_low = __pyx_v_med1_plus;
break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":552
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":570
* if comparison == -1:
* search_low = med1_plus
* elif comparison == 1: # <<<<<<<<<<<<<<
@@ -41924,7 +42111,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
case 1:
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":553
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":571
* search_low = med1_plus
* elif comparison == 1:
* search_high = med1_minus # <<<<<<<<<<<<<<
@@ -41935,7 +42122,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
break;
default:
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":555
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":573
* search_high = med1_minus
* else:
* break # <<<<<<<<<<<<<<
@@ -41951,7 +42138,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":557
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":575
* break
* else:
* med1 = median(low1, high1, step1) # <<<<<<<<<<<<<<
@@ -41960,7 +42147,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_med1 = __pyx_f_3_sa_median(__pyx_v_low1, __pyx_v_high1, __pyx_v_step1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":558
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":576
* else:
* med1 = median(low1, high1, step1)
* find_comparable_matchings(low1, high1, arr1, step1, med1, &med1_minus, &med1_plus) # <<<<<<<<<<<<<<
@@ -41969,7 +42156,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_f_3_sa_find_comparable_matchings(__pyx_v_low1, __pyx_v_high1, __pyx_v_arr1, __pyx_v_step1, __pyx_v_med1, (&__pyx_v_med1_minus), (&__pyx_v_med1_plus));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":560
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":578
* find_comparable_matchings(low1, high1, arr1, step1, med1, &med1_minus, &med1_plus)
*
* search_low = low2 # <<<<<<<<<<<<<<
@@ -41978,7 +42165,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_search_low = __pyx_v_low2;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":561
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":579
*
* search_low = low2
* search_high = high2 # <<<<<<<<<<<<<<
@@ -41987,7 +42174,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_search_high = __pyx_v_high2;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":562
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":580
* search_low = low2
* search_high = high2
* while search_low < search_high: # <<<<<<<<<<<<<<
@@ -41998,7 +42185,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_3 = (__pyx_v_search_low < __pyx_v_search_high);
if (!__pyx_t_3) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":563
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":581
* search_high = high2
* while search_low < search_high:
* med2 = median(search_low, search_high, step2) # <<<<<<<<<<<<<<
@@ -42007,7 +42194,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_med2 = __pyx_f_3_sa_median(__pyx_v_search_low, __pyx_v_search_high, __pyx_v_step2);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":564
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":582
* while search_low < search_high:
* med2 = median(search_low, search_high, step2)
* assign_matching(&loc2, arr2, med2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -42016,7 +42203,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_med2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":565
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":583
* 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) # <<<<<<<<<<<<<<
@@ -42025,7 +42212,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_comparison = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings_set(__pyx_v_self, __pyx_v_med1_minus, __pyx_v_med1_plus, __pyx_v_arr1, __pyx_v_step1, (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":568
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":586
* if comparison == -1:
* search_high = med2
* elif comparison == 1: # <<<<<<<<<<<<<<
@@ -42034,7 +42221,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
switch (__pyx_v_comparison) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":566
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":584
* 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: # <<<<<<<<<<<<<<
@@ -42043,7 +42230,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
case -1:
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":567
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":585
* comparison = self.compare_matchings_set(med1_minus, med1_plus, arr1, step1, &loc2, offset_by_one, len_last)
* if comparison == -1:
* search_high = med2 # <<<<<<<<<<<<<<
@@ -42053,7 +42240,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_v_search_high = __pyx_v_med2;
break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":568
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":586
* if comparison == -1:
* search_high = med2
* elif comparison == 1: # <<<<<<<<<<<<<<
@@ -42062,7 +42249,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
case 1:
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":569
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":587
* search_high = med2
* elif comparison == 1:
* search_low = med2 + step2 # <<<<<<<<<<<<<<
@@ -42073,7 +42260,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
break;
default:
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":571
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":589
* search_low = med2 + step2
* else:
* break # <<<<<<<<<<<<<<
@@ -42088,7 +42275,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
__pyx_L9:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":573
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":591
* break
*
* med_result_len = 0 # <<<<<<<<<<<<<<
@@ -42097,7 +42284,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_med_result_len = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":574
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":592
*
* med_result_len = 0
* med_result = <int*> malloc(0*sizeof(int*)) # <<<<<<<<<<<<<<
@@ -42106,7 +42293,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_med_result = ((int *)malloc((0 * (sizeof(int *)))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":575
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":593
* med_result_len = 0
* med_result = <int*> malloc(0*sizeof(int*))
* if search_high > search_low: # <<<<<<<<<<<<<<
@@ -42116,7 +42303,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_3 = (__pyx_v_search_high > __pyx_v_search_low);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":581
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":599
* # want to store the bindings for all of those elements. We can
* # subsequently throw all of them away.
* med2_minus = med2 # <<<<<<<<<<<<<<
@@ -42125,7 +42312,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_med2_minus = __pyx_v_med2;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":582
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":600
* # subsequently throw all of them away.
* med2_minus = med2
* med2_plus = med2 + step2 # <<<<<<<<<<<<<<
@@ -42134,7 +42321,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_med2_plus = (__pyx_v_med2 + __pyx_v_step2);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":583
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":601
* med2_minus = med2
* med2_plus = med2 + step2
* i1 = med1_minus # <<<<<<<<<<<<<<
@@ -42143,7 +42330,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_i1 = __pyx_v_med1_minus;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":584
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":602
* med2_plus = med2 + step2
* i1 = med1_minus
* while i1 < med1_plus: # <<<<<<<<<<<<<<
@@ -42154,7 +42341,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_3 = (__pyx_v_i1 < __pyx_v_med1_plus);
if (!__pyx_t_3) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":585
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":603
* i1 = med1_minus
* while i1 < med1_plus:
* assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -42163,7 +42350,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_f_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":586
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":604
* while i1 < med1_plus:
* assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr)
* while med2_minus-step2 >= low2: # <<<<<<<<<<<<<<
@@ -42174,7 +42361,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_3 = ((__pyx_v_med2_minus - __pyx_v_step2) >= __pyx_v_low2);
if (!__pyx_t_3) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":587
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":605
* 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) # <<<<<<<<<<<<<<
@@ -42183,7 +42370,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, (__pyx_v_med2_minus - __pyx_v_step2), __pyx_v_step2, __pyx_v_self->fda->sent_id->arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":588
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":606
* 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: # <<<<<<<<<<<<<<
@@ -42193,7 +42380,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_3 = (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last) < 1);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":589
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":607
* 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 # <<<<<<<<<<<<<<
@@ -42205,7 +42392,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":591
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":609
* med2_minus = med2_minus - step2
* else:
* break # <<<<<<<<<<<<<<
@@ -42218,7 +42405,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
__pyx_L18_break:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":592
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":610
* else:
* break
* i2 = med2_minus # <<<<<<<<<<<<<<
@@ -42227,7 +42414,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_i2 = __pyx_v_med2_minus;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":593
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":611
* break
* i2 = med2_minus
* while i2 < high2: # <<<<<<<<<<<<<<
@@ -42238,7 +42425,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_3 = (__pyx_v_i2 < __pyx_v_high2);
if (!__pyx_t_3) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":594
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":612
* i2 = med2_minus
* while i2 < high2:
* assign_matching(&loc2, arr2, i2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -42247,7 +42434,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_i2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":595
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":613
* 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) # <<<<<<<<<<<<<<
@@ -42256,7 +42443,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_comparison = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":596
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":614
* 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: # <<<<<<<<<<<<<<
@@ -42266,7 +42453,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_3 = (__pyx_v_comparison == 0);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":598
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":616
* if comparison == 0:
* pass
* med_result = append_combined_matching(med_result, &loc1, &loc2, offset_by_one, num_subpatterns, &med_result_len) # <<<<<<<<<<<<<<
@@ -42278,7 +42465,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
__pyx_L22:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":599
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":617
* pass
* med_result = append_combined_matching(med_result, &loc1, &loc2, offset_by_one, num_subpatterns, &med_result_len)
* if comparison == -1: # <<<<<<<<<<<<<<
@@ -42288,7 +42475,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_3 = (__pyx_v_comparison == -1);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":600
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":618
* med_result = append_combined_matching(med_result, &loc1, &loc2, offset_by_one, num_subpatterns, &med_result_len)
* if comparison == -1:
* break # <<<<<<<<<<<<<<
@@ -42300,7 +42487,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
__pyx_L23:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":601
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":619
* if comparison == -1:
* break
* i2 = i2 + step2 # <<<<<<<<<<<<<<
@@ -42311,7 +42498,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
__pyx_L21_break:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":602
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":620
* break
* i2 = i2 + step2
* if i2 > med2_plus: # <<<<<<<<<<<<<<
@@ -42321,7 +42508,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_3 = (__pyx_v_i2 > __pyx_v_med2_plus);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":603
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":621
* i2 = i2 + step2
* if i2 > med2_plus:
* med2_plus = i2 # <<<<<<<<<<<<<<
@@ -42333,7 +42520,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
__pyx_L24:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":604
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":622
* if i2 > med2_plus:
* med2_plus = i2
* i1 = i1 + step1 # <<<<<<<<<<<<<<
@@ -42343,7 +42530,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_v_i1 = (__pyx_v_i1 + __pyx_v_step1);
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":606
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":624
* i1 = i1 + step1
*
* tmp = med1_minus # <<<<<<<<<<<<<<
@@ -42352,7 +42539,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_tmp = __pyx_v_med1_minus;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":607
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":625
*
* tmp = med1_minus
* med1_minus = med1_plus # <<<<<<<<<<<<<<
@@ -42361,7 +42548,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_med1_minus = __pyx_v_med1_plus;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":608
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":626
* tmp = med1_minus
* med1_minus = med1_plus
* med1_plus = tmp # <<<<<<<<<<<<<<
@@ -42373,7 +42560,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":611
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":629
* else:
* # No match; need to figure out the point of division in D and Q
* med2_minus = med2 # <<<<<<<<<<<<<<
@@ -42382,7 +42569,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_med2_minus = __pyx_v_med2;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":612
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":630
* # No match; need to figure out the point of division in D and Q
* med2_minus = med2
* med2_plus = med2 # <<<<<<<<<<<<<<
@@ -42391,7 +42578,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_med2_plus = __pyx_v_med2;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":613
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":631
* med2_minus = med2
* med2_plus = med2
* if d_first: # <<<<<<<<<<<<<<
@@ -42400,7 +42587,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
if (__pyx_v_d_first) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":614
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":632
* med2_plus = med2
* if d_first:
* med2_minus = med2_minus + step2 # <<<<<<<<<<<<<<
@@ -42409,7 +42596,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_med2_minus = (__pyx_v_med2_minus + __pyx_v_step2);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":615
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":633
* if d_first:
* med2_minus = med2_minus + step2
* if comparison == -1: # <<<<<<<<<<<<<<
@@ -42419,7 +42606,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_3 = (__pyx_v_comparison == -1);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":616
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":634
* med2_minus = med2_minus + step2
* if comparison == -1:
* med1_minus = med1_plus # <<<<<<<<<<<<<<
@@ -42431,7 +42618,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
__pyx_L26:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":617
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":635
* if comparison == -1:
* med1_minus = med1_plus
* if comparison == 1: # <<<<<<<<<<<<<<
@@ -42441,7 +42628,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_3 = (__pyx_v_comparison == 1);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":618
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":636
* med1_minus = med1_plus
* if comparison == 1:
* med1_plus = med1_minus # <<<<<<<<<<<<<<
@@ -42456,7 +42643,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":620
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":638
* med1_plus = med1_minus
* else:
* tmp = med1_minus # <<<<<<<<<<<<<<
@@ -42465,7 +42652,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_tmp = __pyx_v_med1_minus;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":621
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":639
* else:
* tmp = med1_minus
* med1_minus = med1_plus # <<<<<<<<<<<<<<
@@ -42474,7 +42661,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_med1_minus = __pyx_v_med1_plus;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":622
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":640
* tmp = med1_minus
* med1_minus = med1_plus
* med1_plus = tmp # <<<<<<<<<<<<<<
@@ -42483,7 +42670,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_med1_plus = __pyx_v_tmp;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":623
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":641
* med1_minus = med1_plus
* med1_plus = tmp
* if comparison == 1: # <<<<<<<<<<<<<<
@@ -42493,7 +42680,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_3 = (__pyx_v_comparison == 1);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":624
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":642
* med1_plus = tmp
* if comparison == 1:
* med2_minus = med2_minus + step2 # <<<<<<<<<<<<<<
@@ -42502,7 +42689,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_med2_minus = (__pyx_v_med2_minus + __pyx_v_step2);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":625
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":643
* if comparison == 1:
* med2_minus = med2_minus + step2
* med2_plus = med2_plus + step2 # <<<<<<<<<<<<<<
@@ -42518,7 +42705,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
__pyx_L14:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":627
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":645
* med2_plus = med2_plus + step2
*
* low_result_len = 0 # <<<<<<<<<<<<<<
@@ -42527,7 +42714,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_low_result_len = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":628
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":646
*
* 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) # <<<<<<<<<<<<<<
@@ -42536,7 +42723,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_low_result = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->baeza_yates_helper(__pyx_v_self, __pyx_v_low1, __pyx_v_med1_plus, __pyx_v_arr1, __pyx_v_step1, __pyx_v_low2, __pyx_v_med2_plus, __pyx_v_arr2, __pyx_v_step2, __pyx_v_offset_by_one, __pyx_v_len_last, __pyx_v_num_subpatterns, (&__pyx_v_low_result_len));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":629
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":647
* low_result_len = 0
* low_result = self.baeza_yates_helper(low1, med1_plus, arr1, step1, low2, med2_plus, arr2, step2, offset_by_one, len_last, num_subpatterns, &low_result_len)
* high_result_len = 0 # <<<<<<<<<<<<<<
@@ -42545,7 +42732,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_high_result_len = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":630
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":648
* 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) # <<<<<<<<<<<<<<
@@ -42554,7 +42741,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_high_result = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->baeza_yates_helper(__pyx_v_self, __pyx_v_med1_minus, __pyx_v_high1, __pyx_v_arr1, __pyx_v_step1, __pyx_v_med2_minus, __pyx_v_high2, __pyx_v_arr2, __pyx_v_step2, __pyx_v_offset_by_one, __pyx_v_len_last, __pyx_v_num_subpatterns, (&__pyx_v_high_result_len));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":632
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":650
* 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) # <<<<<<<<<<<<<<
@@ -42563,7 +42750,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_result = __pyx_f_3_sa_extend_arr(__pyx_v_result, __pyx_v_result_len, __pyx_v_low_result, __pyx_v_low_result_len);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":633
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":651
*
* result = extend_arr(result, result_len, low_result, low_result_len)
* result = extend_arr(result, result_len, med_result, med_result_len) # <<<<<<<<<<<<<<
@@ -42572,7 +42759,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_result = __pyx_f_3_sa_extend_arr(__pyx_v_result, __pyx_v_result_len, __pyx_v_med_result, __pyx_v_med_result_len);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":634
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":652
* result = extend_arr(result, result_len, low_result, low_result_len)
* result = extend_arr(result, result_len, med_result, med_result_len)
* result = extend_arr(result, result_len, high_result, high_result_len) # <<<<<<<<<<<<<<
@@ -42581,7 +42768,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_result = __pyx_f_3_sa_extend_arr(__pyx_v_result, __pyx_v_result_len, __pyx_v_high_result, __pyx_v_high_result_len);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":635
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":653
* 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) # <<<<<<<<<<<<<<
@@ -42590,7 +42777,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
free(__pyx_v_low_result);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":636
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":654
* result = extend_arr(result, result_len, high_result, high_result_len)
* free(low_result)
* free(med_result) # <<<<<<<<<<<<<<
@@ -42599,7 +42786,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
free(__pyx_v_med_result);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":637
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":655
* free(low_result)
* free(med_result)
* free(high_result) # <<<<<<<<<<<<<<
@@ -42608,7 +42795,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
free(__pyx_v_high_result);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":639
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":657
* free(high_result)
*
* return result # <<<<<<<<<<<<<<
@@ -42628,7 +42815,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":643
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":661
*
*
* cdef long compare_matchings_set(self, int i1_minus, int i1_plus, int* arr1, int step1, # <<<<<<<<<<<<<<
@@ -42647,7 +42834,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct
int __pyx_t_1;
__Pyx_RefNannySetupContext("compare_matchings_set", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":654
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":672
* cdef Matching* loc1
*
* loc1 = &l1_stack # <<<<<<<<<<<<<<
@@ -42656,7 +42843,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct
*/
__pyx_v_loc1 = (&__pyx_v_l1_stack);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":656
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":674
* loc1 = &l1_stack
*
* i1 = i1_minus # <<<<<<<<<<<<<<
@@ -42665,7 +42852,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct
*/
__pyx_v_i1 = __pyx_v_i1_minus;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":657
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":675
*
* i1 = i1_minus
* while i1 < i1_plus: # <<<<<<<<<<<<<<
@@ -42676,7 +42863,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct
__pyx_t_1 = (__pyx_v_i1 < __pyx_v_i1_plus);
if (!__pyx_t_1) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":658
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":676
* i1 = i1_minus
* while i1 < i1_plus:
* assign_matching(loc1, arr1, i1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -42685,7 +42872,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct
*/
__pyx_f_3_sa_assign_matching(__pyx_v_loc1, __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":659
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":677
* 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) # <<<<<<<<<<<<<<
@@ -42694,7 +42881,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct
*/
__pyx_v_comparison = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, __pyx_v_loc1, __pyx_v_loc2, __pyx_v_offset_by_one, __pyx_v_len_last);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":660
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":678
* 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: # <<<<<<<<<<<<<<
@@ -42704,7 +42891,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct
__pyx_t_1 = (__pyx_v_comparison == 0);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":661
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":679
* comparison = self.compare_matchings(loc1, loc2, offset_by_one, len_last)
* if comparison == 0:
* prev_comparison = 0 # <<<<<<<<<<<<<<
@@ -42713,7 +42900,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct
*/
__pyx_v_prev_comparison = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":662
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":680
* if comparison == 0:
* prev_comparison = 0
* break # <<<<<<<<<<<<<<
@@ -42724,7 +42911,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct
goto __pyx_L5;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":663
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":681
* prev_comparison = 0
* break
* elif i1 == i1_minus: # <<<<<<<<<<<<<<
@@ -42734,7 +42921,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct
__pyx_t_1 = (__pyx_v_i1 == __pyx_v_i1_minus);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":664
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":682
* break
* elif i1 == i1_minus:
* prev_comparison = comparison # <<<<<<<<<<<<<<
@@ -42746,7 +42933,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":666
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":684
* prev_comparison = comparison
* else:
* if comparison != prev_comparison: # <<<<<<<<<<<<<<
@@ -42756,7 +42943,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct
__pyx_t_1 = (__pyx_v_comparison != __pyx_v_prev_comparison);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":667
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":685
* else:
* if comparison != prev_comparison:
* prev_comparison = 0 # <<<<<<<<<<<<<<
@@ -42765,7 +42952,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct
*/
__pyx_v_prev_comparison = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":668
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":686
* if comparison != prev_comparison:
* prev_comparison = 0
* break # <<<<<<<<<<<<<<
@@ -42779,7 +42966,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":669
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":687
* prev_comparison = 0
* break
* i1 = i1 + step1 # <<<<<<<<<<<<<<
@@ -42790,7 +42977,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct
}
__pyx_L4_break:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":670
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":688
* break
* i1 = i1 + step1
* return prev_comparison # <<<<<<<<<<<<<<
@@ -42806,7 +42993,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":673
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":691
*
*
* cdef long compare_matchings(self, Matching* loc1, Matching* loc2, int offset_by_one, int len_last): # <<<<<<<<<<<<<<
@@ -42824,7 +43011,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
int __pyx_t_4;
__Pyx_RefNannySetupContext("compare_matchings", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":676
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":694
* cdef int i
*
* if loc1.sent_id > loc2.sent_id: # <<<<<<<<<<<<<<
@@ -42834,7 +43021,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
__pyx_t_1 = (__pyx_v_loc1->sent_id > __pyx_v_loc2->sent_id);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":677
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":695
*
* if loc1.sent_id > loc2.sent_id:
* return 1 # <<<<<<<<<<<<<<
@@ -42847,7 +43034,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":678
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":696
* if loc1.sent_id > loc2.sent_id:
* return 1
* if loc2.sent_id > loc1.sent_id: # <<<<<<<<<<<<<<
@@ -42857,7 +43044,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
__pyx_t_1 = (__pyx_v_loc2->sent_id > __pyx_v_loc1->sent_id);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":679
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":697
* return 1
* if loc2.sent_id > loc1.sent_id:
* return -1 # <<<<<<<<<<<<<<
@@ -42870,7 +43057,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":681
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":699
* return -1
*
* if loc1.size == 1 and loc2.size == 1: # <<<<<<<<<<<<<<
@@ -42886,7 +43073,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
}
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":682
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":700
*
* if loc1.size == 1 and loc2.size == 1:
* if loc2.arr[loc2.start] - loc1.arr[loc1.start] <= self.train_min_gap_size: # <<<<<<<<<<<<<<
@@ -42896,7 +43083,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
__pyx_t_3 = (((__pyx_v_loc2->arr[__pyx_v_loc2->start]) - (__pyx_v_loc1->arr[__pyx_v_loc1->start])) <= __pyx_v_self->train_min_gap_size);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":683
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":701
* if loc1.size == 1 and loc2.size == 1:
* if loc2.arr[loc2.start] - loc1.arr[loc1.start] <= self.train_min_gap_size:
* return 1 # <<<<<<<<<<<<<<
@@ -42911,7 +43098,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
goto __pyx_L5;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":685
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":703
* return 1
*
* elif offset_by_one: # <<<<<<<<<<<<<<
@@ -42920,7 +43107,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
*/
if (__pyx_v_offset_by_one) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":686
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":704
*
* elif offset_by_one:
* for i from 1 <= i < loc1.size: # <<<<<<<<<<<<<<
@@ -42930,7 +43117,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
__pyx_t_4 = __pyx_v_loc1->size;
for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":687
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":705
* elif offset_by_one:
* for i from 1 <= i < loc1.size:
* if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i-1]: # <<<<<<<<<<<<<<
@@ -42940,7 +43127,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
__pyx_t_3 = ((__pyx_v_loc1->arr[(__pyx_v_loc1->start + __pyx_v_i)]) > (__pyx_v_loc2->arr[((__pyx_v_loc2->start + __pyx_v_i) - 1)]));
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":688
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":706
* for i from 1 <= i < loc1.size:
* if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i-1]:
* return 1 # <<<<<<<<<<<<<<
@@ -42953,7 +43140,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
}
__pyx_L9:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":689
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":707
* 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]: # <<<<<<<<<<<<<<
@@ -42963,7 +43150,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
__pyx_t_3 = ((__pyx_v_loc1->arr[(__pyx_v_loc1->start + __pyx_v_i)]) < (__pyx_v_loc2->arr[((__pyx_v_loc2->start + __pyx_v_i) - 1)]));
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":690
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":708
* return 1
* if loc1.arr[loc1.start+i] < loc2.arr[loc2.start+i-1]:
* return -1 # <<<<<<<<<<<<<<
@@ -42980,7 +43167,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":693
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":711
*
* else:
* if loc1.arr[loc1.start]+1 > loc2.arr[loc2.start]: # <<<<<<<<<<<<<<
@@ -42990,7 +43177,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
__pyx_t_3 = (((__pyx_v_loc1->arr[__pyx_v_loc1->start]) + 1) > (__pyx_v_loc2->arr[__pyx_v_loc2->start]));
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":694
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":712
* else:
* if loc1.arr[loc1.start]+1 > loc2.arr[loc2.start]:
* return 1 # <<<<<<<<<<<<<<
@@ -43003,7 +43190,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
}
__pyx_L11:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":695
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":713
* if loc1.arr[loc1.start]+1 > loc2.arr[loc2.start]:
* return 1
* if loc1.arr[loc1.start]+1 < loc2.arr[loc2.start]: # <<<<<<<<<<<<<<
@@ -43013,7 +43200,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
__pyx_t_3 = (((__pyx_v_loc1->arr[__pyx_v_loc1->start]) + 1) < (__pyx_v_loc2->arr[__pyx_v_loc2->start]));
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":696
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":714
* return 1
* if loc1.arr[loc1.start]+1 < loc2.arr[loc2.start]:
* return -1 # <<<<<<<<<<<<<<
@@ -43026,7 +43213,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
}
__pyx_L12:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":698
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":716
* return -1
*
* for i from 1 <= i < loc1.size: # <<<<<<<<<<<<<<
@@ -43036,7 +43223,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
__pyx_t_4 = __pyx_v_loc1->size;
for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":699
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":717
*
* for i from 1 <= i < loc1.size:
* if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i]: # <<<<<<<<<<<<<<
@@ -43046,7 +43233,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
__pyx_t_3 = ((__pyx_v_loc1->arr[(__pyx_v_loc1->start + __pyx_v_i)]) > (__pyx_v_loc2->arr[(__pyx_v_loc2->start + __pyx_v_i)]));
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":700
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":718
* for i from 1 <= i < loc1.size:
* if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i]:
* return 1 # <<<<<<<<<<<<<<
@@ -43059,7 +43246,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
}
__pyx_L15:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":701
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":719
* if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i]:
* return 1
* if loc1.arr[loc1.start+i] < loc2.arr[loc2.start+i]: # <<<<<<<<<<<<<<
@@ -43069,7 +43256,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
__pyx_t_3 = ((__pyx_v_loc1->arr[(__pyx_v_loc1->start + __pyx_v_i)]) < (__pyx_v_loc2->arr[(__pyx_v_loc2->start + __pyx_v_i)]));
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":702
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":720
* return 1
* if loc1.arr[loc1.start+i] < loc2.arr[loc2.start+i]:
* return -1 # <<<<<<<<<<<<<<
@@ -43085,7 +43272,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":704
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":722
* return -1
*
* if loc2.arr[loc2.end-1] + len_last - loc1.arr[loc1.start] > self.train_max_initial_size: # <<<<<<<<<<<<<<
@@ -43095,7 +43282,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
__pyx_t_3 = ((((__pyx_v_loc2->arr[(__pyx_v_loc2->end - 1)]) + __pyx_v_len_last) - (__pyx_v_loc1->arr[__pyx_v_loc1->start])) > __pyx_v_self->train_max_initial_size);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":705
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":723
*
* if loc2.arr[loc2.end-1] + len_last - loc1.arr[loc1.start] > self.train_max_initial_size:
* return -1 # <<<<<<<<<<<<<<
@@ -43108,7 +43295,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
}
__pyx_L17:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":706
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":724
* if loc2.arr[loc2.end-1] + len_last - loc1.arr[loc1.start] > self.train_max_initial_size:
* return -1
* return 0 # <<<<<<<<<<<<<<
@@ -43124,7 +43311,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":709
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":727
*
*
* cdef int* merge_helper(self, int low1, int high1, int* arr1, int step1, # <<<<<<<<<<<<<<
@@ -43148,7 +43335,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
int __pyx_t_3;
__Pyx_RefNannySetupContext("merge_helper", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":717
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":735
* cdef Matching loc1, loc2
*
* result_len[0] = 0 # <<<<<<<<<<<<<<
@@ -43157,7 +43344,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
*/
(__pyx_v_result_len[0]) = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":718
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":736
*
* result_len[0] = 0
* result = <int*> malloc(0*sizeof(int)) # <<<<<<<<<<<<<<
@@ -43166,7 +43353,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
*/
__pyx_v_result = ((int *)malloc((0 * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":720
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":738
* result = <int*> malloc(0*sizeof(int))
*
* i1 = low1 # <<<<<<<<<<<<<<
@@ -43175,7 +43362,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
*/
__pyx_v_i1 = __pyx_v_low1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":721
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":739
*
* i1 = low1
* i2 = low2 # <<<<<<<<<<<<<<
@@ -43184,7 +43371,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
*/
__pyx_v_i2 = __pyx_v_low2;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":722
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":740
* i1 = low1
* i2 = low2
* while i1 < high1 and i2 < high2: # <<<<<<<<<<<<<<
@@ -43201,7 +43388,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
}
if (!__pyx_t_3) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":725
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":743
*
* # First, pop all unneeded loc2's off the stack
* assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -43210,7 +43397,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
*/
__pyx_f_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":726
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":744
* # First, pop all unneeded loc2's off the stack
* assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr)
* while i2 < high2: # <<<<<<<<<<<<<<
@@ -43221,7 +43408,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
__pyx_t_3 = (__pyx_v_i2 < __pyx_v_high2);
if (!__pyx_t_3) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":727
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":745
* 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) # <<<<<<<<<<<<<<
@@ -43230,7 +43417,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
*/
__pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_i2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":728
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":746
* 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: # <<<<<<<<<<<<<<
@@ -43240,7 +43427,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
__pyx_t_3 = (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last) == 1);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":729
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":747
* 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 # <<<<<<<<<<<<<<
@@ -43252,7 +43439,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":731
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":749
* i2 = i2 + step2
* else:
* break # <<<<<<<<<<<<<<
@@ -43265,7 +43452,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
}
__pyx_L6_break:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":734
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":752
*
* # Next: process all loc1's with the same starting val
* j1 = i1 # <<<<<<<<<<<<<<
@@ -43274,7 +43461,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
*/
__pyx_v_j1 = __pyx_v_i1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":735
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":753
* # Next: process all loc1's with the same starting val
* j1 = i1
* while i1 < high1 and arr1[j1] == arr1[i1]: # <<<<<<<<<<<<<<
@@ -43291,7 +43478,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
}
if (!__pyx_t_2) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":736
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":754
* j1 = i1
* while i1 < high1 and arr1[j1] == arr1[i1]:
* assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -43300,7 +43487,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
*/
__pyx_f_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":737
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":755
* while i1 < high1 and arr1[j1] == arr1[i1]:
* assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr)
* j2 = i2 # <<<<<<<<<<<<<<
@@ -43309,7 +43496,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
*/
__pyx_v_j2 = __pyx_v_i2;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":738
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":756
* assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr)
* j2 = i2
* while j2 < high2: # <<<<<<<<<<<<<<
@@ -43320,7 +43507,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
__pyx_t_2 = (__pyx_v_j2 < __pyx_v_high2);
if (!__pyx_t_2) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":739
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":757
* j2 = i2
* while j2 < high2:
* assign_matching(&loc2, arr2, j2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -43329,7 +43516,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
*/
__pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_j2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":740
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":758
* 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) # <<<<<<<<<<<<<<
@@ -43338,7 +43525,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
*/
__pyx_v_comparison = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":741
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":759
* 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: # <<<<<<<<<<<<<<
@@ -43348,7 +43535,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
__pyx_t_2 = (__pyx_v_comparison == 0);
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":742
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":760
* 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) # <<<<<<<<<<<<<<
@@ -43360,7 +43547,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
}
__pyx_L12:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":743
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":761
* if comparison == 0:
* result = append_combined_matching(result, &loc1, &loc2, offset_by_one, num_subpatterns, result_len)
* if comparison == 1: # <<<<<<<<<<<<<<
@@ -43373,7 +43560,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
}
__pyx_L13:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":745
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":763
* if comparison == 1:
* pass
* if comparison == -1: # <<<<<<<<<<<<<<
@@ -43383,7 +43570,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
__pyx_t_2 = (__pyx_v_comparison == -1);
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":746
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":764
* pass
* if comparison == -1:
* break # <<<<<<<<<<<<<<
@@ -43395,7 +43582,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":748
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":766
* break
* else:
* j2 = j2 + step2 # <<<<<<<<<<<<<<
@@ -43408,7 +43595,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
}
__pyx_L11_break:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":749
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":767
* else:
* j2 = j2 + step2
* i1 = i1 + step1 # <<<<<<<<<<<<<<
@@ -43419,7 +43606,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
}
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":750
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":768
* j2 = j2 + step2
* i1 = i1 + step1
* return result # <<<<<<<<<<<<<<
@@ -43435,7 +43622,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":753
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":771
*
*
* cdef void sort_phrase_loc(self, IntList arr, PhraseLocation loc, Phrase phrase): # <<<<<<<<<<<<<<
@@ -43457,26 +43644,26 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("sort_phrase_loc", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":758
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":776
* cdef IntList result
*
* if phrase in self.precomputed_index: # <<<<<<<<<<<<<<
* loc.arr = self.precomputed_index[phrase]
* else:
*/
- __pyx_t_1 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_v_phrase), __pyx_v_self->precomputed_index, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_v_phrase), __pyx_v_self->precomputed_index, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":759
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":777
*
* if phrase in self.precomputed_index:
* loc.arr = self.precomputed_index[phrase] # <<<<<<<<<<<<<<
* else:
* loc.arr = IntList(initial_len=loc.sa_high-loc.sa_low)
*/
- __pyx_t_2 = PyObject_GetItem(__pyx_v_self->precomputed_index, ((PyObject *)__pyx_v_phrase)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetItem(__pyx_v_self->precomputed_index, ((PyObject *)__pyx_v_phrase)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_loc->arr);
__Pyx_DECREF(((PyObject *)__pyx_v_loc->arr));
@@ -43486,20 +43673,20 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":761
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":779
* loc.arr = self.precomputed_index[phrase]
* else:
* loc.arr = IntList(initial_len=loc.sa_high-loc.sa_low) # <<<<<<<<<<<<<<
* veb = VEB(arr.len)
* for i from loc.sa_low <= i < loc.sa_high:
*/
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
- __pyx_t_3 = PyInt_FromLong((__pyx_v_loc->sa_high - __pyx_v_loc->sa_low)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong((__pyx_v_loc->sa_high - __pyx_v_loc->sa_low)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__Pyx_GIVEREF(__pyx_t_3);
@@ -43508,27 +43695,27 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_
__pyx_v_loc->arr = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":762
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":780
* else:
* loc.arr = IntList(initial_len=loc.sa_high-loc.sa_low)
* veb = VEB(arr.len) # <<<<<<<<<<<<<<
* for i from loc.sa_low <= i < loc.sa_high:
* veb._insert(arr.arr[i])
*/
- __pyx_t_3 = PyInt_FromLong(__pyx_v_arr->len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong(__pyx_v_arr->len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_VEB)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_VEB)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__pyx_v_veb = ((struct __pyx_obj_3_sa_VEB *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":763
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":781
* 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: # <<<<<<<<<<<<<<
@@ -43538,7 +43725,7 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_
__pyx_t_4 = __pyx_v_loc->sa_high;
for (__pyx_v_i = __pyx_v_loc->sa_low; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":764
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":782
* veb = VEB(arr.len)
* for i from loc.sa_low <= i < loc.sa_high:
* veb._insert(arr.arr[i]) # <<<<<<<<<<<<<<
@@ -43548,7 +43735,7 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_
((struct __pyx_vtabstruct_3_sa_VEB *)__pyx_v_veb->__pyx_vtab)->_insert(__pyx_v_veb, (__pyx_v_arr->arr[__pyx_v_i]));
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":765
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":783
* for i from loc.sa_low <= i < loc.sa_high:
* veb._insert(arr.arr[i])
* i = veb.veb.min_val # <<<<<<<<<<<<<<
@@ -43557,7 +43744,7 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_
*/
__pyx_v_i = __pyx_v_veb->veb->min_val;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":766
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":784
* veb._insert(arr.arr[i])
* i = veb.veb.min_val
* for j from 0 <= j < loc.sa_high-loc.sa_low: # <<<<<<<<<<<<<<
@@ -43567,7 +43754,7 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_
__pyx_t_4 = (__pyx_v_loc->sa_high - __pyx_v_loc->sa_low);
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_4; __pyx_v_j++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":767
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":785
* i = veb.veb.min_val
* for j from 0 <= j < loc.sa_high-loc.sa_low:
* loc.arr.arr[j] = i # <<<<<<<<<<<<<<
@@ -43576,7 +43763,7 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_
*/
(__pyx_v_loc->arr->arr[__pyx_v_j]) = __pyx_v_i;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":768
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":786
* for j from 0 <= j < loc.sa_high-loc.sa_low:
* loc.arr.arr[j] = i
* i = veb._findsucc(i) # <<<<<<<<<<<<<<
@@ -43588,7 +43775,7 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":769
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":787
* loc.arr.arr[j] = i
* i = veb._findsucc(i)
* loc.arr_low = 0 # <<<<<<<<<<<<<<
@@ -43597,7 +43784,7 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_
*/
__pyx_v_loc->arr_low = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":770
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":788
* i = veb._findsucc(i)
* loc.arr_low = 0
* loc.arr_high = loc.arr.len # <<<<<<<<<<<<<<
@@ -43616,7 +43803,7 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_
__Pyx_RefNannyFinishContext();
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":773
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":791
*
*
* cdef intersect_helper(self, Phrase prefix, Phrase suffix, # <<<<<<<<<<<<<<
@@ -43653,7 +43840,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("intersect_helper", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":780
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":798
* cdef int* result_ptr
*
* result_len = 0 # <<<<<<<<<<<<<<
@@ -43662,21 +43849,21 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
*/
__pyx_v_result_len = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":782
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":800
* result_len = 0
*
* if sym_isvar(suffix[0]): # <<<<<<<<<<<<<<
* offset_by_one = 1
* else:
*/
- __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_suffix), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_suffix), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_3 = __pyx_f_3_sa_sym_isvar(__pyx_t_2);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":783
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":801
*
* if sym_isvar(suffix[0]):
* offset_by_one = 1 # <<<<<<<<<<<<<<
@@ -43688,7 +43875,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":785
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":803
* offset_by_one = 1
* else:
* offset_by_one = 0 # <<<<<<<<<<<<<<
@@ -43699,34 +43886,34 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":787
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":805
* offset_by_one = 0
*
* len_last = len(suffix.getchunk(suffix.arity())) # <<<<<<<<<<<<<<
*
* if prefix_loc.arr is None:
*/
- __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_suffix), __pyx_n_s__getchunk); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_suffix), __pyx_n_s__getchunk); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_suffix), __pyx_n_s__arity); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_suffix), __pyx_n_s__arity); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
__pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_6 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_len_last = __pyx_t_6;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":789
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":807
* len_last = len(suffix.getchunk(suffix.arity()))
*
* if prefix_loc.arr is None: # <<<<<<<<<<<<<<
@@ -43736,7 +43923,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
__pyx_t_7 = (((PyObject *)__pyx_v_prefix_loc->arr) == Py_None);
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":790
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":808
*
* if prefix_loc.arr is None:
* self.sort_phrase_loc(self.fsa.sa, prefix_loc, prefix) # <<<<<<<<<<<<<<
@@ -43751,7 +43938,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":791
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":809
* if prefix_loc.arr is None:
* self.sort_phrase_loc(self.fsa.sa, prefix_loc, prefix)
* arr1 = prefix_loc.arr # <<<<<<<<<<<<<<
@@ -43761,7 +43948,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
__Pyx_INCREF(((PyObject *)__pyx_v_prefix_loc->arr));
__pyx_v_arr1 = __pyx_v_prefix_loc->arr;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":792
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":810
* self.sort_phrase_loc(self.fsa.sa, prefix_loc, prefix)
* arr1 = prefix_loc.arr
* low1 = prefix_loc.arr_low # <<<<<<<<<<<<<<
@@ -43770,7 +43957,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
*/
__pyx_v_low1 = __pyx_v_prefix_loc->arr_low;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":793
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":811
* arr1 = prefix_loc.arr
* low1 = prefix_loc.arr_low
* high1 = prefix_loc.arr_high # <<<<<<<<<<<<<<
@@ -43779,7 +43966,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
*/
__pyx_v_high1 = __pyx_v_prefix_loc->arr_high;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":794
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":812
* low1 = prefix_loc.arr_low
* high1 = prefix_loc.arr_high
* step1 = prefix_loc.num_subpatterns # <<<<<<<<<<<<<<
@@ -43788,7 +43975,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
*/
__pyx_v_step1 = __pyx_v_prefix_loc->num_subpatterns;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":796
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":814
* step1 = prefix_loc.num_subpatterns
*
* if suffix_loc.arr is None: # <<<<<<<<<<<<<<
@@ -43798,7 +43985,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
__pyx_t_7 = (((PyObject *)__pyx_v_suffix_loc->arr) == Py_None);
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":797
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":815
*
* if suffix_loc.arr is None:
* self.sort_phrase_loc(self.fsa.sa, suffix_loc, suffix) # <<<<<<<<<<<<<<
@@ -43813,7 +44000,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":798
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":816
* if suffix_loc.arr is None:
* self.sort_phrase_loc(self.fsa.sa, suffix_loc, suffix)
* arr2 = suffix_loc.arr # <<<<<<<<<<<<<<
@@ -43823,7 +44010,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
__Pyx_INCREF(((PyObject *)__pyx_v_suffix_loc->arr));
__pyx_v_arr2 = __pyx_v_suffix_loc->arr;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":799
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":817
* self.sort_phrase_loc(self.fsa.sa, suffix_loc, suffix)
* arr2 = suffix_loc.arr
* low2 = suffix_loc.arr_low # <<<<<<<<<<<<<<
@@ -43832,7 +44019,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
*/
__pyx_v_low2 = __pyx_v_suffix_loc->arr_low;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":800
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":818
* arr2 = suffix_loc.arr
* low2 = suffix_loc.arr_low
* high2 = suffix_loc.arr_high # <<<<<<<<<<<<<<
@@ -43841,7 +44028,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
*/
__pyx_v_high2 = __pyx_v_suffix_loc->arr_high;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":801
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":819
* low2 = suffix_loc.arr_low
* high2 = suffix_loc.arr_high
* step2 = suffix_loc.num_subpatterns # <<<<<<<<<<<<<<
@@ -43850,26 +44037,26 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
*/
__pyx_v_step2 = __pyx_v_suffix_loc->num_subpatterns;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":803
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":821
* step2 = suffix_loc.num_subpatterns
*
* num_subpatterns = prefix.arity()+1 # <<<<<<<<<<<<<<
*
* if algorithm == MERGE:
*/
- __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_prefix), __pyx_n_s__arity); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_prefix), __pyx_n_s__arity); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_num_subpatterns = __pyx_t_3;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":805
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":823
* num_subpatterns = prefix.arity()+1
*
* if algorithm == MERGE: # <<<<<<<<<<<<<<
@@ -43879,7 +44066,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
__pyx_t_7 = (__pyx_v_algorithm == __pyx_v_3_sa_MERGE);
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":808
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":826
* result_ptr = self.merge_helper(low1, high1, arr1.arr, step1,
* low2, high2, arr2.arr, step2,
* offset_by_one, len_last, num_subpatterns, &result_len) # <<<<<<<<<<<<<<
@@ -43891,7 +44078,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":812
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":830
* result_ptr = self.baeza_yates_helper(low1, high1, arr1.arr, step1,
* low2, high2, arr2.arr, step2,
* offset_by_one, len_last, num_subpatterns, &result_len) # <<<<<<<<<<<<<<
@@ -43902,7 +44089,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
}
__pyx_L6:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":814
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":832
* offset_by_one, len_last, num_subpatterns, &result_len)
*
* if result_len == 0: # <<<<<<<<<<<<<<
@@ -43912,7 +44099,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
__pyx_t_7 = (__pyx_v_result_len == 0);
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":815
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":833
*
* if result_len == 0:
* free(result_ptr) # <<<<<<<<<<<<<<
@@ -43921,7 +44108,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
*/
free(__pyx_v_result_ptr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":816
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":834
* if result_len == 0:
* free(result_ptr)
* return None # <<<<<<<<<<<<<<
@@ -43936,19 +44123,19 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":818
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":836
* return None
* else:
* result = IntList() # <<<<<<<<<<<<<<
* free(result.arr)
* result.arr = result_ptr
*/
- __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_v_result = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_5);
__pyx_t_5 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":819
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":837
* else:
* result = IntList()
* free(result.arr) # <<<<<<<<<<<<<<
@@ -43957,7 +44144,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
*/
free(__pyx_v_result->arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":820
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":838
* result = IntList()
* free(result.arr)
* result.arr = result_ptr # <<<<<<<<<<<<<<
@@ -43966,7 +44153,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
*/
__pyx_v_result->arr = __pyx_v_result_ptr;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":821
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":839
* free(result.arr)
* result.arr = result_ptr
* result.len = result_len # <<<<<<<<<<<<<<
@@ -43975,7 +44162,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
*/
__pyx_v_result->len = __pyx_v_result_len;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":822
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":840
* result.arr = result_ptr
* result.len = result_len
* result.size = result_len # <<<<<<<<<<<<<<
@@ -43984,7 +44171,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
*/
__pyx_v_result->size = __pyx_v_result_len;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":823
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":841
* result.len = result_len
* result.size = result_len
* return PhraseLocation(arr_low=0, arr_high=result_len, arr=result, num_subpatterns=num_subpatterns) # <<<<<<<<<<<<<<
@@ -43992,19 +44179,19 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
* cdef loc2str(self, PhraseLocation loc):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_5));
- if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__arr_low), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = PyInt_FromLong(__pyx_v_result_len); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__arr_low), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_v_result_len); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__arr_high), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__arr_high), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__arr), ((PyObject *)__pyx_v_result)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = PyInt_FromLong(__pyx_v_num_subpatterns); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__arr), ((PyObject *)__pyx_v_result)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_v_num_subpatterns); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__num_subpatterns), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__num_subpatterns), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
__pyx_r = __pyx_t_4;
@@ -44030,7 +44217,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":825
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":843
* return PhraseLocation(arr_low=0, arr_high=result_len, arr=result, num_subpatterns=num_subpatterns)
*
* cdef loc2str(self, PhraseLocation loc): # <<<<<<<<<<<<<<
@@ -44053,7 +44240,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("loc2str", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":827
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":845
* cdef loc2str(self, PhraseLocation loc):
* cdef int i, j
* result = "{" # <<<<<<<<<<<<<<
@@ -44063,7 +44250,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st
__Pyx_INCREF(((PyObject *)__pyx_kp_s_116));
__pyx_v_result = ((PyObject *)__pyx_kp_s_116);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":828
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":846
* cdef int i, j
* result = "{"
* i = 0 # <<<<<<<<<<<<<<
@@ -44072,7 +44259,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st
*/
__pyx_v_i = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":829
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":847
* result = "{"
* i = 0
* while i < loc.arr_high: # <<<<<<<<<<<<<<
@@ -44083,20 +44270,20 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st
__pyx_t_1 = (__pyx_v_i < __pyx_v_loc->arr_high);
if (!__pyx_t_1) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":830
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":848
* i = 0
* while i < loc.arr_high:
* result = result + "(" # <<<<<<<<<<<<<<
* for j from i <= j < i + loc.num_subpatterns:
* result = result + ("%d " %loc.arr[j])
*/
- __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_117)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_117)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_v_result);
__pyx_v_result = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":831
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":849
* while i < loc.arr_high:
* result = result + "("
* for j from i <= j < i + loc.num_subpatterns: # <<<<<<<<<<<<<<
@@ -44106,19 +44293,19 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st
__pyx_t_3 = (__pyx_v_i + __pyx_v_loc->num_subpatterns);
for (__pyx_v_j = __pyx_v_i; __pyx_v_j < __pyx_t_3; __pyx_v_j++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":832
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":850
* result = result + "("
* for j from i <= j < i + loc.num_subpatterns:
* result = result + ("%d " %loc.arr[j]) # <<<<<<<<<<<<<<
* result = result + ")"
* i = i + loc.num_subpatterns
*/
- __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_loc->arr), __pyx_v_j, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_loc->arr), __pyx_v_j, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_21), __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_21), __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_v_result);
@@ -44126,20 +44313,20 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st
__pyx_t_2 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":833
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":851
* for j from i <= j < i + loc.num_subpatterns:
* result = result + ("%d " %loc.arr[j])
* result = result + ")" # <<<<<<<<<<<<<<
* i = i + loc.num_subpatterns
* result = result + "}"
*/
- __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_59)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_59)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_v_result);
__pyx_v_result = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":834
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":852
* result = result + ("%d " %loc.arr[j])
* result = result + ")"
* i = i + loc.num_subpatterns # <<<<<<<<<<<<<<
@@ -44149,20 +44336,20 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st
__pyx_v_i = (__pyx_v_i + __pyx_v_loc->num_subpatterns);
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":835
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":853
* result = result + ")"
* i = i + loc.num_subpatterns
* result = result + "}" # <<<<<<<<<<<<<<
* return result
*
*/
- __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_118)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_118)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_v_result);
__pyx_v_result = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":836
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":854
* i = i + loc.num_subpatterns
* result = result + "}"
* return result # <<<<<<<<<<<<<<
@@ -44188,7 +44375,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":838
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":856
* return result
*
* cdef PhraseLocation intersect(self, prefix_node, suffix_node, Phrase phrase): # <<<<<<<<<<<<<<
@@ -44214,81 +44401,81 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("intersect", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":842
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":860
* cdef PhraseLocation prefix_loc, suffix_loc, result
*
* prefix = prefix_node.phrase # <<<<<<<<<<<<<<
* suffix = suffix_node.phrase
* prefix_loc = prefix_node.phrase_location
*/
- __pyx_t_1 = PyObject_GetAttr(__pyx_v_prefix_node, __pyx_n_s__phrase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(__pyx_v_prefix_node, __pyx_n_s__phrase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3_sa_Phrase))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3_sa_Phrase))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_prefix = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":843
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":861
*
* prefix = prefix_node.phrase
* suffix = suffix_node.phrase # <<<<<<<<<<<<<<
* prefix_loc = prefix_node.phrase_location
* suffix_loc = suffix_node.phrase_location
*/
- __pyx_t_1 = PyObject_GetAttr(__pyx_v_suffix_node, __pyx_n_s__phrase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(__pyx_v_suffix_node, __pyx_n_s__phrase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3_sa_Phrase))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3_sa_Phrase))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_suffix = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":844
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":862
* prefix = prefix_node.phrase
* suffix = suffix_node.phrase
* prefix_loc = prefix_node.phrase_location # <<<<<<<<<<<<<<
* suffix_loc = suffix_node.phrase_location
*
*/
- __pyx_t_1 = PyObject_GetAttr(__pyx_v_prefix_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(__pyx_v_prefix_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_prefix_loc = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":845
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":863
* suffix = suffix_node.phrase
* prefix_loc = prefix_node.phrase_location
* suffix_loc = suffix_node.phrase_location # <<<<<<<<<<<<<<
*
* result = self.get_precomputed_collocation(phrase)
*/
- __pyx_t_1 = PyObject_GetAttr(__pyx_v_suffix_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(__pyx_v_suffix_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_suffix_loc = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":847
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":865
* suffix_loc = suffix_node.phrase_location
*
* result = self.get_precomputed_collocation(phrase) # <<<<<<<<<<<<<<
* if result is not None:
* intersect_method = "precomputed"
*/
- __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_119); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_119); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)__pyx_v_phrase));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_phrase));
__Pyx_GIVEREF(((PyObject *)__pyx_v_phrase));
- __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_result = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":848
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":866
*
* result = self.get_precomputed_collocation(phrase)
* if result is not None: # <<<<<<<<<<<<<<
@@ -44298,7 +44485,7 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact
__pyx_t_4 = (((PyObject *)__pyx_v_result) != Py_None);
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":849
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":867
* result = self.get_precomputed_collocation(phrase)
* if result is not None:
* intersect_method = "precomputed" # <<<<<<<<<<<<<<
@@ -44311,7 +44498,7 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":851
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":869
* intersect_method = "precomputed"
*
* if result is None: # <<<<<<<<<<<<<<
@@ -44321,7 +44508,7 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact
__pyx_t_4 = (((PyObject *)__pyx_v_result) == Py_None);
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":852
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":870
*
* if result is None:
* if self.use_baeza_yates: # <<<<<<<<<<<<<<
@@ -44330,21 +44517,21 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact
*/
if (__pyx_v_self->use_baeza_yates) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":853
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":871
* if result is None:
* if self.use_baeza_yates:
* result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, BAEZA_YATES) # <<<<<<<<<<<<<<
* intersect_method="double binary"
* else:
*/
- __pyx_t_3 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->intersect_helper(__pyx_v_self, __pyx_v_prefix, __pyx_v_suffix, __pyx_v_prefix_loc, __pyx_v_suffix_loc, __pyx_v_3_sa_BAEZA_YATES); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->intersect_helper(__pyx_v_self, __pyx_v_prefix, __pyx_v_suffix, __pyx_v_prefix_loc, __pyx_v_suffix_loc, __pyx_v_3_sa_BAEZA_YATES); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_v_result));
__pyx_v_result = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":854
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":872
* if self.use_baeza_yates:
* result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, BAEZA_YATES)
* intersect_method="double binary" # <<<<<<<<<<<<<<
@@ -44358,21 +44545,21 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":856
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":874
* intersect_method="double binary"
* else:
* result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, MERGE) # <<<<<<<<<<<<<<
* intersect_method="merge"
* return result
*/
- __pyx_t_3 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->intersect_helper(__pyx_v_self, __pyx_v_prefix, __pyx_v_suffix, __pyx_v_prefix_loc, __pyx_v_suffix_loc, __pyx_v_3_sa_MERGE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->intersect_helper(__pyx_v_self, __pyx_v_prefix, __pyx_v_suffix, __pyx_v_prefix_loc, __pyx_v_suffix_loc, __pyx_v_3_sa_MERGE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_v_result));
__pyx_v_result = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":857
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":875
* else:
* result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, MERGE)
* intersect_method="merge" # <<<<<<<<<<<<<<
@@ -44388,7 +44575,7 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":858
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":876
* result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, MERGE)
* intersect_method="merge"
* return result # <<<<<<<<<<<<<<
@@ -44450,16 +44637,16 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_13advance(PyObject *__p
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__res)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("advance", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("advance", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fwords)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("advance", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("advance", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "advance") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "advance") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
@@ -44474,7 +44661,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_13advance(PyObject *__p
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("advance", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("advance", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.HieroCachingRuleFactory.advance", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -44485,7 +44672,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_13advance(PyObject *__p
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":860
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":878
* return result
*
* def advance(self, frontier, res, fwords): # <<<<<<<<<<<<<<
@@ -44526,19 +44713,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("advance", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":862
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":880
* def advance(self, frontier, res, fwords):
* cdef unsigned na
* nf = [] # <<<<<<<<<<<<<<
* for (toskip, (i, alt, pathlen)) in frontier:
* spanlen = fwords[i][alt][2]
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_nf = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":863
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":881
* cdef unsigned na
* nf = []
* for (toskip, (i, alt, pathlen)) in frontier: # <<<<<<<<<<<<<<
@@ -44549,7 +44736,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
__pyx_t_1 = __pyx_v_frontier; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
__pyx_t_3 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_frontier); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_frontier); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -44557,23 +44744,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_3(__pyx_t_1);
if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -44589,7 +44776,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -44602,14 +44789,14 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
- __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
@@ -44617,7 +44804,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
__Pyx_GOTREF(__pyx_t_5);
index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L6_unpacking_done;
@@ -44625,7 +44812,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L6_unpacking_done:;
}
__Pyx_XDECREF(__pyx_v_toskip);
@@ -44641,7 +44828,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -44657,15 +44844,15 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
__Pyx_INCREF(__pyx_t_9);
__Pyx_INCREF(__pyx_t_10);
#else
- __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_10 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_11 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_8 = Py_TYPE(__pyx_t_11)->tp_iternext;
@@ -44675,7 +44862,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
__Pyx_GOTREF(__pyx_t_9);
index = 2; __pyx_t_10 = __pyx_t_8(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L7_unpacking_failed;
__Pyx_GOTREF(__pyx_t_10);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_11), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_11), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
goto __pyx_L8_unpacking_done;
@@ -44683,7 +44870,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L8_unpacking_done:;
}
__Pyx_XDECREF(__pyx_v_i);
@@ -44696,45 +44883,45 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
__pyx_v_pathlen = __pyx_t_10;
__pyx_t_10 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":864
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":882
* nf = []
* for (toskip, (i, alt, pathlen)) in frontier:
* spanlen = fwords[i][alt][2] # <<<<<<<<<<<<<<
* if (toskip == 0):
* res.append((i, alt, pathlen))
*/
- __pyx_t_4 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = PyObject_GetItem(__pyx_t_4, __pyx_v_alt); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_GetItem(__pyx_t_4, __pyx_v_alt); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF(__pyx_v_spanlen);
__pyx_v_spanlen = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":865
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":883
* for (toskip, (i, alt, pathlen)) in frontier:
* spanlen = fwords[i][alt][2]
* if (toskip == 0): # <<<<<<<<<<<<<<
* res.append((i, alt, pathlen))
* ni = i + spanlen
*/
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_toskip, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_v_toskip, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_12) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":866
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":884
* spanlen = fwords[i][alt][2]
* if (toskip == 0):
* res.append((i, alt, pathlen)) # <<<<<<<<<<<<<<
* ni = i + spanlen
* if (ni < len(fwords) and (pathlen + 1) < self.max_initial_size):
*/
- __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_i);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_i);
@@ -44745,7 +44932,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
__Pyx_INCREF(__pyx_v_pathlen);
PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_pathlen);
__Pyx_GIVEREF(__pyx_v_pathlen);
- __pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_res, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_res, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
@@ -44753,42 +44940,42 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
}
__pyx_L9:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":867
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":885
* if (toskip == 0):
* res.append((i, alt, pathlen))
* ni = i + spanlen # <<<<<<<<<<<<<<
* if (ni < len(fwords) and (pathlen + 1) < self.max_initial_size):
* for na in range(len(fwords[ni])):
*/
- __pyx_t_6 = PyNumber_Add(__pyx_v_i, __pyx_v_spanlen); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyNumber_Add(__pyx_v_i, __pyx_v_spanlen); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_v_ni);
__pyx_v_ni = __pyx_t_6;
__pyx_t_6 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":868
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":886
* res.append((i, alt, pathlen))
* ni = i + spanlen
* if (ni < len(fwords) and (pathlen + 1) < self.max_initial_size): # <<<<<<<<<<<<<<
* for na in range(len(fwords[ni])):
* nf.append((toskip - 1, (ni, na, pathlen + 1)))
*/
- __pyx_t_13 = PyObject_Length(__pyx_v_fwords); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyObject_Length(__pyx_v_fwords); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_ni, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_v_ni, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_12) {
- __pyx_t_4 = PyNumber_Add(__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Add(__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = PyInt_FromLong(__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyInt_FromLong(__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_15 = __pyx_t_14;
} else {
@@ -44796,34 +44983,34 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
}
if (__pyx_t_15) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":869
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":887
* ni = i + spanlen
* if (ni < len(fwords) and (pathlen + 1) < self.max_initial_size):
* for na in range(len(fwords[ni])): # <<<<<<<<<<<<<<
* nf.append((toskip - 1, (ni, na, pathlen + 1)))
* if (len(nf) > 0):
*/
- __pyx_t_5 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ni); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ni); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_13 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_13; __pyx_t_16+=1) {
__pyx_v_na = __pyx_t_16;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":870
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":888
* if (ni < len(fwords) and (pathlen + 1) < self.max_initial_size):
* for na in range(len(fwords[ni])):
* nf.append((toskip - 1, (ni, na, pathlen + 1))) # <<<<<<<<<<<<<<
* if (len(nf) > 0):
* return self.advance(nf, res, fwords)
*/
- __pyx_t_5 = PyNumber_Subtract(__pyx_v_toskip, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyNumber_Subtract(__pyx_v_toskip, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = PyLong_FromUnsignedLong(__pyx_v_na); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyLong_FromUnsignedLong(__pyx_v_na); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = PyNumber_Add(__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Add(__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_INCREF(__pyx_v_ni);
PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_ni);
@@ -44834,7 +45021,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_6 = 0;
__pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 888; __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);
@@ -44842,7 +45029,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
__Pyx_GIVEREF(((PyObject *)__pyx_t_10));
__pyx_t_5 = 0;
__pyx_t_10 = 0;
- __pyx_t_17 = PyList_Append(__pyx_v_nf, ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = PyList_Append(__pyx_v_nf, ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
}
goto __pyx_L10;
@@ -44851,18 +45038,18 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":871
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":889
* for na in range(len(fwords[ni])):
* nf.append((toskip - 1, (ni, na, pathlen + 1)))
* if (len(nf) > 0): # <<<<<<<<<<<<<<
* return self.advance(nf, res, fwords)
* else:
*/
- __pyx_t_2 = PyList_GET_SIZE(((PyObject *)__pyx_v_nf)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyList_GET_SIZE(((PyObject *)__pyx_v_nf)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_15 = (__pyx_t_2 > 0);
if (__pyx_t_15) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":872
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":890
* nf.append((toskip - 1, (ni, na, pathlen + 1)))
* if (len(nf) > 0):
* return self.advance(nf, res, fwords) # <<<<<<<<<<<<<<
@@ -44870,9 +45057,9 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
* return res
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__advance); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__advance); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(((PyObject *)__pyx_v_nf));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_nf));
@@ -44883,7 +45070,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
__Pyx_INCREF(__pyx_v_fwords);
PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_fwords);
__Pyx_GIVEREF(__pyx_v_fwords);
- __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
@@ -44894,7 +45081,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":874
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":892
* return self.advance(nf, res, fwords)
* else:
* return res # <<<<<<<<<<<<<<
@@ -44972,36 +45159,36 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_15get_all_nodes_isteps_
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__spanlen)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pathlen)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fwords)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__next_states)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__reachable_buffer)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 6); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 6); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_all_nodes_isteps_away") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_all_nodes_isteps_away") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
goto __pyx_L5_argtuple_error;
@@ -45024,7 +45211,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_15get_all_nodes_isteps_
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.HieroCachingRuleFactory.get_all_nodes_isteps_away", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -45035,7 +45222,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_15get_all_nodes_isteps_
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":876
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":894
* return res
*
* def get_all_nodes_isteps_away(self, skip, i, spanlen, pathlen, fwords, next_states, reachable_buffer): # <<<<<<<<<<<<<<
@@ -45073,41 +45260,41 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_all_nodes_isteps_away", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":878
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":896
* def get_all_nodes_isteps_away(self, skip, i, spanlen, pathlen, fwords, next_states, reachable_buffer):
* cdef unsigned alt_it
* frontier = [] # <<<<<<<<<<<<<<
* if (i+spanlen+skip >= len(next_states)):
* return frontier
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_frontier = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":879
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":897
* cdef unsigned alt_it
* frontier = []
* if (i+spanlen+skip >= len(next_states)): # <<<<<<<<<<<<<<
* return frontier
* key = tuple([i,spanlen])
*/
- __pyx_t_1 = PyNumber_Add(__pyx_v_i, __pyx_v_spanlen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Add(__pyx_v_i, __pyx_v_spanlen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_skip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_skip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_3 = PyObject_Length(__pyx_v_next_states); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Length(__pyx_v_next_states); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":880
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":898
* frontier = []
* if (i+spanlen+skip >= len(next_states)):
* return frontier # <<<<<<<<<<<<<<
@@ -45122,14 +45309,14 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":881
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":899
* if (i+spanlen+skip >= len(next_states)):
* return frontier
* key = tuple([i,spanlen]) # <<<<<<<<<<<<<<
* reachable = []
* if (key in reachable_buffer):
*/
- __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_i);
PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_i);
@@ -45137,42 +45324,42 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
__Pyx_INCREF(__pyx_v_spanlen);
PyList_SET_ITEM(__pyx_t_4, 1, __pyx_v_spanlen);
__Pyx_GIVEREF(__pyx_v_spanlen);
- __pyx_t_1 = ((PyObject *)PyList_AsTuple(__pyx_t_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = ((PyObject *)PyList_AsTuple(__pyx_t_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__pyx_v_key = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":882
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":900
* return frontier
* key = tuple([i,spanlen])
* reachable = [] # <<<<<<<<<<<<<<
* if (key in reachable_buffer):
* reachable = reachable_buffer[key]
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_reachable = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":883
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":901
* key = tuple([i,spanlen])
* reachable = []
* if (key in reachable_buffer): # <<<<<<<<<<<<<<
* reachable = reachable_buffer[key]
* else:
*/
- __pyx_t_5 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_v_key), __pyx_v_reachable_buffer, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_v_key), __pyx_v_reachable_buffer, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":884
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":902
* reachable = []
* if (key in reachable_buffer):
* reachable = reachable_buffer[key] # <<<<<<<<<<<<<<
* else:
* reachable = self.reachable(fwords, i, spanlen)
*/
- __pyx_t_1 = PyObject_GetItem(__pyx_v_reachable_buffer, ((PyObject *)__pyx_v_key)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetItem(__pyx_v_reachable_buffer, ((PyObject *)__pyx_v_key)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_v_reachable);
__pyx_v_reachable = __pyx_t_1;
@@ -45181,16 +45368,16 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":886
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":904
* reachable = reachable_buffer[key]
* else:
* reachable = self.reachable(fwords, i, spanlen) # <<<<<<<<<<<<<<
* reachable_buffer[key] = reachable
* for nextreachable in reachable:
*/
- __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__reachable); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__reachable); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_fwords);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_fwords);
@@ -45201,7 +45388,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
__Pyx_INCREF(__pyx_v_spanlen);
PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_spanlen);
__Pyx_GIVEREF(__pyx_v_spanlen);
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
@@ -45209,18 +45396,18 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
__pyx_v_reachable = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":887
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":905
* else:
* reachable = self.reachable(fwords, i, spanlen)
* reachable_buffer[key] = reachable # <<<<<<<<<<<<<<
* for nextreachable in reachable:
* for next_id in next_states[nextreachable]:
*/
- if (PyObject_SetItem(__pyx_v_reachable_buffer, ((PyObject *)__pyx_v_key), __pyx_v_reachable) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_v_reachable_buffer, ((PyObject *)__pyx_v_key), __pyx_v_reachable) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":888
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":906
* reachable = self.reachable(fwords, i, spanlen)
* reachable_buffer[key] = reachable
* for nextreachable in reachable: # <<<<<<<<<<<<<<
@@ -45231,7 +45418,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
__pyx_t_2 = __pyx_v_reachable; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
__pyx_t_6 = NULL;
} else {
- __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_reachable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_reachable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext;
}
@@ -45239,23 +45426,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_2)) {
if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_2)) {
if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_6(__pyx_t_2);
if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -45265,20 +45452,20 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
__pyx_v_nextreachable = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":889
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":907
* reachable_buffer[key] = reachable
* for nextreachable in reachable:
* for next_id in next_states[nextreachable]: # <<<<<<<<<<<<<<
* jump = self.shortest(fwords,i,next_id)
* if jump < skip:
*/
- __pyx_t_4 = PyObject_GetItem(__pyx_v_next_states, __pyx_v_nextreachable); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetItem(__pyx_v_next_states, __pyx_v_nextreachable); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
__pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
} else {
- __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -45287,23 +45474,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_8(__pyx_t_1);
if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -45313,16 +45500,16 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
__pyx_v_next_id = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":890
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":908
* for nextreachable in reachable:
* for next_id in next_states[nextreachable]:
* jump = self.shortest(fwords,i,next_id) # <<<<<<<<<<<<<<
* if jump < skip:
* continue
*/
- __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__shortest); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__shortest); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_INCREF(__pyx_v_fwords);
PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_fwords);
@@ -45333,7 +45520,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
__Pyx_INCREF(__pyx_v_next_id);
PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_next_id);
__Pyx_GIVEREF(__pyx_v_next_id);
- __pyx_t_10 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
@@ -45341,19 +45528,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
__pyx_v_jump = __pyx_t_10;
__pyx_t_10 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":891
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":909
* for next_id in next_states[nextreachable]:
* jump = self.shortest(fwords,i,next_id)
* if jump < skip: # <<<<<<<<<<<<<<
* continue
* if pathlen+jump <= self.max_initial_size:
*/
- __pyx_t_10 = PyObject_RichCompare(__pyx_v_jump, __pyx_v_skip, Py_LT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_RichCompare(__pyx_v_jump, __pyx_v_skip, Py_LT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":892
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":910
* jump = self.shortest(fwords,i,next_id)
* if jump < skip:
* continue # <<<<<<<<<<<<<<
@@ -45365,50 +45552,50 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
}
__pyx_L9:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":893
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":911
* if jump < skip:
* continue
* if pathlen+jump <= self.max_initial_size: # <<<<<<<<<<<<<<
* for alt_id in range(len(fwords[next_id])):
* if (fwords[next_id][alt_id][0] != EPSILON):
*/
- __pyx_t_10 = PyNumber_Add(__pyx_v_pathlen, __pyx_v_jump); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyNumber_Add(__pyx_v_pathlen, __pyx_v_jump); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_9 = PyInt_FromLong(__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyInt_FromLong(__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_4 = PyObject_RichCompare(__pyx_t_10, __pyx_t_9, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_t_10, __pyx_t_9, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":894
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":912
* continue
* if pathlen+jump <= self.max_initial_size:
* for alt_id in range(len(fwords[next_id])): # <<<<<<<<<<<<<<
* if (fwords[next_id][alt_id][0] != EPSILON):
* newel = (next_id,alt_id,pathlen+jump)
*/
- __pyx_t_4 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_next_id); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_next_id); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_11 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
__pyx_t_9 = __pyx_t_4; __Pyx_INCREF(__pyx_t_9); __pyx_t_11 = 0;
__pyx_t_12 = NULL;
} else {
- __pyx_t_11 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_12 = Py_TYPE(__pyx_t_9)->tp_iternext;
}
@@ -45417,23 +45604,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_9)) {
if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_9)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_9, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_9, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_9)) {
if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_9, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_9, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_12(__pyx_t_9);
if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -45443,40 +45630,40 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
__pyx_v_alt_id = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":895
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":913
* if pathlen+jump <= self.max_initial_size:
* for alt_id in range(len(fwords[next_id])):
* if (fwords[next_id][alt_id][0] != EPSILON): # <<<<<<<<<<<<<<
* newel = (next_id,alt_id,pathlen+jump)
* if newel not in frontier:
*/
- __pyx_t_4 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_next_id); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_next_id); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_10 = PyObject_GetItem(__pyx_t_4, __pyx_v_alt_id); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_GetItem(__pyx_t_4, __pyx_v_alt_id); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_10, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_10, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_13 = PyObject_RichCompare(__pyx_t_4, __pyx_t_10, Py_NE); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyObject_RichCompare(__pyx_t_4, __pyx_t_10, Py_NE); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":896
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":914
* for alt_id in range(len(fwords[next_id])):
* if (fwords[next_id][alt_id][0] != EPSILON):
* newel = (next_id,alt_id,pathlen+jump) # <<<<<<<<<<<<<<
* if newel not in frontier:
* frontier.append((next_id,alt_id,pathlen+jump))
*/
- __pyx_t_13 = PyNumber_Add(__pyx_v_pathlen, __pyx_v_jump); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyNumber_Add(__pyx_v_pathlen, __pyx_v_jump); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_13);
- __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_INCREF(__pyx_v_next_id);
PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_next_id);
@@ -45491,26 +45678,26 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
__pyx_v_newel = __pyx_t_10;
__pyx_t_10 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":897
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":915
* if (fwords[next_id][alt_id][0] != EPSILON):
* newel = (next_id,alt_id,pathlen+jump)
* if newel not in frontier: # <<<<<<<<<<<<<<
* frontier.append((next_id,alt_id,pathlen+jump))
* return frontier
*/
- __pyx_t_5 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_v_newel), ((PyObject *)__pyx_v_frontier), Py_NE)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_v_newel), ((PyObject *)__pyx_v_frontier), Py_NE)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":898
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":916
* newel = (next_id,alt_id,pathlen+jump)
* if newel not in frontier:
* frontier.append((next_id,alt_id,pathlen+jump)) # <<<<<<<<<<<<<<
* return frontier
*
*/
- __pyx_t_10 = PyNumber_Add(__pyx_v_pathlen, __pyx_v_jump); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyNumber_Add(__pyx_v_pathlen, __pyx_v_jump); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_13);
__Pyx_INCREF(__pyx_v_next_id);
PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_next_id);
@@ -45521,7 +45708,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_10);
__Pyx_GIVEREF(__pyx_t_10);
__pyx_t_10 = 0;
- __pyx_t_14 = PyList_Append(__pyx_v_frontier, ((PyObject *)__pyx_t_13)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyList_Append(__pyx_v_frontier, ((PyObject *)__pyx_t_13)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
goto __pyx_L14;
}
@@ -45540,7 +45727,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":899
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":917
* if newel not in frontier:
* frontier.append((next_id,alt_id,pathlen+jump))
* return frontier # <<<<<<<<<<<<<<
@@ -45607,16 +45794,16 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_17reachable(PyObject *_
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ifrom)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("reachable", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("reachable", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dist)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("reachable", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("reachable", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reachable") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reachable") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
@@ -45631,7 +45818,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_17reachable(PyObject *_
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("reachable", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("reachable", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.HieroCachingRuleFactory.reachable", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -45642,7 +45829,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_17reachable(PyObject *_
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":901
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":919
* return frontier
*
* def reachable(self, fwords, ifrom, dist): # <<<<<<<<<<<<<<
@@ -45672,35 +45859,35 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("reachable", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":902
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":920
*
* def reachable(self, fwords, ifrom, dist):
* ret = [] # <<<<<<<<<<<<<<
* if (ifrom >= len(fwords)):
* return ret
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ret = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":903
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":921
* def reachable(self, fwords, ifrom, dist):
* ret = []
* if (ifrom >= len(fwords)): # <<<<<<<<<<<<<<
* return ret
* for alt_id in range(len(fwords[ifrom])):
*/
- __pyx_t_2 = PyObject_Length(__pyx_v_fwords); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Length(__pyx_v_fwords); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_ifrom, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_RichCompare(__pyx_v_ifrom, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":904
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":922
* ret = []
* if (ifrom >= len(fwords)):
* return ret # <<<<<<<<<<<<<<
@@ -45715,32 +45902,32 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":905
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":923
* if (ifrom >= len(fwords)):
* return ret
* for alt_id in range(len(fwords[ifrom])): # <<<<<<<<<<<<<<
* if (fwords[ifrom][alt_id][0] == EPSILON):
* ret.extend(self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist))
*/
- __pyx_t_3 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
__pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
__pyx_t_5 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -45749,23 +45936,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py
if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_3 = __pyx_t_5(__pyx_t_1);
if (unlikely(!__pyx_t_3)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -45775,53 +45962,53 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py
__pyx_v_alt_id = __pyx_t_3;
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":906
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":924
* return ret
* for alt_id in range(len(fwords[ifrom])):
* if (fwords[ifrom][alt_id][0] == EPSILON): # <<<<<<<<<<<<<<
* ret.extend(self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist))
* else:
*/
- __pyx_t_3 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = PyObject_GetItem(__pyx_t_3, __pyx_v_alt_id); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_GetItem(__pyx_t_3, __pyx_v_alt_id); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":907
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":925
* for alt_id in range(len(fwords[ifrom])):
* if (fwords[ifrom][alt_id][0] == EPSILON):
* ret.extend(self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist)) # <<<<<<<<<<<<<<
* else:
* if (dist==0):
*/
- __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_v_ret), __pyx_n_s__extend); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_v_ret), __pyx_n_s__extend); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__reachable); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__reachable); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_8 = PyObject_GetItem(__pyx_t_3, __pyx_v_alt_id); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_GetItem(__pyx_t_3, __pyx_v_alt_id); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_8, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_8, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyNumber_Add(__pyx_v_ifrom, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyNumber_Add(__pyx_v_ifrom, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_fwords);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_fwords);
@@ -45832,16 +46019,16 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_dist);
__Pyx_GIVEREF(__pyx_v_dist);
__pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_8);
__pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
@@ -45850,36 +46037,36 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":909
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":927
* ret.extend(self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist))
* else:
* if (dist==0): # <<<<<<<<<<<<<<
* if (ifrom not in ret):
* ret.append(ifrom)
*/
- __pyx_t_8 = PyObject_RichCompare(__pyx_v_dist, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_RichCompare(__pyx_v_dist, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":910
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":928
* else:
* if (dist==0):
* if (ifrom not in ret): # <<<<<<<<<<<<<<
* ret.append(ifrom)
* else:
*/
- __pyx_t_4 = (__Pyx_PySequence_Contains(__pyx_v_ifrom, ((PyObject *)__pyx_v_ret), Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = (__Pyx_PySequence_Contains(__pyx_v_ifrom, ((PyObject *)__pyx_v_ret), Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":911
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":929
* if (dist==0):
* if (ifrom not in ret):
* ret.append(ifrom) # <<<<<<<<<<<<<<
* else:
* for ifromchild in self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist-1):
*/
- __pyx_t_9 = PyList_Append(__pyx_v_ret, __pyx_v_ifrom); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyList_Append(__pyx_v_ret, __pyx_v_ifrom); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L8;
}
__pyx_L8:;
@@ -45887,29 +46074,29 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":913
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":931
* ret.append(ifrom)
* else:
* for ifromchild in self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist-1): # <<<<<<<<<<<<<<
* if (ifromchild not in ret):
* ret.append(ifromchild)
*/
- __pyx_t_8 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__reachable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__reachable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_3 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_7 = PyObject_GetItem(__pyx_t_3, __pyx_v_alt_id); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_GetItem(__pyx_t_3, __pyx_v_alt_id); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_7, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_7, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = PyNumber_Add(__pyx_v_ifrom, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyNumber_Add(__pyx_v_ifrom, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_Subtract(__pyx_v_dist, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Subtract(__pyx_v_dist, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(__pyx_v_fwords);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_fwords);
@@ -45920,7 +46107,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_7 = 0;
__pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
@@ -45928,7 +46115,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py
__pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6); __pyx_t_10 = 0;
__pyx_t_11 = NULL;
} else {
- __pyx_t_10 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext;
}
@@ -45937,23 +46124,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py
if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_6)) {
if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_6)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_6)) {
if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_3 = __pyx_t_11(__pyx_t_6);
if (unlikely(!__pyx_t_3)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -45963,24 +46150,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py
__pyx_v_ifromchild = __pyx_t_3;
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":914
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":932
* else:
* for ifromchild in self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist-1):
* if (ifromchild not in ret): # <<<<<<<<<<<<<<
* ret.append(ifromchild)
*
*/
- __pyx_t_4 = (__Pyx_PySequence_Contains(__pyx_v_ifromchild, ((PyObject *)__pyx_v_ret), Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = (__Pyx_PySequence_Contains(__pyx_v_ifromchild, ((PyObject *)__pyx_v_ret), Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":915
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":933
* for ifromchild in self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist-1):
* if (ifromchild not in ret):
* ret.append(ifromchild) # <<<<<<<<<<<<<<
*
* return ret
*/
- __pyx_t_9 = PyList_Append(__pyx_v_ret, __pyx_v_ifromchild); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyList_Append(__pyx_v_ret, __pyx_v_ifromchild); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L11;
}
__pyx_L11:;
@@ -45993,7 +46180,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":917
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":935
* ret.append(ifromchild)
*
* return ret # <<<<<<<<<<<<<<
@@ -46054,16 +46241,16 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_19shortest(PyObject *__
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ifrom)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("shortest", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("shortest", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ito)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("shortest", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("shortest", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shortest") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shortest") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
@@ -46078,7 +46265,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_19shortest(PyObject *__
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("shortest", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("shortest", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.HieroCachingRuleFactory.shortest", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -46089,7 +46276,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_19shortest(PyObject *__
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":919
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":937
* return ret
*
* def shortest(self, fwords, ifrom, ito): # <<<<<<<<<<<<<<
@@ -46114,7 +46301,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("shortest", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":921
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":939
* def shortest(self, fwords, ifrom, ito):
* cdef unsigned alt_id
* min = 1000 # <<<<<<<<<<<<<<
@@ -46124,19 +46311,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx
__Pyx_INCREF(__pyx_int_1000);
__pyx_v_min = __pyx_int_1000;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":922
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":940
* cdef unsigned alt_id
* min = 1000
* if (ifrom > ito): # <<<<<<<<<<<<<<
* return min
* if (ifrom == ito):
*/
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_ifrom, __pyx_v_ito, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_ifrom, __pyx_v_ito, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":923
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":941
* min = 1000
* if (ifrom > ito):
* return min # <<<<<<<<<<<<<<
@@ -46151,19 +46338,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":924
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":942
* if (ifrom > ito):
* return min
* if (ifrom == ito): # <<<<<<<<<<<<<<
* return 0
* for alt_id in range(len(fwords[ifrom])):
*/
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_ifrom, __pyx_v_ito, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_ifrom, __pyx_v_ito, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":925
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":943
* return min
* if (ifrom == ito):
* return 0 # <<<<<<<<<<<<<<
@@ -46178,41 +46365,41 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":926
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":944
* if (ifrom == ito):
* return 0
* for alt_id in range(len(fwords[ifrom])): # <<<<<<<<<<<<<<
* currmin = self.shortest(fwords,ifrom+fwords[ifrom][alt_id][2],ito)
* if (fwords[ifrom][alt_id][0] != EPSILON):
*/
- __pyx_t_1 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_alt_id = __pyx_t_4;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":927
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":945
* return 0
* for alt_id in range(len(fwords[ifrom])):
* currmin = self.shortest(fwords,ifrom+fwords[ifrom][alt_id][2],ito) # <<<<<<<<<<<<<<
* if (fwords[ifrom][alt_id][0] != EPSILON):
* currmin += 1
*/
- __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__shortest); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__shortest); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, __pyx_v_alt_id, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, __pyx_v_alt_id, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyNumber_Add(__pyx_v_ifrom, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyNumber_Add(__pyx_v_ifrom, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(__pyx_v_fwords);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_fwords);
@@ -46223,7 +46410,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_ito);
__Pyx_GIVEREF(__pyx_v_ito);
__pyx_t_6 = 0;
- __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
@@ -46231,38 +46418,38 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx
__pyx_v_currmin = __pyx_t_6;
__pyx_t_6 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":928
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":946
* for alt_id in range(len(fwords[ifrom])):
* currmin = self.shortest(fwords,ifrom+fwords[ifrom][alt_id][2],ito)
* if (fwords[ifrom][alt_id][0] != EPSILON): # <<<<<<<<<<<<<<
* currmin += 1
* if (currmin<min):
*/
- __pyx_t_6 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_alt_id, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_alt_id, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":929
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":947
* currmin = self.shortest(fwords,ifrom+fwords[ifrom][alt_id][2],ito)
* if (fwords[ifrom][alt_id][0] != EPSILON):
* currmin += 1 # <<<<<<<<<<<<<<
* if (currmin<min):
* min = currmin
*/
- __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_currmin, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_currmin, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_v_currmin);
__pyx_v_currmin = __pyx_t_1;
@@ -46271,19 +46458,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx
}
__pyx_L7:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":930
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":948
* if (fwords[ifrom][alt_id][0] != EPSILON):
* currmin += 1
* if (currmin<min): # <<<<<<<<<<<<<<
* min = currmin
* return min
*/
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_currmin, __pyx_v_min, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_currmin, __pyx_v_min, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":931
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":949
* currmin += 1
* if (currmin<min):
* min = currmin # <<<<<<<<<<<<<<
@@ -46298,7 +46485,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx
__pyx_L8:;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":932
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":950
* if (currmin<min):
* min = currmin
* return min # <<<<<<<<<<<<<<
@@ -46357,7 +46544,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_21get_next_states(PyObj
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__curr_idx)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("get_next_states", 0, 2, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("get_next_states", 0, 2, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (kw_args > 0) {
@@ -46366,7 +46553,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_21get_next_states(PyObj
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_next_states") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_next_states") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -46383,7 +46570,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_21get_next_states(PyObj
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("get_next_states", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("get_next_states", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.HieroCachingRuleFactory.get_next_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -46394,7 +46581,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_21get_next_states(PyObj
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":934
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":952
* return min
*
* def get_next_states(self, _columns, curr_idx, min_dist=2): # <<<<<<<<<<<<<<
@@ -46427,26 +46614,26 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_next_states", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":935
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":953
*
* def get_next_states(self, _columns, curr_idx, min_dist=2):
* result = [] # <<<<<<<<<<<<<<
* candidate = [[curr_idx,0]]
*
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_result = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":936
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":954
* def get_next_states(self, _columns, curr_idx, min_dist=2):
* result = []
* candidate = [[curr_idx,0]] # <<<<<<<<<<<<<<
*
* while len(candidate) > 0:
*/
- __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_curr_idx);
PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_curr_idx);
@@ -46454,7 +46641,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc
__Pyx_INCREF(__pyx_int_0);
PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_0);
__Pyx_GIVEREF(__pyx_int_0);
- __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
__Pyx_GIVEREF(((PyObject *)__pyx_t_1));
@@ -46462,7 +46649,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc
__pyx_v_candidate = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":938
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":956
* candidate = [[curr_idx,0]]
*
* while len(candidate) > 0: # <<<<<<<<<<<<<<
@@ -46470,43 +46657,43 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc
* if curr[0] >= len(_columns):
*/
while (1) {
- __pyx_t_3 = PyList_GET_SIZE(((PyObject *)__pyx_v_candidate)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_GET_SIZE(((PyObject *)__pyx_v_candidate)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_4 = (__pyx_t_3 > 0);
if (!__pyx_t_4) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":939
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":957
*
* while len(candidate) > 0:
* curr = candidate.pop() # <<<<<<<<<<<<<<
* if curr[0] >= len(_columns):
* continue
*/
- __pyx_t_2 = __Pyx_PyObject_Pop(((PyObject *)__pyx_v_candidate)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Pop(((PyObject *)__pyx_v_candidate)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_v_curr);
__pyx_v_curr = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":940
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":958
* while len(candidate) > 0:
* curr = candidate.pop()
* if curr[0] >= len(_columns): # <<<<<<<<<<<<<<
* continue
* if curr[0] not in result and min_dist <= curr[1] <= self.max_initial_size:
*/
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyObject_Length(__pyx_v__columns); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Length(__pyx_v__columns); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":941
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":959
* curr = candidate.pop()
* if curr[0] >= len(_columns):
* continue # <<<<<<<<<<<<<<
@@ -46518,30 +46705,30 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":942
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":960
* if curr[0] >= len(_columns):
* continue
* if curr[0] not in result and min_dist <= curr[1] <= self.max_initial_size: # <<<<<<<<<<<<<<
* result.append(curr[0]);
* curr_col = _columns[curr[0]]
*/
- __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = (__Pyx_PySequence_Contains(__pyx_t_5, ((PyObject *)__pyx_v_result), Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = (__Pyx_PySequence_Contains(__pyx_t_5, ((PyObject *)__pyx_v_result), Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_4) {
- __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_curr, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_curr, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_min_dist, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_min_dist, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__Pyx_PyObject_IsTrue(__pyx_t_1)) {
__Pyx_DECREF(__pyx_t_1);
- __pyx_t_2 = PyInt_FromLong(__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong(__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_7 = __pyx_t_6;
} else {
@@ -46549,38 +46736,38 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc
}
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":943
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":961
* continue
* if curr[0] not in result and min_dist <= curr[1] <= self.max_initial_size:
* result.append(curr[0]); # <<<<<<<<<<<<<<
* curr_col = _columns[curr[0]]
* for alt in curr_col:
*/
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_8 = PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L6;
}
__pyx_L6:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":944
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":962
* if curr[0] not in result and min_dist <= curr[1] <= self.max_initial_size:
* result.append(curr[0]);
* curr_col = _columns[curr[0]] # <<<<<<<<<<<<<<
* for alt in curr_col:
* next_id = curr[0]+alt[2]
*/
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyObject_GetItem(__pyx_v__columns, __pyx_t_1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_GetItem(__pyx_v__columns, __pyx_t_1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_v_curr_col);
__pyx_v_curr_col = __pyx_t_5;
__pyx_t_5 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":945
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":963
* result.append(curr[0]);
* curr_col = _columns[curr[0]]
* for alt in curr_col: # <<<<<<<<<<<<<<
@@ -46591,7 +46778,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc
__pyx_t_5 = __pyx_v_curr_col; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0;
__pyx_t_9 = NULL;
} else {
- __pyx_t_3 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_curr_col); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_curr_col); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext;
}
@@ -46599,23 +46786,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc
if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_5)) {
if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_5)) {
if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_1 = __pyx_t_9(__pyx_t_5);
if (unlikely(!__pyx_t_1)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -46625,18 +46812,18 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc
__pyx_v_alt = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":946
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":964
* curr_col = _columns[curr[0]]
* for alt in curr_col:
* next_id = curr[0]+alt[2] # <<<<<<<<<<<<<<
* jump = 1
* if (alt[0] == EPSILON):
*/
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_alt, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_alt, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_10 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -46644,7 +46831,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc
__pyx_v_next_id = __pyx_t_10;
__pyx_t_10 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":947
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":965
* for alt in curr_col:
* next_id = curr[0]+alt[2]
* jump = 1 # <<<<<<<<<<<<<<
@@ -46655,25 +46842,25 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc
__Pyx_XDECREF(__pyx_v_jump);
__pyx_v_jump = __pyx_int_1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":948
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":966
* next_id = curr[0]+alt[2]
* jump = 1
* if (alt[0] == EPSILON): # <<<<<<<<<<<<<<
* jump = 0
* if next_id not in result and min_dist <= curr[1]+jump <= self.max_initial_size+1:
*/
- __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_alt, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_alt, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_2 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_10, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_10, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":949
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":967
* jump = 1
* if (alt[0] == EPSILON):
* jump = 0 # <<<<<<<<<<<<<<
@@ -46687,30 +46874,30 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc
}
__pyx_L9:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":950
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":968
* if (alt[0] == EPSILON):
* jump = 0
* if next_id not in result and min_dist <= curr[1]+jump <= self.max_initial_size+1: # <<<<<<<<<<<<<<
* candidate.append([next_id,curr[1]+jump])
* return sorted(result);
*/
- __pyx_t_7 = (__Pyx_PySequence_Contains(__pyx_v_next_id, ((PyObject *)__pyx_v_result), Py_NE)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = (__Pyx_PySequence_Contains(__pyx_v_next_id, ((PyObject *)__pyx_v_result), Py_NE)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_7) {
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_jump); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_jump); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_min_dist, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_min_dist, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__Pyx_PyObject_IsTrue(__pyx_t_1)) {
__Pyx_DECREF(__pyx_t_1);
- __pyx_t_10 = PyInt_FromLong((__pyx_v_self->max_initial_size + 1)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyInt_FromLong((__pyx_v_self->max_initial_size + 1)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_10, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_10, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_6 = __pyx_t_4;
} else {
@@ -46718,19 +46905,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc
}
if (__pyx_t_6) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":951
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":969
* jump = 0
* if next_id not in result and min_dist <= curr[1]+jump <= self.max_initial_size+1:
* candidate.append([next_id,curr[1]+jump]) # <<<<<<<<<<<<<<
* return sorted(result);
*
*/
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_jump); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_jump); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_next_id);
PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_next_id);
@@ -46738,7 +46925,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc
PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_2 = 0;
- __pyx_t_8 = PyList_Append(__pyx_v_candidate, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyList_Append(__pyx_v_candidate, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
goto __pyx_L10;
}
@@ -46748,7 +46935,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc
__pyx_L3_continue:;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":952
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":970
* 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); # <<<<<<<<<<<<<<
@@ -46756,12 +46943,12 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc
* def input(self, fwords, meta):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(((PyObject *)__pyx_v_result));
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_result));
__Pyx_GIVEREF(((PyObject *)__pyx_v_result));
- __pyx_t_1 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
__pyx_r = __pyx_t_1;
@@ -46820,11 +47007,11 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_23input(PyObject *__pyx
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__meta)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("input", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("input", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "input") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "input") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
@@ -46837,7 +47024,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_23input(PyObject *__pyx
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("input", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("input", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.HieroCachingRuleFactory.input", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -46872,7 +47059,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_5input_7lambda4_lambda5
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1114
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1137
* if len(extracts) > 0:
* fcount = Counter()
* fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list))) # <<<<<<<<<<<<<<
@@ -46891,14 +47078,14 @@ static PyObject *__pyx_lambda_funcdef_lambda5(CYTHON_UNUSED PyObject *__pyx_self
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("lambda5", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)((PyObject*)(&PyList_Type))));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyList_Type))));
__Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyList_Type))));
- __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
@@ -46931,16 +47118,16 @@ static PyObject *__pyx_lambda_funcdef_lambda4(CYTHON_UNUSED PyObject *__pyx_self
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("lambda4", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_5input_7lambda4_lambda5, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_5input_7lambda4_lambda5, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
@@ -46974,7 +47161,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_5input_1lambda6(PyObjec
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1120
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1143
* for f, elist in fphrases.iteritems():
* for e, alslist in elist.iteritems():
* alignment, max_locs = max(alslist.iteritems(), key=lambda x: len(x[1])) # <<<<<<<<<<<<<<
@@ -46992,11 +47179,11 @@ static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("lambda6", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -47013,8 +47200,153 @@ static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
+static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_5input_4generator14(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1182
+ * # Online rule extraction and scoring
+ * if self.online:
+ * f_syms = tuple(word[0][0] for word in fwords) # <<<<<<<<<<<<<<
+ * for (f, lex_i, lex_j) in self.get_f_phrases(f_syms):
+ * spanlen = (lex_j - lex_i) + 1
+ */
+
+static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_5input_2genexpr(PyObject *__pyx_self) {
+ struct __pyx_obj_3_sa___pyx_scope_struct_20_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_3_sa___pyx_scope_struct_20_genexpr *)__pyx_ptype_3_sa___pyx_scope_struct_20_genexpr->tp_new(__pyx_ptype_3_sa___pyx_scope_struct_20_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_3_sa___pyx_scope_struct_19_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_3_sa_23HieroCachingRuleFactory_5input_4generator14, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_cur_scope);
+ __Pyx_RefNannyFinishContext();
+ return (PyObject *) gen;
+ }
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":954
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.input.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_5input_4generator14(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+{
+ struct __pyx_obj_3_sa___pyx_scope_struct_20_genexpr *__pyx_cur_scope = ((struct __pyx_obj_3_sa___pyx_scope_struct_20_genexpr *)__pyx_generator->closure);
+ PyObject *__pyx_r = NULL;
+ PyObject *__pyx_t_1 = NULL;
+ Py_ssize_t __pyx_t_2;
+ PyObject *(*__pyx_t_3)(PyObject *);
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("None", 0);
+ switch (__pyx_generator->resume_label) {
+ case 0: goto __pyx_L3_first_run;
+ case 1: goto __pyx_L6_resume_from_yield;
+ default: /* CPython raises the right error here */
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ }
+ __pyx_L3_first_run:;
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_fwords)) { __Pyx_RaiseClosureNameError("fwords"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_fwords) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_fwords)) {
+ __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_fwords; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
+ __pyx_t_3 = NULL;
+ } else {
+ __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_fwords); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
+ }
+ for (;;) {
+ if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
+ if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
+ if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ } else {
+ __pyx_t_4 = __pyx_t_3(__pyx_t_1);
+ if (unlikely(!__pyx_t_4)) {
+ if (PyErr_Occurred()) {
+ if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ break;
+ }
+ __Pyx_GOTREF(__pyx_t_4);
+ }
+ __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_word);
+ __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_word);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_cur_scope->__pyx_v_word = __pyx_t_4;
+ __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_word, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_r = __pyx_t_5;
+ __pyx_t_5 = 0;
+ __Pyx_XGIVEREF(__pyx_t_1);
+ __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
+ __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
+ __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ /* return from generator, yielding value */
+ __pyx_generator->resume_label = 1;
+ return __pyx_r;
+ __pyx_L6_resume_from_yield:;
+ __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
+ __pyx_cur_scope->__pyx_t_0 = 0;
+ __Pyx_XGOTREF(__pyx_t_1);
+ __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
+ __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ PyErr_SetNone(PyExc_StopIteration);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("genexpr", __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;
+}
+
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":972
* return sorted(result);
*
* def input(self, fwords, meta): # <<<<<<<<<<<<<<
@@ -47046,7 +47378,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_22input(struct __pyx_ob
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_meta);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_meta);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -47068,8 +47400,8 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
{
struct __pyx_obj_3_sa___pyx_scope_struct_19_input *__pyx_cur_scope = ((struct __pyx_obj_3_sa___pyx_scope_struct_19_input *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
- Py_ssize_t __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_1 = NULL;
+ Py_ssize_t __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
Py_ssize_t __pyx_t_5;
@@ -47096,29 +47428,34 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
Py_ssize_t __pyx_t_26;
int __pyx_t_27;
int __pyx_t_28;
+ PyObject *(*__pyx_t_29)(PyObject *);
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("None", 0);
switch (__pyx_generator->resume_label) {
case 0: goto __pyx_L3_first_run;
- case 1: goto __pyx_L60_resume_from_yield;
+ case 1: goto __pyx_L61_resume_from_yield;
+ case 2: goto __pyx_L82_resume_from_yield;
default: /* CPython raises the right error here */
__Pyx_RefNannyFinishContext();
return NULL;
}
__pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":965
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":983
* cdef Phrase hiero_phrase
*
* flen = len(fwords) # <<<<<<<<<<<<<<
* start_time = monitor_cpu()
* self.extract_time = 0.0
*/
- __pyx_t_1 = PyObject_Length(__pyx_cur_scope->__pyx_v_fwords); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_cur_scope->__pyx_v_flen = __pyx_t_1;
+ __pyx_t_1 = __pyx_cur_scope->__pyx_v_fwords;
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_cur_scope->__pyx_v_flen = __pyx_t_2;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":966
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":984
*
* flen = len(fwords)
* start_time = monitor_cpu() # <<<<<<<<<<<<<<
@@ -47127,7 +47464,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
*/
__pyx_cur_scope->__pyx_v_start_time = __pyx_f_3_sa_monitor_cpu();
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":967
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":985
* flen = len(fwords)
* start_time = monitor_cpu()
* self.extract_time = 0.0 # <<<<<<<<<<<<<<
@@ -47136,20 +47473,20 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
*/
__pyx_cur_scope->__pyx_v_self->extract_time = 0.0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":968
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":986
* start_time = monitor_cpu()
* self.extract_time = 0.0
* nodes_isteps_away_buffer = {} # <<<<<<<<<<<<<<
* hit = 0
* reachable_buffer = {}
*/
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_2));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
- __pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer = __pyx_t_2;
- __pyx_t_2 = 0;
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
+ __pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer = __pyx_t_1;
+ __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":969
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":987
* self.extract_time = 0.0
* nodes_isteps_away_buffer = {}
* hit = 0 # <<<<<<<<<<<<<<
@@ -47158,131 +47495,147 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
*/
__pyx_cur_scope->__pyx_v_hit = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":970
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":988
* nodes_isteps_away_buffer = {}
* hit = 0
* reachable_buffer = {} # <<<<<<<<<<<<<<
*
+ * # Phrase pairs processed by suffix array extractor. Do not re-extract
+ */
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
+ __pyx_cur_scope->__pyx_v_reachable_buffer = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":993
+ * # during online extraction. This is probably the hackiest part of
+ * # online grammar extraction.
+ * seen_phrases = set() # <<<<<<<<<<<<<<
+ *
* # Do not cache between sentences
*/
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_2));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
- __pyx_cur_scope->__pyx_v_reachable_buffer = __pyx_t_2;
- __pyx_t_2 = 0;
+ __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
+ __pyx_cur_scope->__pyx_v_seen_phrases = __pyx_t_1;
+ __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":973
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":996
*
* # Do not cache between sentences
* self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation()) # <<<<<<<<<<<<<<
*
* frontier = []
*/
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_2));
- __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+ __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_GIVEREF(__pyx_t_3);
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->rules->root);
__Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->rules->root);
__pyx_cur_scope->__pyx_v_self->rules->root = __pyx_t_3;
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":975
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":998
* self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation())
*
* frontier = [] # <<<<<<<<<<<<<<
* for i in range(len(fwords)):
* for alt in range(0, len(fwords[i])):
*/
- __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(((PyObject *)__pyx_t_3));
__pyx_cur_scope->__pyx_v_frontier = __pyx_t_3;
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":976
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":999
*
* frontier = []
* for i in range(len(fwords)): # <<<<<<<<<<<<<<
* for alt in range(0, len(fwords[i])):
* if fwords[i][alt][0] != EPSILON:
*/
- __pyx_t_1 = PyObject_Length(__pyx_cur_scope->__pyx_v_fwords); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) {
+ __pyx_t_3 = __pyx_cur_scope->__pyx_v_fwords;
+ __Pyx_INCREF(__pyx_t_3);
+ __pyx_t_2 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_2; __pyx_t_4+=1) {
__pyx_cur_scope->__pyx_v_i = __pyx_t_4;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":977
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1000
* frontier = []
* for i in range(len(fwords)):
* for alt in range(0, len(fwords[i])): # <<<<<<<<<<<<<<
* if fwords[i][alt][0] != EPSILON:
* frontier.append((i, i, (i,), alt, 0, self.rules.root, (), False))
*/
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
__pyx_cur_scope->__pyx_v_alt = __pyx_t_6;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":978
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1001
* for i in range(len(fwords)):
* for alt in range(0, len(fwords[i])):
* if fwords[i][alt][0] != EPSILON: # <<<<<<<<<<<<<<
* frontier.append((i, i, (i,), alt, 0, self.rules.root, (), False))
*
*/
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (__pyx_t_8) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":979
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1002
* for alt in range(0, len(fwords[i])):
* if fwords[i][alt][0] != EPSILON:
* frontier.append((i, i, (i,), alt, 0, self.rules.root, (), False)) # <<<<<<<<<<<<<<
*
* xroot = None
*/
- __pyx_t_7 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_10 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_11 = PyTuple_New(8); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyTuple_New(8); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7);
__Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_11, 2, ((PyObject *)__pyx_t_9));
__Pyx_GIVEREF(((PyObject *)__pyx_t_9));
PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_3);
@@ -47299,11 +47652,11 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
PyTuple_SET_ITEM(__pyx_t_11, 7, __pyx_t_10);
__Pyx_GIVEREF(__pyx_t_10);
__pyx_t_7 = 0;
- __pyx_t_2 = 0;
+ __pyx_t_1 = 0;
__pyx_t_9 = 0;
__pyx_t_3 = 0;
__pyx_t_10 = 0;
- __pyx_t_12 = PyList_Append(__pyx_cur_scope->__pyx_v_frontier, ((PyObject *)__pyx_t_11)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyList_Append(__pyx_cur_scope->__pyx_v_frontier, ((PyObject *)__pyx_t_11)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
goto __pyx_L8;
}
@@ -47311,7 +47664,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":981
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1004
* frontier.append((i, i, (i,), alt, 0, self.rules.root, (), False))
*
* xroot = None # <<<<<<<<<<<<<<
@@ -47322,7 +47675,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__Pyx_GIVEREF(Py_None);
__pyx_cur_scope->__pyx_v_xroot = Py_None;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":982
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1005
*
* xroot = None
* x1 = sym_setindex(self.category, 1) # <<<<<<<<<<<<<<
@@ -47331,32 +47684,32 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
*/
__pyx_cur_scope->__pyx_v_x1 = __pyx_f_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, 1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":983
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1006
* xroot = None
* x1 = sym_setindex(self.category, 1)
* if x1 in self.rules.root.children: # <<<<<<<<<<<<<<
* xroot = self.rules.root.children[x1]
* else:
*/
- __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_x1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_x1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s__children); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s__children); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_8 = (__Pyx_PySequence_Contains(__pyx_t_11, __pyx_t_10, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = (__Pyx_PySequence_Contains(__pyx_t_11, __pyx_t_10, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
if (__pyx_t_8) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":984
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1007
* x1 = sym_setindex(self.category, 1)
* if x1 in self.rules.root.children:
* xroot = self.rules.root.children[x1] # <<<<<<<<<<<<<<
* else:
* xroot = ExtendedTrieNode(suffix_link=self.rules.root, phrase_location=PhraseLocation())
*/
- __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s__children); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s__children); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_10, __pyx_cur_scope->__pyx_v_x1, sizeof(int), PyInt_FromLong); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_10, __pyx_cur_scope->__pyx_v_x1, sizeof(int), PyInt_FromLong); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_xroot);
@@ -47368,21 +47721,21 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":986
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1009
* xroot = self.rules.root.children[x1]
* else:
* xroot = ExtendedTrieNode(suffix_link=self.rules.root, phrase_location=PhraseLocation()) # <<<<<<<<<<<<<<
* self.rules.root.children[x1] = xroot
*
*/
- __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_11));
- if (PyDict_SetItem(__pyx_t_11, ((PyObject *)__pyx_n_s__suffix_link), __pyx_cur_scope->__pyx_v_self->rules->root) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_11, ((PyObject *)__pyx_n_s__suffix_link), __pyx_cur_scope->__pyx_v_self->rules->root) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- if (PyDict_SetItem(__pyx_t_11, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_11, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_11)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_11)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_xroot);
@@ -47391,101 +47744,104 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_xroot = __pyx_t_10;
__pyx_t_10 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":987
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1010
* else:
* xroot = ExtendedTrieNode(suffix_link=self.rules.root, phrase_location=PhraseLocation())
* self.rules.root.children[x1] = xroot # <<<<<<<<<<<<<<
*
* for i in range(self.min_gap_size, len(fwords)):
*/
- __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s__children); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s__children); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- if (__Pyx_SetItemInt(__pyx_t_10, __pyx_cur_scope->__pyx_v_x1, __pyx_cur_scope->__pyx_v_xroot, sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_t_10, __pyx_cur_scope->__pyx_v_x1, __pyx_cur_scope->__pyx_v_xroot, sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
}
__pyx_L9:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":989
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1012
* self.rules.root.children[x1] = xroot
*
* for i in range(self.min_gap_size, len(fwords)): # <<<<<<<<<<<<<<
* for alt in range(0, len(fwords[i])):
* if fwords[i][alt][0] != EPSILON:
*/
- __pyx_t_1 = PyObject_Length(__pyx_cur_scope->__pyx_v_fwords); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- for (__pyx_t_4 = __pyx_cur_scope->__pyx_v_self->min_gap_size; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) {
+ __pyx_t_10 = __pyx_cur_scope->__pyx_v_fwords;
+ __Pyx_INCREF(__pyx_t_10);
+ __pyx_t_2 = PyObject_Length(__pyx_t_10); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ for (__pyx_t_4 = __pyx_cur_scope->__pyx_v_self->min_gap_size; __pyx_t_4 < __pyx_t_2; __pyx_t_4+=1) {
__pyx_cur_scope->__pyx_v_i = __pyx_t_4;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":990
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1013
*
* for i in range(self.min_gap_size, len(fwords)):
* for alt in range(0, len(fwords[i])): # <<<<<<<<<<<<<<
* if fwords[i][alt][0] != EPSILON:
* frontier.append((i-self.min_gap_size, i, (i,), alt, self.min_gap_size, xroot, (x1,), True))
*/
- __pyx_t_10 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_5 = PyObject_Length(__pyx_t_10); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Length(__pyx_t_10); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
__pyx_cur_scope->__pyx_v_alt = __pyx_t_6;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":991
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1014
* for i in range(self.min_gap_size, len(fwords)):
* for alt in range(0, len(fwords[i])):
* if fwords[i][alt][0] != EPSILON: # <<<<<<<<<<<<<<
* frontier.append((i-self.min_gap_size, i, (i,), alt, self.min_gap_size, xroot, (x1,), True))
*
*/
- __pyx_t_10 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_10, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_10, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_11, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_11, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_3 = PyObject_RichCompare(__pyx_t_10, __pyx_t_11, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_RichCompare(__pyx_t_10, __pyx_t_11, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_8) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":992
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1015
* for alt in range(0, len(fwords[i])):
* if fwords[i][alt][0] != EPSILON:
* frontier.append((i-self.min_gap_size, i, (i,), alt, self.min_gap_size, xroot, (x1,), True)) # <<<<<<<<<<<<<<
*
* next_states = []
*/
- __pyx_t_3 = PyInt_FromLong((__pyx_cur_scope->__pyx_v_i - __pyx_cur_scope->__pyx_v_self->min_gap_size)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong((__pyx_cur_scope->__pyx_v_i - __pyx_cur_scope->__pyx_v_self->min_gap_size)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10);
__Pyx_GIVEREF(__pyx_t_10);
__pyx_t_10 = 0;
- __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_7 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_x1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_7 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_x1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_13);
PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_7);
__Pyx_GIVEREF(__pyx_t_7);
__pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_14 = PyTuple_New(8); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyTuple_New(8); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
@@ -47495,8 +47851,8 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__Pyx_GIVEREF(((PyObject *)__pyx_t_9));
PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_t_10);
__Pyx_GIVEREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_14, 4, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_14, 4, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_xroot);
PyTuple_SET_ITEM(__pyx_t_14, 5, __pyx_cur_scope->__pyx_v_xroot);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_xroot);
@@ -47508,10 +47864,10 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_t_11 = 0;
__pyx_t_9 = 0;
__pyx_t_10 = 0;
- __pyx_t_2 = 0;
+ __pyx_t_1 = 0;
__pyx_t_13 = 0;
__pyx_t_7 = 0;
- __pyx_t_12 = PyList_Append(__pyx_cur_scope->__pyx_v_frontier, ((PyObject *)__pyx_t_14)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyList_Append(__pyx_cur_scope->__pyx_v_frontier, ((PyObject *)__pyx_t_14)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
goto __pyx_L14;
}
@@ -47519,63 +47875,66 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":994
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1017
* frontier.append((i-self.min_gap_size, i, (i,), alt, self.min_gap_size, xroot, (x1,), True))
*
* next_states = [] # <<<<<<<<<<<<<<
* for i in range(len(fwords)):
* next_states.append(self.get_next_states(fwords,i,self.min_gap_size))
*/
- __pyx_t_14 = PyList_New(0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyList_New(0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_GIVEREF(((PyObject *)__pyx_t_14));
__pyx_cur_scope->__pyx_v_next_states = __pyx_t_14;
__pyx_t_14 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":995
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1018
*
* next_states = []
* for i in range(len(fwords)): # <<<<<<<<<<<<<<
* next_states.append(self.get_next_states(fwords,i,self.min_gap_size))
*
*/
- __pyx_t_1 = PyObject_Length(__pyx_cur_scope->__pyx_v_fwords); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_1; __pyx_t_4+=1) {
+ __pyx_t_14 = __pyx_cur_scope->__pyx_v_fwords;
+ __Pyx_INCREF(__pyx_t_14);
+ __pyx_t_2 = PyObject_Length(__pyx_t_14); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_2; __pyx_t_4+=1) {
__pyx_cur_scope->__pyx_v_i = __pyx_t_4;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":996
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1019
* next_states = []
* for i in range(len(fwords)):
* next_states.append(self.get_next_states(fwords,i,self.min_gap_size)) # <<<<<<<<<<<<<<
*
* while len(frontier) > 0:
*/
- __pyx_t_14 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__get_next_states); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__get_next_states); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
- __pyx_t_7 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_13 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_13);
- __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_fwords);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_fwords);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_fwords);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_fwords);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_7);
__Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_13);
+ PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_13);
__Pyx_GIVEREF(__pyx_t_13);
__pyx_t_7 = 0;
__pyx_t_13 = 0;
- __pyx_t_13 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_13);
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_12 = PyList_Append(__pyx_cur_scope->__pyx_v_next_states, __pyx_t_13); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+ __pyx_t_12 = PyList_Append(__pyx_cur_scope->__pyx_v_next_states, __pyx_t_13); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":998
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1021
* next_states.append(self.get_next_states(fwords,i,self.min_gap_size))
*
* while len(frontier) > 0: # <<<<<<<<<<<<<<
@@ -47583,18 +47942,18 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
* for k, i, input_match, alt, pathlen, node, prefix, is_shadow_path in frontier:
*/
while (1) {
- __pyx_t_1 = PyList_GET_SIZE(((PyObject *)__pyx_cur_scope->__pyx_v_frontier)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_8 = (__pyx_t_1 > 0);
+ __pyx_t_2 = PyList_GET_SIZE(((PyObject *)__pyx_cur_scope->__pyx_v_frontier)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = (__pyx_t_2 > 0);
if (!__pyx_t_8) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":999
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1022
*
* while len(frontier) > 0:
* new_frontier = [] # <<<<<<<<<<<<<<
* for k, i, input_match, alt, pathlen, node, prefix, is_shadow_path in frontier:
* word_id = fwords[i][alt][0]
*/
- __pyx_t_13 = PyList_New(0); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyList_New(0); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_13);
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_new_frontier));
__Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_new_frontier));
@@ -47602,23 +47961,23 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_new_frontier = __pyx_t_13;
__pyx_t_13 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1000
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1023
* while len(frontier) > 0:
* new_frontier = []
* for k, i, input_match, alt, pathlen, node, prefix, is_shadow_path in frontier: # <<<<<<<<<<<<<<
* word_id = fwords[i][alt][0]
* spanlen = fwords[i][alt][2]
*/
- __pyx_t_13 = ((PyObject *)__pyx_cur_scope->__pyx_v_frontier); __Pyx_INCREF(__pyx_t_13); __pyx_t_1 = 0;
+ __pyx_t_13 = ((PyObject *)__pyx_cur_scope->__pyx_v_frontier); __Pyx_INCREF(__pyx_t_13); __pyx_t_2 = 0;
for (;;) {
- if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_13)) break;
+ if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_13)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_1); __Pyx_INCREF(__pyx_t_2); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_13, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_13, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
- if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
- PyObject* sequence = __pyx_t_2;
+ if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
+ PyObject* sequence = __pyx_t_1;
#if CYTHON_COMPILING_IN_CPYTHON
Py_ssize_t size = Py_SIZE(sequence);
#else
@@ -47627,7 +47986,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
if (unlikely(size != 8)) {
if (size > 8) __Pyx_RaiseTooManyValuesError(8);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -47661,25 +48020,25 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
Py_ssize_t i;
PyObject** temps[8] = {&__pyx_t_14,&__pyx_t_7,&__pyx_t_10,&__pyx_t_9,&__pyx_t_11,&__pyx_t_3,&__pyx_t_15,&__pyx_t_16};
for (i=0; i < 8; i++) {
- PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
*(temps[i]) = item;
}
#endif
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
} else
{
Py_ssize_t index = -1;
PyObject** temps[8] = {&__pyx_t_14,&__pyx_t_7,&__pyx_t_10,&__pyx_t_9,&__pyx_t_11,&__pyx_t_3,&__pyx_t_15,&__pyx_t_16};
- __pyx_t_17 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_17);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_18 = Py_TYPE(__pyx_t_17)->tp_iternext;
for (index=0; index < 8; index++) {
PyObject* item = __pyx_t_18(__pyx_t_17); if (unlikely(!item)) goto __pyx_L21_unpacking_failed;
__Pyx_GOTREF(item);
*(temps[index]) = item;
}
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_18(__pyx_t_17), 8) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_18(__pyx_t_17), 8) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_18 = NULL;
__Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
goto __pyx_L22_unpacking_done;
@@ -47687,14 +48046,14 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
__pyx_t_18 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L22_unpacking_done:;
}
- __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_14); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_14); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_7); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_7); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_19 = __Pyx_PyInt_AsInt(__pyx_t_9); if (unlikely((__pyx_t_19 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_19 = __Pyx_PyInt_AsInt(__pyx_t_9); if (unlikely((__pyx_t_19 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_cur_scope->__pyx_v_k = __pyx_t_4;
__pyx_cur_scope->__pyx_v_i = __pyx_t_6;
@@ -47725,86 +48084,89 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_is_shadow_path = __pyx_t_16;
__pyx_t_16 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1001
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1024
* new_frontier = []
* for k, i, input_match, alt, pathlen, node, prefix, is_shadow_path in frontier:
* word_id = fwords[i][alt][0] # <<<<<<<<<<<<<<
* spanlen = fwords[i][alt][2]
* # TODO get rid of k -- pathlen is replacing it
*/
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_2, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong); if (!__pyx_t_16) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_1, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong); if (!__pyx_t_16) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_16, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_16, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_word_id);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_word_id);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_cur_scope->__pyx_v_word_id = __pyx_t_2;
- __pyx_t_2 = 0;
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_cur_scope->__pyx_v_word_id = __pyx_t_1;
+ __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1002
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1025
* for k, i, input_match, alt, pathlen, node, prefix, is_shadow_path in frontier:
* word_id = fwords[i][alt][0]
* spanlen = fwords[i][alt][2] # <<<<<<<<<<<<<<
* # TODO get rid of k -- pathlen is replacing it
* if word_id == EPSILON:
*/
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_2, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong); if (!__pyx_t_16) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_1, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong); if (!__pyx_t_16) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_16, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_16, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_spanlen);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_spanlen);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_cur_scope->__pyx_v_spanlen = __pyx_t_2;
- __pyx_t_2 = 0;
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_cur_scope->__pyx_v_spanlen = __pyx_t_1;
+ __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1004
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1027
* spanlen = fwords[i][alt][2]
* # TODO get rid of k -- pathlen is replacing it
* if word_id == EPSILON: # <<<<<<<<<<<<<<
* # skipping because word_id is epsilon
* if i+spanlen >= len(fwords):
*/
- __pyx_t_2 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_16 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_16); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_16 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_16); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
if (__pyx_t_8) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1006
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1029
* if word_id == EPSILON:
* # skipping because word_id is epsilon
* if i+spanlen >= len(fwords): # <<<<<<<<<<<<<<
* continue
* for nualt in range(0,len(fwords[i+spanlen])):
*/
- __pyx_t_16 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
- __pyx_t_2 = PyNumber_Add(__pyx_t_16, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = PyNumber_Add(__pyx_t_16, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __pyx_t_16 = __pyx_cur_scope->__pyx_v_fwords;
+ __Pyx_INCREF(__pyx_t_16);
+ __pyx_t_5 = PyObject_Length(__pyx_t_16); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __pyx_t_5 = PyObject_Length(__pyx_cur_scope->__pyx_v_fwords); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_16 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
- __pyx_t_15 = PyObject_RichCompare(__pyx_t_2, __pyx_t_16, Py_GE); __Pyx_XGOTREF(__pyx_t_15); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_15 = PyObject_RichCompare(__pyx_t_1, __pyx_t_16, Py_GE); __Pyx_XGOTREF(__pyx_t_15); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
if (__pyx_t_8) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1007
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1030
* # skipping because word_id is epsilon
* if i+spanlen >= len(fwords):
* continue # <<<<<<<<<<<<<<
@@ -47816,48 +48178,48 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
__pyx_L24:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1008
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1031
* if i+spanlen >= len(fwords):
* continue
* for nualt in range(0,len(fwords[i+spanlen])): # <<<<<<<<<<<<<<
* frontier.append((k, i+spanlen, input_match, nualt, pathlen, node, prefix, is_shadow_path))
* continue
*/
- __pyx_t_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_16 = PyNumber_Add(__pyx_t_15, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PyNumber_Add(__pyx_t_15, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_15 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fwords, __pyx_t_16); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fwords, __pyx_t_16); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __pyx_t_5 = PyObject_Length(__pyx_t_15); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Length(__pyx_t_15); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_5; __pyx_t_19+=1) {
__pyx_cur_scope->__pyx_v_nualt = __pyx_t_19;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1009
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1032
* continue
* for nualt in range(0,len(fwords[i+spanlen])):
* frontier.append((k, i+spanlen, input_match, nualt, pathlen, node, prefix, is_shadow_path)) # <<<<<<<<<<<<<<
* continue
*
*/
- __pyx_t_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_16 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
- __pyx_t_2 = PyNumber_Add(__pyx_t_16, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = PyNumber_Add(__pyx_t_16, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __pyx_t_16 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_nualt); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_nualt); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
- __pyx_t_3 = PyTuple_New(8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_15);
__Pyx_GIVEREF(__pyx_t_15);
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_input_match);
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_cur_scope->__pyx_v_input_match);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_input_match);
@@ -47876,13 +48238,13 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
PyTuple_SET_ITEM(__pyx_t_3, 7, __pyx_cur_scope->__pyx_v_is_shadow_path);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_is_shadow_path);
__pyx_t_15 = 0;
- __pyx_t_2 = 0;
+ __pyx_t_1 = 0;
__pyx_t_16 = 0;
- __pyx_t_12 = PyList_Append(__pyx_cur_scope->__pyx_v_frontier, ((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyList_Append(__pyx_cur_scope->__pyx_v_frontier, ((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1010
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1033
* for nualt in range(0,len(fwords[i+spanlen])):
* frontier.append((k, i+spanlen, input_match, nualt, pathlen, node, prefix, is_shadow_path))
* continue # <<<<<<<<<<<<<<
@@ -47894,19 +48256,19 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
__pyx_L23:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1012
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1035
* continue
*
* phrase = prefix + (word_id,) # <<<<<<<<<<<<<<
* hiero_phrase = Phrase(phrase)
* arity = hiero_phrase.arity()
*/
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_word_id);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_word_id);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_word_id);
- __pyx_t_16 = PyNumber_Add(__pyx_cur_scope->__pyx_v_prefix, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PyNumber_Add(__pyx_cur_scope->__pyx_v_prefix, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_phrase);
@@ -47915,19 +48277,19 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_phrase = __pyx_t_16;
__pyx_t_16 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1013
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1036
*
* phrase = prefix + (word_id,)
* hiero_phrase = Phrase(phrase) # <<<<<<<<<<<<<<
* arity = hiero_phrase.arity()
*
*/
- __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_phrase);
PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_cur_scope->__pyx_v_phrase);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_phrase);
- __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0;
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase));
@@ -47936,23 +48298,23 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_hiero_phrase = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1014
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1037
* phrase = prefix + (word_id,)
* hiero_phrase = Phrase(phrase)
* arity = hiero_phrase.arity() # <<<<<<<<<<<<<<
*
* lookup_required = False
*/
- __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase), __pyx_n_s__arity); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase), __pyx_n_s__arity); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_16 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_19 = __Pyx_PyInt_AsInt(__pyx_t_16); if (unlikely((__pyx_t_19 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_19 = __Pyx_PyInt_AsInt(__pyx_t_16); if (unlikely((__pyx_t_19 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
__pyx_cur_scope->__pyx_v_arity = __pyx_t_19;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1016
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1039
* arity = hiero_phrase.arity()
*
* lookup_required = False # <<<<<<<<<<<<<<
@@ -47961,36 +48323,36 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
*/
__pyx_cur_scope->__pyx_v_lookup_required = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1017
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1040
*
* lookup_required = False
* if word_id in node.children: # <<<<<<<<<<<<<<
* if node.children[word_id] is None:
* # Path dead-ends at this node
*/
- __pyx_t_16 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
- __pyx_t_8 = (__Pyx_PySequence_Contains(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_16, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = (__Pyx_PySequence_Contains(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_16, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
if (__pyx_t_8) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1018
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1041
* lookup_required = False
* if word_id in node.children:
* if node.children[word_id] is None: # <<<<<<<<<<<<<<
* # Path dead-ends at this node
* continue
*/
- __pyx_t_16 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
- __pyx_t_3 = PyObject_GetItem(__pyx_t_16, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_t_16, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
__pyx_t_8 = (__pyx_t_3 == Py_None);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_8) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1020
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1043
* if node.children[word_id] is None:
* # Path dead-ends at this node
* continue # <<<<<<<<<<<<<<
@@ -48002,16 +48364,16 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1023
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1046
* else:
* # Path continues at this node
* node = node.children[word_id] # <<<<<<<<<<<<<<
* else:
* if node.suffix_link is None:
*/
- __pyx_t_3 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_16 = PyObject_GetItem(__pyx_t_3, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_16) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PyObject_GetItem(__pyx_t_3, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_16) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_node);
@@ -48025,20 +48387,20 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1025
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1048
* node = node.children[word_id]
* else:
* if node.suffix_link is None: # <<<<<<<<<<<<<<
* # Current node is root; lookup required
* lookup_required = True
*/
- __pyx_t_16 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
__pyx_t_8 = (__pyx_t_16 == Py_None);
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
if (__pyx_t_8) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1027
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1050
* if node.suffix_link is None:
* # Current node is root; lookup required
* lookup_required = True # <<<<<<<<<<<<<<
@@ -48050,54 +48412,54 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1029
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1052
* lookup_required = True
* else:
* if word_id in node.suffix_link.children: # <<<<<<<<<<<<<<
* if node.suffix_link.children[word_id] is None:
* # Suffix link reports path is dead end
*/
- __pyx_t_16 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
- __pyx_t_3 = PyObject_GetAttr(__pyx_t_16, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetAttr(__pyx_t_16, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __pyx_t_8 = (__Pyx_PySequence_Contains(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = (__Pyx_PySequence_Contains(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_8) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1030
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1053
* else:
* if word_id in node.suffix_link.children:
* if node.suffix_link.children[word_id] is None: # <<<<<<<<<<<<<<
* # Suffix link reports path is dead end
* node.children[word_id] = None
*/
- __pyx_t_3 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_16 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__children); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__children); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_GetItem(__pyx_t_16, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_t_16, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
__pyx_t_8 = (__pyx_t_3 == Py_None);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_8) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1032
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1055
* if node.suffix_link.children[word_id] is None:
* # Suffix link reports path is dead end
* node.children[word_id] = None # <<<<<<<<<<<<<<
* continue
* else:
*/
- __pyx_t_3 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- if (PyObject_SetItem(__pyx_t_3, __pyx_cur_scope->__pyx_v_word_id, Py_None) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_t_3, __pyx_cur_scope->__pyx_v_word_id, Py_None) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1033
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1056
* # Suffix link reports path is dead end
* node.children[word_id] = None
* continue # <<<<<<<<<<<<<<
@@ -48109,7 +48471,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1036
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1059
* else:
* # Suffix link indicates lookup is reqired
* lookup_required = True # <<<<<<<<<<<<<<
@@ -48123,18 +48485,18 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1039
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1062
* else:
* #ERROR: We never get here
* raise Exception("Keyword trie error") # <<<<<<<<<<<<<<
* # checking whether lookup_required
* if lookup_required:
*/
- __pyx_t_3 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_122), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_122), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_L30:;
}
@@ -48142,7 +48504,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
__pyx_L27:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1041
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1064
* raise Exception("Keyword trie error")
* # checking whether lookup_required
* if lookup_required: # <<<<<<<<<<<<<<
@@ -48151,7 +48513,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
*/
if (__pyx_cur_scope->__pyx_v_lookup_required) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1042
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1065
* # checking whether lookup_required
* if lookup_required:
* new_node = None # <<<<<<<<<<<<<<
@@ -48164,78 +48526,78 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__Pyx_GIVEREF(Py_None);
__pyx_cur_scope->__pyx_v_new_node = Py_None;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1043
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1066
* if lookup_required:
* new_node = None
* if is_shadow_path: # <<<<<<<<<<<<<<
* # Extending shadow path
* # on the shadow path we don't do any search, we just use info from suffix link
*/
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_8) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1046
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1069
* # Extending shadow path
* # on the shadow path we don't do any search, we just use info from suffix link
* new_node = ExtendedTrieNode(phrase_location=node.suffix_link.children[word_id].phrase_location, # <<<<<<<<<<<<<<
* suffix_link=node.suffix_link.children[word_id],
* phrase=hiero_phrase)
*/
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
- __pyx_t_16 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
- __pyx_t_2 = PyObject_GetAttr(__pyx_t_16, __pyx_n_s__children); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = PyObject_GetAttr(__pyx_t_16, __pyx_n_s__children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __pyx_t_16 = PyObject_GetItem(__pyx_t_2, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_16) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PyObject_GetItem(__pyx_t_1, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_16) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_GetAttr(__pyx_t_16, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = PyObject_GetAttr(__pyx_t_16, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1047
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1070
* # on the shadow path we don't do any search, we just use info from suffix link
* new_node = ExtendedTrieNode(phrase_location=node.suffix_link.children[word_id].phrase_location,
* suffix_link=node.suffix_link.children[word_id], # <<<<<<<<<<<<<<
* phrase=hiero_phrase)
* else:
*/
- __pyx_t_2 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_16 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__children); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_16 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__children); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_GetItem(__pyx_t_16, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = PyObject_GetItem(__pyx_t_16, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__suffix_link), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__suffix_link), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1048
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1071
* new_node = ExtendedTrieNode(phrase_location=node.suffix_link.children[word_id].phrase_location,
* suffix_link=node.suffix_link.children[word_id],
* phrase=hiero_phrase) # <<<<<<<<<<<<<<
* else:
* if arity > 0:
*/
- if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__phrase), ((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__phrase), ((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_new_node);
__Pyx_DECREF(__pyx_cur_scope->__pyx_v_new_node);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_cur_scope->__pyx_v_new_node = __pyx_t_2;
- __pyx_t_2 = 0;
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_cur_scope->__pyx_v_new_node = __pyx_t_1;
+ __pyx_t_1 = 0;
goto __pyx_L33;
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1050
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1073
* phrase=hiero_phrase)
* else:
* if arity > 0: # <<<<<<<<<<<<<<
@@ -48245,24 +48607,24 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_t_8 = (__pyx_cur_scope->__pyx_v_arity > 0);
if (__pyx_t_8) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1052
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1075
* if arity > 0:
* # Intersecting because of arity > 0
* phrase_location = self.intersect(node, node.suffix_link.children[word_id], hiero_phrase) # <<<<<<<<<<<<<<
* else:
* # Suffix array search
*/
- __pyx_t_2 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_GetItem(__pyx_t_3, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = PyObject_GetItem(__pyx_t_3, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->intersect(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_node, __pyx_t_2, __pyx_cur_scope->__pyx_v_hiero_phrase)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->intersect(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_node, __pyx_t_1, __pyx_cur_scope->__pyx_v_hiero_phrase)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location));
__Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location));
__Pyx_GIVEREF(__pyx_t_3);
@@ -48272,59 +48634,59 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1055
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1078
* else:
* # Suffix array search
* phrase_location = node.phrase_location # <<<<<<<<<<<<<<
* sa_range = self.fsa.lookup(sym_tostring(phrase[-1]), len(phrase)-1, phrase_location.sa_low, phrase_location.sa_high)
* if sa_range is not None:
*/
- __pyx_t_3 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location));
__Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location));
__Pyx_GIVEREF(__pyx_t_3);
__pyx_cur_scope->__pyx_v_phrase_location = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1056
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1079
* # Suffix array search
* phrase_location = node.phrase_location
* sa_range = self.fsa.lookup(sym_tostring(phrase[-1]), len(phrase)-1, phrase_location.sa_low, phrase_location.sa_high) # <<<<<<<<<<<<<<
* if sa_range is not None:
* phrase_location = PhraseLocation(sa_low=sa_range[0], sa_high=sa_range[1])
*/
- __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self->fsa), __pyx_n_s__lookup); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self->fsa), __pyx_n_s__lookup); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_phrase, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_19 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_19 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_19)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_2));
- __pyx_t_5 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_16 = PyInt_FromSsize_t((__pyx_t_5 - 1)); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_phrase, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_19 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_19 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_19)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+ __pyx_t_5 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PyInt_FromSsize_t((__pyx_t_5 - 1)); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
- __pyx_t_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_phrase_location->sa_low); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_phrase_location->sa_low); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_phrase_location->sa_high); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_phrase_location->sa_high); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_9 = PyTuple_New(4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyTuple_New(4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_2));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
+ PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_1));
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_16);
__Pyx_GIVEREF(__pyx_t_16);
PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_15);
__Pyx_GIVEREF(__pyx_t_15);
PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_11);
__Pyx_GIVEREF(__pyx_t_11);
- __pyx_t_2 = 0;
+ __pyx_t_1 = 0;
__pyx_t_16 = 0;
__pyx_t_15 = 0;
__pyx_t_11 = 0;
- __pyx_t_11 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
@@ -48334,7 +48696,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_sa_range = __pyx_t_11;
__pyx_t_11 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1057
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1080
* 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: # <<<<<<<<<<<<<<
@@ -48344,24 +48706,24 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_t_8 = (__pyx_cur_scope->__pyx_v_sa_range != Py_None);
if (__pyx_t_8) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1058
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1081
* sa_range = self.fsa.lookup(sym_tostring(phrase[-1]), len(phrase)-1, phrase_location.sa_low, phrase_location.sa_high)
* if sa_range is not None:
* phrase_location = PhraseLocation(sa_low=sa_range[0], sa_high=sa_range[1]) # <<<<<<<<<<<<<<
* else:
* phrase_location = None
*/
- __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_11));
- __pyx_t_9 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_sa_range, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_sa_range, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
- if (PyDict_SetItem(__pyx_t_11, ((PyObject *)__pyx_n_s__sa_low), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_11, ((PyObject *)__pyx_n_s__sa_low), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_sa_range, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_sa_range, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
- if (PyDict_SetItem(__pyx_t_11, ((PyObject *)__pyx_n_s__sa_high), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_11, ((PyObject *)__pyx_n_s__sa_high), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_11)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_11)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
__Pyx_GOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location));
@@ -48373,7 +48735,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1060
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1083
* phrase_location = PhraseLocation(sa_low=sa_range[0], sa_high=sa_range[1])
* else:
* phrase_location = None # <<<<<<<<<<<<<<
@@ -48390,7 +48752,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
__pyx_L34:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1062
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1085
* phrase_location = None
*
* if phrase_location is None: # <<<<<<<<<<<<<<
@@ -48400,19 +48762,19 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_t_8 = (((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location) == Py_None);
if (__pyx_t_8) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1063
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1086
*
* if phrase_location is None:
* node.children[word_id] = None # <<<<<<<<<<<<<<
* # Search failed
* continue
*/
- __pyx_t_9 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
- if (PyObject_SetItem(__pyx_t_9, __pyx_cur_scope->__pyx_v_word_id, Py_None) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_t_9, __pyx_cur_scope->__pyx_v_word_id, Py_None) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1065
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1088
* node.children[word_id] = None
* # Search failed
* continue # <<<<<<<<<<<<<<
@@ -48424,7 +48786,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
__pyx_L36:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1067
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1090
* continue
* # Search succeeded
* suffix_link = self.rules.root # <<<<<<<<<<<<<<
@@ -48437,32 +48799,32 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self->rules->root);
__pyx_cur_scope->__pyx_v_suffix_link = __pyx_cur_scope->__pyx_v_self->rules->root;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1068
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1091
* # Search succeeded
* suffix_link = self.rules.root
* if node.suffix_link is not None: # <<<<<<<<<<<<<<
* suffix_link = node.suffix_link.children[word_id]
* new_node = ExtendedTrieNode(phrase_location=phrase_location,
*/
- __pyx_t_9 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_8 = (__pyx_t_9 != Py_None);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
if (__pyx_t_8) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1069
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1092
* suffix_link = self.rules.root
* if node.suffix_link is not None:
* suffix_link = node.suffix_link.children[word_id] # <<<<<<<<<<<<<<
* new_node = ExtendedTrieNode(phrase_location=phrase_location,
* suffix_link=suffix_link,
*/
- __pyx_t_9 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_11 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__children); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__children); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyObject_GetItem(__pyx_t_11, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyObject_GetItem(__pyx_t_11, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_suffix_link);
@@ -48474,35 +48836,35 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
__pyx_L37:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1070
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1093
* if node.suffix_link is not None:
* suffix_link = node.suffix_link.children[word_id]
* new_node = ExtendedTrieNode(phrase_location=phrase_location, # <<<<<<<<<<<<<<
* suffix_link=suffix_link,
* phrase=hiero_phrase)
*/
- __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_9));
- if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__phrase_location), ((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__phrase_location), ((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1071
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1094
* suffix_link = node.suffix_link.children[word_id]
* new_node = ExtendedTrieNode(phrase_location=phrase_location,
* suffix_link=suffix_link, # <<<<<<<<<<<<<<
* phrase=hiero_phrase)
* node.children[word_id] = new_node
*/
- if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__suffix_link), __pyx_cur_scope->__pyx_v_suffix_link) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__suffix_link), __pyx_cur_scope->__pyx_v_suffix_link) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1072
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1095
* new_node = ExtendedTrieNode(phrase_location=phrase_location,
* suffix_link=suffix_link,
* phrase=hiero_phrase) # <<<<<<<<<<<<<<
* node.children[word_id] = new_node
* node = new_node
*/
- if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__phrase), ((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__phrase), ((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_new_node);
@@ -48513,19 +48875,19 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
__pyx_L33:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1073
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1096
* suffix_link=suffix_link,
* phrase=hiero_phrase)
* node.children[word_id] = new_node # <<<<<<<<<<<<<<
* node = new_node
*
*/
- __pyx_t_11 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- if (PyObject_SetItem(__pyx_t_11, __pyx_cur_scope->__pyx_v_word_id, __pyx_cur_scope->__pyx_v_new_node) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_t_11, __pyx_cur_scope->__pyx_v_word_id, __pyx_cur_scope->__pyx_v_new_node) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1074
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1097
* phrase=hiero_phrase)
* node.children[word_id] = new_node
* node = new_node # <<<<<<<<<<<<<<
@@ -48538,7 +48900,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_new_node);
__pyx_cur_scope->__pyx_v_node = __pyx_cur_scope->__pyx_v_new_node;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1079
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1102
* This should happen before we get to extraction (so that
* the node will exist if needed)'''
* if arity < self.max_nonterminals: # <<<<<<<<<<<<<<
@@ -48548,14 +48910,14 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_t_8 = (__pyx_cur_scope->__pyx_v_arity < __pyx_cur_scope->__pyx_v_self->max_nonterminals);
if (__pyx_t_8) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1080
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1103
* the node will exist if needed)'''
* if arity < self.max_nonterminals:
* xcat_index = arity+1 # <<<<<<<<<<<<<<
* xcat = sym_setindex(self.category, xcat_index)
* suffix_link_xcat_index = xcat_index
*/
- __pyx_t_11 = PyInt_FromLong((__pyx_cur_scope->__pyx_v_arity + 1)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyInt_FromLong((__pyx_cur_scope->__pyx_v_arity + 1)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_xcat_index);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_xcat_index);
@@ -48563,17 +48925,17 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_xcat_index = __pyx_t_11;
__pyx_t_11 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1081
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1104
* if arity < self.max_nonterminals:
* xcat_index = arity+1
* xcat = sym_setindex(self.category, xcat_index) # <<<<<<<<<<<<<<
* suffix_link_xcat_index = xcat_index
* if is_shadow_path:
*/
- __pyx_t_19 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_xcat_index); if (unlikely((__pyx_t_19 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_19 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_xcat_index); if (unlikely((__pyx_t_19 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_cur_scope->__pyx_v_xcat = __pyx_f_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_19);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1082
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1105
* xcat_index = arity+1
* xcat = sym_setindex(self.category, xcat_index)
* suffix_link_xcat_index = xcat_index # <<<<<<<<<<<<<<
@@ -48586,24 +48948,24 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_xcat_index);
__pyx_cur_scope->__pyx_v_suffix_link_xcat_index = __pyx_cur_scope->__pyx_v_xcat_index;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1083
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1106
* xcat = sym_setindex(self.category, xcat_index)
* suffix_link_xcat_index = xcat_index
* if is_shadow_path: # <<<<<<<<<<<<<<
* suffix_link_xcat_index = xcat_index-1
* suffix_link_xcat = sym_setindex(self.category, suffix_link_xcat_index)
*/
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_8) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1084
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1107
* suffix_link_xcat_index = xcat_index
* if is_shadow_path:
* suffix_link_xcat_index = xcat_index-1 # <<<<<<<<<<<<<<
* suffix_link_xcat = sym_setindex(self.category, suffix_link_xcat_index)
* node.children[xcat] = ExtendedTrieNode(phrase_location=node.phrase_location,
*/
- __pyx_t_11 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_xcat_index, __pyx_int_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_xcat_index, __pyx_int_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_suffix_link_xcat_index);
__Pyx_DECREF(__pyx_cur_scope->__pyx_v_suffix_link_xcat_index);
@@ -48614,159 +48976,159 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
__pyx_L39:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1085
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1108
* if is_shadow_path:
* suffix_link_xcat_index = xcat_index-1
* suffix_link_xcat = sym_setindex(self.category, suffix_link_xcat_index) # <<<<<<<<<<<<<<
* node.children[xcat] = ExtendedTrieNode(phrase_location=node.phrase_location,
* suffix_link=node.suffix_link.children[suffix_link_xcat],
*/
- __pyx_t_19 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_suffix_link_xcat_index); if (unlikely((__pyx_t_19 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_19 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_suffix_link_xcat_index); if (unlikely((__pyx_t_19 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_cur_scope->__pyx_v_suffix_link_xcat = __pyx_f_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_19);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1086
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1109
* suffix_link_xcat_index = xcat_index-1
* suffix_link_xcat = sym_setindex(self.category, suffix_link_xcat_index)
* node.children[xcat] = ExtendedTrieNode(phrase_location=node.phrase_location, # <<<<<<<<<<<<<<
* suffix_link=node.suffix_link.children[suffix_link_xcat],
* phrase= Phrase(phrase + (xcat,)))
*/
- __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_11));
- __pyx_t_9 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
- if (PyDict_SetItem(__pyx_t_11, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_11, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1087
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1110
* suffix_link_xcat = sym_setindex(self.category, suffix_link_xcat_index)
* node.children[xcat] = ExtendedTrieNode(phrase_location=node.phrase_location,
* suffix_link=node.suffix_link.children[suffix_link_xcat], # <<<<<<<<<<<<<<
* phrase= Phrase(phrase + (xcat,)))
*
*/
- __pyx_t_9 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_3 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_3, __pyx_cur_scope->__pyx_v_suffix_link_xcat, sizeof(int), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_3, __pyx_cur_scope->__pyx_v_suffix_link_xcat, sizeof(int), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyDict_SetItem(__pyx_t_11, ((PyObject *)__pyx_n_s__suffix_link), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_11, ((PyObject *)__pyx_n_s__suffix_link), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1088
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1111
* node.children[xcat] = ExtendedTrieNode(phrase_location=node.phrase_location,
* suffix_link=node.suffix_link.children[suffix_link_xcat],
* phrase= Phrase(phrase + (xcat,))) # <<<<<<<<<<<<<<
*
* # sample from range
*/
- __pyx_t_9 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_xcat); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_xcat); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_9);
__pyx_t_9 = 0;
- __pyx_t_9 = PyNumber_Add(__pyx_cur_scope->__pyx_v_phrase, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyNumber_Add(__pyx_cur_scope->__pyx_v_phrase, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_9);
__pyx_t_9 = 0;
- __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- if (PyDict_SetItem(__pyx_t_11, ((PyObject *)__pyx_n_s__phrase), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_11, ((PyObject *)__pyx_n_s__phrase), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_11)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_11)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1086
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1109
* suffix_link_xcat_index = xcat_index-1
* suffix_link_xcat = sym_setindex(self.category, suffix_link_xcat_index)
* node.children[xcat] = ExtendedTrieNode(phrase_location=node.phrase_location, # <<<<<<<<<<<<<<
* suffix_link=node.suffix_link.children[suffix_link_xcat],
* phrase= Phrase(phrase + (xcat,)))
*/
- __pyx_t_11 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- if (__Pyx_SetItemInt(__pyx_t_11, __pyx_cur_scope->__pyx_v_xcat, __pyx_t_9, sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_t_11, __pyx_cur_scope->__pyx_v_xcat, __pyx_t_9, sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L38;
}
__pyx_L38:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1091
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1114
*
* # sample from range
* if not is_shadow_path: # <<<<<<<<<<<<<<
* sample = self.sampler.sample(node.phrase_location)
* num_subpatterns = (<PhraseLocation> node.phrase_location).num_subpatterns
*/
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_20 = (!__pyx_t_8);
if (__pyx_t_20) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1092
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1115
* # sample from range
* if not is_shadow_path:
* sample = self.sampler.sample(node.phrase_location) # <<<<<<<<<<<<<<
* num_subpatterns = (<PhraseLocation> node.phrase_location).num_subpatterns
* chunklen = IntList(initial_len=num_subpatterns)
*/
- __pyx_t_9 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self->sampler), __pyx_n_s__sample); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self->sampler), __pyx_n_s__sample); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_11 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_11);
__Pyx_GIVEREF(__pyx_t_11);
__pyx_t_11 = 0;
- __pyx_t_11 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_sample));
__Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_sample));
__Pyx_GIVEREF(__pyx_t_11);
__pyx_cur_scope->__pyx_v_sample = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_11);
__pyx_t_11 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1093
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1116
* if not is_shadow_path:
* sample = self.sampler.sample(node.phrase_location)
* num_subpatterns = (<PhraseLocation> node.phrase_location).num_subpatterns # <<<<<<<<<<<<<<
* chunklen = IntList(initial_len=num_subpatterns)
* for j from 0 <= j < num_subpatterns:
*/
- __pyx_t_11 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__pyx_cur_scope->__pyx_v_num_subpatterns = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_11)->num_subpatterns;
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1094
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1117
* sample = self.sampler.sample(node.phrase_location)
* num_subpatterns = (<PhraseLocation> node.phrase_location).num_subpatterns
* chunklen = IntList(initial_len=num_subpatterns) # <<<<<<<<<<<<<<
* for j from 0 <= j < num_subpatterns:
* chunklen.arr[j] = hiero_phrase.chunklen(j)
*/
- __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_11));
- __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_num_subpatterns); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_num_subpatterns); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_t_11, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_11, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_11)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_11)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_chunklen));
@@ -48775,7 +49137,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_chunklen = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1095
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1118
* num_subpatterns = (<PhraseLocation> node.phrase_location).num_subpatterns
* chunklen = IntList(initial_len=num_subpatterns)
* for j from 0 <= j < num_subpatterns: # <<<<<<<<<<<<<<
@@ -48785,7 +49147,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_t_19 = __pyx_cur_scope->__pyx_v_num_subpatterns;
for (__pyx_cur_scope->__pyx_v_j = 0; __pyx_cur_scope->__pyx_v_j < __pyx_t_19; __pyx_cur_scope->__pyx_v_j++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1096
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1119
* chunklen = IntList(initial_len=num_subpatterns)
* for j from 0 <= j < num_subpatterns:
* chunklen.arr[j] = hiero_phrase.chunklen(j) # <<<<<<<<<<<<<<
@@ -48795,14 +49157,14 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
(__pyx_cur_scope->__pyx_v_chunklen->arr[__pyx_cur_scope->__pyx_v_j]) = ((struct __pyx_vtabstruct_3_sa_Phrase *)__pyx_cur_scope->__pyx_v_hiero_phrase->__pyx_vtab)->chunklen(__pyx_cur_scope->__pyx_v_hiero_phrase, __pyx_cur_scope->__pyx_v_j);
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1097
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1120
* for j from 0 <= j < num_subpatterns:
* chunklen.arr[j] = hiero_phrase.chunklen(j)
* extracts = [] # <<<<<<<<<<<<<<
* j = 0
* extract_start = monitor_cpu()
*/
- __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_extracts));
__Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_extracts));
@@ -48810,7 +49172,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_extracts = __pyx_t_3;
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1098
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1121
* chunklen.arr[j] = hiero_phrase.chunklen(j)
* extracts = []
* j = 0 # <<<<<<<<<<<<<<
@@ -48819,14 +49181,14 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
*/
__pyx_cur_scope->__pyx_v_j = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1099
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1122
* extracts = []
* j = 0
* extract_start = monitor_cpu() # <<<<<<<<<<<<<<
* while j < sample.len:
* extract = []
*/
- __pyx_t_3 = PyFloat_FromDouble(__pyx_f_3_sa_monitor_cpu()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyFloat_FromDouble(__pyx_f_3_sa_monitor_cpu()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_extract_start);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_extract_start);
@@ -48834,7 +49196,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_extract_start = __pyx_t_3;
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1100
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1123
* j = 0
* extract_start = monitor_cpu()
* while j < sample.len: # <<<<<<<<<<<<<<
@@ -48845,14 +49207,14 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_t_20 = (__pyx_cur_scope->__pyx_v_j < __pyx_cur_scope->__pyx_v_sample->len);
if (!__pyx_t_20) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1101
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1124
* extract_start = monitor_cpu()
* while j < sample.len:
* extract = [] # <<<<<<<<<<<<<<
*
* assign_matching(&matching, sample.arr, j, num_subpatterns, self.fda.sent_id.arr)
*/
- __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_extract);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_extract);
@@ -48860,7 +49222,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_extract = ((PyObject *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1103
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1126
* extract = []
*
* assign_matching(&matching, sample.arr, j, num_subpatterns, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -48869,21 +49231,21 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
*/
__pyx_f_3_sa_assign_matching((&__pyx_cur_scope->__pyx_v_matching), __pyx_cur_scope->__pyx_v_sample->arr, __pyx_cur_scope->__pyx_v_j, __pyx_cur_scope->__pyx_v_num_subpatterns, __pyx_cur_scope->__pyx_v_self->fda->sent_id->arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1104
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1127
*
* assign_matching(&matching, sample.arr, j, num_subpatterns, self.fda.sent_id.arr)
* loc = tuple(sample[j:j+num_subpatterns]) # <<<<<<<<<<<<<<
* extract = self.extract(hiero_phrase, &matching, chunklen.arr, num_subpatterns)
* extracts.extend([(e, loc) for e in extract])
*/
- __pyx_t_3 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_cur_scope->__pyx_v_sample), __pyx_cur_scope->__pyx_v_j, (__pyx_cur_scope->__pyx_v_j + __pyx_cur_scope->__pyx_v_num_subpatterns)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_cur_scope->__pyx_v_sample), __pyx_cur_scope->__pyx_v_j, (__pyx_cur_scope->__pyx_v_j + __pyx_cur_scope->__pyx_v_num_subpatterns)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_loc);
@@ -48892,14 +49254,14 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_loc = __pyx_t_3;
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1105
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1128
* assign_matching(&matching, sample.arr, j, num_subpatterns, self.fda.sent_id.arr)
* loc = tuple(sample[j:j+num_subpatterns])
* extract = self.extract(hiero_phrase, &matching, chunklen.arr, num_subpatterns) # <<<<<<<<<<<<<<
* extracts.extend([(e, loc) for e in extract])
* j = j + num_subpatterns
*/
- __pyx_t_3 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->extract(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_hiero_phrase, (&__pyx_cur_scope->__pyx_v_matching), __pyx_cur_scope->__pyx_v_chunklen->arr, __pyx_cur_scope->__pyx_v_num_subpatterns); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->extract(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_hiero_phrase, (&__pyx_cur_scope->__pyx_v_matching), __pyx_cur_scope->__pyx_v_chunklen->arr, __pyx_cur_scope->__pyx_v_num_subpatterns); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_extract);
__Pyx_DECREF(__pyx_cur_scope->__pyx_v_extract);
@@ -48907,22 +49269,22 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_extract = __pyx_t_3;
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1106
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1129
* loc = tuple(sample[j:j+num_subpatterns])
* extract = self.extract(hiero_phrase, &matching, chunklen.arr, num_subpatterns)
* extracts.extend([(e, loc) for e in extract]) # <<<<<<<<<<<<<<
* j = j + num_subpatterns
*
*/
- __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_extracts), __pyx_n_s__extend); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_extracts), __pyx_n_s__extend); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_extract) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_extract)) {
__pyx_t_9 = __pyx_cur_scope->__pyx_v_extract; __Pyx_INCREF(__pyx_t_9); __pyx_t_5 = 0;
__pyx_t_21 = NULL;
} else {
- __pyx_t_5 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_extract); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_extract); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_21 = Py_TYPE(__pyx_t_9)->tp_iternext;
}
@@ -48930,23 +49292,23 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
if (!__pyx_t_21 && PyList_CheckExact(__pyx_t_9)) {
if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_9)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_15 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_5); __Pyx_INCREF(__pyx_t_15); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_5); __Pyx_INCREF(__pyx_t_15); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_15 = PySequence_ITEM(__pyx_t_9, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PySequence_ITEM(__pyx_t_9, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_21 && PyTuple_CheckExact(__pyx_t_9)) {
if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_15 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_5); __Pyx_INCREF(__pyx_t_15); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_5); __Pyx_INCREF(__pyx_t_15); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_15 = PySequence_ITEM(__pyx_t_9, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PySequence_ITEM(__pyx_t_9, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_15 = __pyx_t_21(__pyx_t_9);
if (unlikely(!__pyx_t_15)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -48957,7 +49319,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__Pyx_GIVEREF(__pyx_t_15);
__pyx_cur_scope->__pyx_v_e = __pyx_t_15;
__pyx_t_15 = 0;
- __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_e);
PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_cur_scope->__pyx_v_e);
@@ -48965,23 +49327,23 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_loc);
PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_cur_scope->__pyx_v_loc);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_loc);
- if (unlikely(__Pyx_PyList_Append(__pyx_t_11, (PyObject*)__pyx_t_15))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_PyList_Append(__pyx_t_11, (PyObject*)__pyx_t_15))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
}
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_INCREF(((PyObject *)__pyx_t_11));
PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_11));
__Pyx_GIVEREF(((PyObject *)__pyx_t_11));
__Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
- __pyx_t_11 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1107
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1130
* extract = self.extract(hiero_phrase, &matching, chunklen.arr, num_subpatterns)
* extracts.extend([(e, loc) for e in extract])
* j = j + num_subpatterns # <<<<<<<<<<<<<<
@@ -48991,7 +49353,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_j = (__pyx_cur_scope->__pyx_v_j + __pyx_cur_scope->__pyx_v_num_subpatterns);
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1109
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1132
* j = j + num_subpatterns
*
* num_samples = sample.len/num_subpatterns # <<<<<<<<<<<<<<
@@ -49000,22 +49362,22 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
*/
if (unlikely(__pyx_cur_scope->__pyx_v_num_subpatterns == 0)) {
PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
else if (sizeof(int) == sizeof(long) && unlikely(__pyx_cur_scope->__pyx_v_num_subpatterns == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_cur_scope->__pyx_v_sample->len))) {
PyErr_Format(PyExc_OverflowError, "value too large to perform division");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_cur_scope->__pyx_v_num_samples = __Pyx_div_int(__pyx_cur_scope->__pyx_v_sample->len, __pyx_cur_scope->__pyx_v_num_subpatterns);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1110
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1133
*
* num_samples = sample.len/num_subpatterns
* extract_stop = monitor_cpu() # <<<<<<<<<<<<<<
* self.extract_time = self.extract_time + extract_stop - extract_start
* if len(extracts) > 0:
*/
- __pyx_t_11 = PyFloat_FromDouble(__pyx_f_3_sa_monitor_cpu()); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyFloat_FromDouble(__pyx_f_3_sa_monitor_cpu()); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_extract_stop);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_extract_stop);
@@ -49023,46 +49385,46 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_extract_stop = __pyx_t_11;
__pyx_t_11 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1111
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1134
* num_samples = sample.len/num_subpatterns
* extract_stop = monitor_cpu()
* self.extract_time = self.extract_time + extract_stop - extract_start # <<<<<<<<<<<<<<
* if len(extracts) > 0:
* fcount = Counter()
*/
- __pyx_t_11 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->extract_time); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->extract_time); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_9 = PyNumber_Add(__pyx_t_11, __pyx_cur_scope->__pyx_v_extract_stop); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyNumber_Add(__pyx_t_11, __pyx_cur_scope->__pyx_v_extract_stop); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = PyNumber_Subtract(__pyx_t_9, __pyx_cur_scope->__pyx_v_extract_start); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyNumber_Subtract(__pyx_t_9, __pyx_cur_scope->__pyx_v_extract_start); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_22 = __pyx_PyFloat_AsFloat(__pyx_t_11); if (unlikely((__pyx_t_22 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_22 = __pyx_PyFloat_AsFloat(__pyx_t_11); if (unlikely((__pyx_t_22 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_cur_scope->__pyx_v_self->extract_time = __pyx_t_22;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1112
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1135
* extract_stop = monitor_cpu()
* self.extract_time = self.extract_time + extract_stop - extract_start
* if len(extracts) > 0: # <<<<<<<<<<<<<<
* fcount = Counter()
* fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list)))
*/
- __pyx_t_5 = PyList_GET_SIZE(((PyObject *)__pyx_cur_scope->__pyx_v_extracts)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyList_GET_SIZE(((PyObject *)__pyx_cur_scope->__pyx_v_extracts)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_20 = (__pyx_t_5 > 0);
if (__pyx_t_20) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1113
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1136
* self.extract_time = self.extract_time + extract_stop - extract_start
* if len(extracts) > 0:
* fcount = Counter() # <<<<<<<<<<<<<<
* fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list)))
* for (f, e, count, als), loc in extracts:
*/
- __pyx_t_11 = __Pyx_GetName(__pyx_m, __pyx_n_s__Counter); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_GetName(__pyx_m, __pyx_n_s__Counter); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_9 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_fcount);
@@ -49071,23 +49433,23 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_fcount = __pyx_t_9;
__pyx_t_9 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1114
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1137
* if len(extracts) > 0:
* fcount = Counter()
* fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list))) # <<<<<<<<<<<<<<
* for (f, e, count, als), loc in extracts:
* fcount[f] += count
*/
- __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_11 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_5input_lambda4, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_5input_lambda4, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_11);
__Pyx_GIVEREF(__pyx_t_11);
__pyx_t_11 = 0;
- __pyx_t_11 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
@@ -49097,7 +49459,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_fphrases = __pyx_t_11;
__pyx_t_11 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1115
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1138
* fcount = Counter()
* fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list)))
* for (f, e, count, als), loc in extracts: # <<<<<<<<<<<<<<
@@ -49108,9 +49470,9 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
for (;;) {
if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_11)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_11, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_11, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
PyObject* sequence = __pyx_t_3;
@@ -49122,7 +49484,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -49135,14 +49497,14 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__Pyx_INCREF(__pyx_t_9);
__Pyx_INCREF(__pyx_t_15);
#else
- __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_15 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_16 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_18 = Py_TYPE(__pyx_t_16)->tp_iternext;
@@ -49150,7 +49512,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__Pyx_GOTREF(__pyx_t_9);
index = 1; __pyx_t_15 = __pyx_t_18(__pyx_t_16); if (unlikely(!__pyx_t_15)) goto __pyx_L50_unpacking_failed;
__Pyx_GOTREF(__pyx_t_15);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_18(__pyx_t_16), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_18(__pyx_t_16), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_18 = NULL;
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
goto __pyx_L51_unpacking_done;
@@ -49158,7 +49520,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
__pyx_t_18 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L51_unpacking_done:;
}
if ((likely(PyTuple_CheckExact(__pyx_t_9))) || (PyList_CheckExact(__pyx_t_9))) {
@@ -49171,29 +49533,29 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
if (unlikely(size != 4)) {
if (size > 4) __Pyx_RaiseTooManyValuesError(4);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_16 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
+ __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
__pyx_t_10 = PyTuple_GET_ITEM(sequence, 2);
__pyx_t_7 = PyTuple_GET_ITEM(sequence, 3);
} else {
__pyx_t_16 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
+ __pyx_t_1 = PyList_GET_ITEM(sequence, 1);
__pyx_t_10 = PyList_GET_ITEM(sequence, 2);
__pyx_t_7 = PyList_GET_ITEM(sequence, 3);
}
__Pyx_INCREF(__pyx_t_16);
- __Pyx_INCREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_10);
__Pyx_INCREF(__pyx_t_7);
#else
Py_ssize_t i;
- PyObject** temps[4] = {&__pyx_t_16,&__pyx_t_2,&__pyx_t_10,&__pyx_t_7};
+ PyObject** temps[4] = {&__pyx_t_16,&__pyx_t_1,&__pyx_t_10,&__pyx_t_7};
for (i=0; i < 4; i++) {
- PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
*(temps[i]) = item;
}
#endif
@@ -49201,8 +49563,8 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
} else
{
Py_ssize_t index = -1;
- PyObject** temps[4] = {&__pyx_t_16,&__pyx_t_2,&__pyx_t_10,&__pyx_t_7};
- __pyx_t_14 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyObject** temps[4] = {&__pyx_t_16,&__pyx_t_1,&__pyx_t_10,&__pyx_t_7};
+ __pyx_t_14 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_18 = Py_TYPE(__pyx_t_14)->tp_iternext;
@@ -49211,7 +49573,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__Pyx_GOTREF(item);
*(temps[index]) = item;
}
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_18(__pyx_t_14), 4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_18(__pyx_t_14), 4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_18 = NULL;
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
goto __pyx_L53_unpacking_done;
@@ -49219,7 +49581,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__pyx_t_18 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L53_unpacking_done:;
}
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_f);
@@ -49229,9 +49591,9 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_t_16 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_e);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_e);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_cur_scope->__pyx_v_e = __pyx_t_2;
- __pyx_t_2 = 0;
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_cur_scope->__pyx_v_e = __pyx_t_1;
+ __pyx_t_1 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_count);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_count);
__Pyx_GIVEREF(__pyx_t_10);
@@ -49248,7 +49610,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_loc = __pyx_t_15;
__pyx_t_15 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1116
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1139
* fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list)))
* for (f, e, count, als), loc in extracts:
* fcount[f] += count # <<<<<<<<<<<<<<
@@ -49257,38 +49619,38 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
*/
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
__pyx_t_3 = __pyx_cur_scope->__pyx_v_f;
- __pyx_t_15 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_t_3); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_t_3); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_t_15, __pyx_cur_scope->__pyx_v_count); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_t_15, __pyx_cur_scope->__pyx_v_count); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- if (PyObject_SetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_t_3, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_t_3, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1117
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1140
* for (f, e, count, als), loc in extracts:
* fcount[f] += count
* fphrases[f][e][als].append(loc) # <<<<<<<<<<<<<<
* for f, elist in fphrases.iteritems():
* for e, alslist in elist.iteritems():
*/
- __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fphrases, __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fphrases, __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_9 = PyObject_GetItem(__pyx_t_3, __pyx_cur_scope->__pyx_v_e); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyObject_GetItem(__pyx_t_3, __pyx_cur_scope->__pyx_v_e); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_GetItem(__pyx_t_9, __pyx_cur_scope->__pyx_v_als); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_t_9, __pyx_cur_scope->__pyx_v_als); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_cur_scope->__pyx_v_loc); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_cur_scope->__pyx_v_loc); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1118
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1141
* fcount[f] += count
* fphrases[f][e][als].append(loc)
* for f, elist in fphrases.iteritems(): # <<<<<<<<<<<<<<
@@ -49298,9 +49660,9 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_t_5 = 0;
if (unlikely(__pyx_cur_scope->__pyx_v_fphrases == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_t_9 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_fphrases, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_23), (&__pyx_t_19)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_fphrases, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_23), (&__pyx_t_19)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_11);
__pyx_t_11 = __pyx_t_9;
@@ -49308,7 +49670,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
while (1) {
__pyx_t_6 = __Pyx_dict_iter_next(__pyx_t_11, __pyx_t_23, &__pyx_t_5, &__pyx_t_9, &__pyx_t_3, NULL, __pyx_t_19);
if (unlikely(__pyx_t_6 == 0)) break;
- if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_GOTREF(__pyx_t_3);
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_f);
@@ -49322,7 +49684,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_elist = __pyx_t_3;
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1119
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1142
* fphrases[f][e][als].append(loc)
* for f, elist in fphrases.iteritems():
* for e, alslist in elist.iteritems(): # <<<<<<<<<<<<<<
@@ -49332,9 +49694,9 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_t_24 = 0;
if (unlikely(__pyx_cur_scope->__pyx_v_elist == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_t_9 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_elist, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_25), (&__pyx_t_6)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_elist, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_25), (&__pyx_t_6)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_3);
__pyx_t_3 = __pyx_t_9;
@@ -49342,7 +49704,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
while (1) {
__pyx_t_4 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_25, &__pyx_t_24, &__pyx_t_9, &__pyx_t_15, NULL, __pyx_t_6);
if (unlikely(__pyx_t_4 == 0)) break;
- if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_GOTREF(__pyx_t_15);
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_e);
@@ -49356,30 +49718,30 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_alslist = __pyx_t_15;
__pyx_t_15 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1120
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1143
* for f, elist in fphrases.iteritems():
* for e, alslist in elist.iteritems():
* alignment, max_locs = max(alslist.iteritems(), key=lambda x: len(x[1])) # <<<<<<<<<<<<<<
* locs = tuple(itertools.chain.from_iterable(alslist.itervalues()))
* count = len(locs)
*/
- __pyx_t_15 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_alslist, __pyx_n_s__iteritems); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_alslist, __pyx_n_s__iteritems); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_9 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_9);
__pyx_t_9 = 0;
- __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_9));
- __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_5input_1lambda6, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_5input_1lambda6, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
- if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__key), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__key), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_15), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_15), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
@@ -49393,7 +49755,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -49406,14 +49768,14 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__Pyx_INCREF(__pyx_t_9);
__Pyx_INCREF(__pyx_t_15);
#else
- __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_15 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_10 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_18 = Py_TYPE(__pyx_t_10)->tp_iternext;
@@ -49421,7 +49783,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__Pyx_GOTREF(__pyx_t_9);
index = 1; __pyx_t_15 = __pyx_t_18(__pyx_t_10); if (unlikely(!__pyx_t_15)) goto __pyx_L58_unpacking_failed;
__Pyx_GOTREF(__pyx_t_15);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_18(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_18(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_18 = NULL;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
goto __pyx_L59_unpacking_done;
@@ -49429,7 +49791,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_18 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L59_unpacking_done:;
}
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_alignment);
@@ -49443,41 +49805,41 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_max_locs = __pyx_t_15;
__pyx_t_15 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1121
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1144
* for e, alslist in elist.iteritems():
* alignment, max_locs = max(alslist.iteritems(), key=lambda x: len(x[1]))
* locs = tuple(itertools.chain.from_iterable(alslist.itervalues())) # <<<<<<<<<<<<<<
* count = len(locs)
* scores = self.scorer.score(FeatureContext(
*/
- __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__itertools); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__itertools); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_15 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__chain); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__chain); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = PyObject_GetAttr(__pyx_t_15, __pyx_n_s__from_iterable); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_GetAttr(__pyx_t_15, __pyx_n_s__from_iterable); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_15 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_alslist, __pyx_n_s__itervalues); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_alslist, __pyx_n_s__itervalues); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_9 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_9);
__pyx_t_9 = 0;
- __pyx_t_9 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
- __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_9);
__pyx_t_9 = 0;
- __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_locs));
@@ -49486,15 +49848,15 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_locs = ((PyObject*)__pyx_t_9);
__pyx_t_9 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1122
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1145
* alignment, max_locs = max(alslist.iteritems(), key=lambda x: len(x[1]))
* locs = tuple(itertools.chain.from_iterable(alslist.itervalues()))
* count = len(locs) # <<<<<<<<<<<<<<
* scores = self.scorer.score(FeatureContext(
* f, e, count, fcount[f], num_samples,
*/
- __pyx_t_26 = PyTuple_GET_SIZE(((PyObject *)__pyx_cur_scope->__pyx_v_locs)); if (unlikely(__pyx_t_26 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_26); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_26 = PyTuple_GET_SIZE(((PyObject *)__pyx_cur_scope->__pyx_v_locs)); if (unlikely(__pyx_t_26 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_26); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_count);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_count);
@@ -49502,141 +49864,188 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_count = __pyx_t_9;
__pyx_t_9 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1123
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1146
* locs = tuple(itertools.chain.from_iterable(alslist.itervalues()))
* count = len(locs)
* scores = self.scorer.score(FeatureContext( # <<<<<<<<<<<<<<
* f, e, count, fcount[f], num_samples,
* (k,i+spanlen), locs, input_match,
*/
- __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__FeatureContext); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__FeatureContext); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1124
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1147
* count = len(locs)
* scores = self.scorer.score(FeatureContext(
* f, e, count, fcount[f], num_samples, # <<<<<<<<<<<<<<
* (k,i+spanlen), locs, input_match,
* fwords, self.fda, self.eda,
*/
- __pyx_t_15 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_7 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_num_samples); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_num_samples); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1125
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1148
* scores = self.scorer.score(FeatureContext(
* f, e, count, fcount[f], num_samples,
* (k,i+spanlen), locs, input_match, # <<<<<<<<<<<<<<
* fwords, self.fda, self.eda,
- * meta))
+ * meta,
*/
- __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_16 = PyNumber_Add(__pyx_t_2, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_16 = PyNumber_Add(__pyx_t_1, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10);
__Pyx_GIVEREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_16);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_16);
__Pyx_GIVEREF(__pyx_t_16);
__pyx_t_10 = 0;
__pyx_t_16 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1127
- * (k,i+spanlen), locs, input_match,
- * fwords, self.fda, self.eda,
- * meta)) # <<<<<<<<<<<<<<
- * yield Rule(self.category, f, e, scores, alignment)
- *
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1152
+ * meta,
+ * # Include online stats. None if none.
+ * self.online_ctx_lookup(f, e))) # <<<<<<<<<<<<<<
+ * # Phrase pair processed
+ * if self.online:
*/
- __pyx_t_16 = PyTuple_New(12); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__online_ctx_lookup); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
+ __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_cur_scope->__pyx_v_f);
+ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f);
+ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_e);
+ PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_cur_scope->__pyx_v_e);
+ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e);
+ __pyx_t_14 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
+ __pyx_t_10 = PyTuple_New(13); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
- PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_cur_scope->__pyx_v_f);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_cur_scope->__pyx_v_f);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_e);
- PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_cur_scope->__pyx_v_e);
+ PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_cur_scope->__pyx_v_e);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_count);
- PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_cur_scope->__pyx_v_count);
+ PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_cur_scope->__pyx_v_count);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_count);
- PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_t_15);
+ PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_15);
__Pyx_GIVEREF(__pyx_t_15);
- PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_7);
__Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_16, 5, ((PyObject *)__pyx_t_2));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
+ PyTuple_SET_ITEM(__pyx_t_10, 5, ((PyObject *)__pyx_t_1));
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_locs));
- PyTuple_SET_ITEM(__pyx_t_16, 6, ((PyObject *)__pyx_cur_scope->__pyx_v_locs));
+ PyTuple_SET_ITEM(__pyx_t_10, 6, ((PyObject *)__pyx_cur_scope->__pyx_v_locs));
__Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_locs));
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_input_match);
- PyTuple_SET_ITEM(__pyx_t_16, 7, __pyx_cur_scope->__pyx_v_input_match);
+ PyTuple_SET_ITEM(__pyx_t_10, 7, __pyx_cur_scope->__pyx_v_input_match);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_input_match);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_fwords);
- PyTuple_SET_ITEM(__pyx_t_16, 8, __pyx_cur_scope->__pyx_v_fwords);
+ PyTuple_SET_ITEM(__pyx_t_10, 8, __pyx_cur_scope->__pyx_v_fwords);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_fwords);
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->fda));
- PyTuple_SET_ITEM(__pyx_t_16, 9, ((PyObject *)__pyx_cur_scope->__pyx_v_self->fda));
+ PyTuple_SET_ITEM(__pyx_t_10, 9, ((PyObject *)__pyx_cur_scope->__pyx_v_self->fda));
__Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->fda));
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->eda));
- PyTuple_SET_ITEM(__pyx_t_16, 10, ((PyObject *)__pyx_cur_scope->__pyx_v_self->eda));
+ PyTuple_SET_ITEM(__pyx_t_10, 10, ((PyObject *)__pyx_cur_scope->__pyx_v_self->eda));
__Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->eda));
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_meta);
- PyTuple_SET_ITEM(__pyx_t_16, 11, __pyx_cur_scope->__pyx_v_meta);
+ PyTuple_SET_ITEM(__pyx_t_10, 11, __pyx_cur_scope->__pyx_v_meta);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_meta);
+ PyTuple_SET_ITEM(__pyx_t_10, 12, __pyx_t_14);
+ __Pyx_GIVEREF(__pyx_t_14);
__pyx_t_15 = 0;
__pyx_t_7 = 0;
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = 0;
+ __pyx_t_14 = 0;
+ __pyx_t_14 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0;
- __pyx_t_16 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_Scorer *)__pyx_cur_scope->__pyx_v_self->scorer->__pyx_vtab)->score(__pyx_cur_scope->__pyx_v_self->scorer, __pyx_t_2)); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
+ __pyx_t_10 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_Scorer *)__pyx_cur_scope->__pyx_v_self->scorer->__pyx_vtab)->score(__pyx_cur_scope->__pyx_v_self->scorer, __pyx_t_14)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_scores));
__Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_scores));
- __Pyx_GIVEREF(__pyx_t_16);
- __pyx_cur_scope->__pyx_v_scores = ((struct __pyx_obj_3_sa_FeatureVector *)__pyx_t_16);
- __pyx_t_16 = 0;
+ __Pyx_GIVEREF(__pyx_t_10);
+ __pyx_cur_scope->__pyx_v_scores = ((struct __pyx_obj_3_sa_FeatureVector *)__pyx_t_10);
+ __pyx_t_10 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1128
- * fwords, self.fda, self.eda,
- * meta))
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1154
+ * self.online_ctx_lookup(f, e)))
+ * # Phrase pair processed
+ * if self.online: # <<<<<<<<<<<<<<
+ * seen_phrases.add((f, e))
+ * yield Rule(self.category, f, e, scores, alignment)
+ */
+ if (__pyx_cur_scope->__pyx_v_self->online) {
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1155
+ * # Phrase pair processed
+ * if self.online:
+ * seen_phrases.add((f, e)) # <<<<<<<<<<<<<<
+ * yield Rule(self.category, f, e, scores, alignment)
+ *
+ */
+ __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_cur_scope->__pyx_v_f);
+ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f);
+ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_e);
+ PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_cur_scope->__pyx_v_e);
+ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e);
+ __pyx_t_12 = PySet_Add(__pyx_cur_scope->__pyx_v_seen_phrases, ((PyObject *)__pyx_t_10)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
+ goto __pyx_L60;
+ }
+ __pyx_L60:;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1156
+ * if self.online:
+ * seen_phrases.add((f, e))
* yield Rule(self.category, f, e, scores, alignment) # <<<<<<<<<<<<<<
*
* if len(phrase) < self.max_length and i+spanlen < len(fwords) and pathlen+1 <= self.max_initial_size:
*/
- __pyx_t_16 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->category); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_16);
- __Pyx_GIVEREF(__pyx_t_16);
+ __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->category); 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_14 = PyTuple_New(5); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_10);
+ __Pyx_GIVEREF(__pyx_t_10);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_cur_scope->__pyx_v_f);
+ PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_cur_scope->__pyx_v_f);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_e);
- PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_cur_scope->__pyx_v_e);
+ PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_cur_scope->__pyx_v_e);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e);
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_scores));
- PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_cur_scope->__pyx_v_scores));
+ PyTuple_SET_ITEM(__pyx_t_14, 3, ((PyObject *)__pyx_cur_scope->__pyx_v_scores));
__Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_scores));
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_alignment);
- PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_cur_scope->__pyx_v_alignment);
+ PyTuple_SET_ITEM(__pyx_t_14, 4, __pyx_cur_scope->__pyx_v_alignment);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_alignment);
- __pyx_t_16 = 0;
- __pyx_t_16 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Rule)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_16;
- __pyx_t_16 = 0;
- __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
+ __pyx_t_10 = 0;
+ __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Rule)), ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
+ __pyx_r = __pyx_t_10;
+ __pyx_t_10 = 0;
+ __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
__Pyx_XGIVEREF(__pyx_t_3);
__pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
__pyx_cur_scope->__pyx_t_2 = __pyx_t_5;
@@ -49654,8 +50063,8 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
/* return from generator, yielding value */
__pyx_generator->resume_label = 1;
return __pyx_r;
- __pyx_L60_resume_from_yield:;
- __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
+ __pyx_L61_resume_from_yield:;
+ __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
__pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
__pyx_cur_scope->__pyx_t_1 = 0;
__Pyx_XGOTREF(__pyx_t_3);
@@ -49671,7 +50080,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_t_23 = __pyx_cur_scope->__pyx_t_7;
__pyx_t_24 = __pyx_cur_scope->__pyx_t_8;
__pyx_t_25 = __pyx_cur_scope->__pyx_t_9;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
@@ -49686,38 +50095,41 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
__pyx_L32:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1130
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1158
* yield Rule(self.category, f, e, scores, alignment)
*
* if len(phrase) < self.max_length and i+spanlen < len(fwords) and pathlen+1 <= self.max_initial_size: # <<<<<<<<<<<<<<
* for alt_id in range(len(fwords[i+spanlen])):
* new_frontier.append((k, i+spanlen, input_match, alt_id, pathlen + 1, node, phrase, is_shadow_path))
*/
- __pyx_t_23 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_23 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_20 = (__pyx_t_23 < __pyx_cur_scope->__pyx_v_self->max_length);
if (__pyx_t_20) {
- __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_3 = PyNumber_Add(__pyx_t_11, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Add(__pyx_t_11, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_23 = PyObject_Length(__pyx_cur_scope->__pyx_v_fwords); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_11 = PyInt_FromSsize_t(__pyx_t_23); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __pyx_cur_scope->__pyx_v_fwords;
+ __Pyx_INCREF(__pyx_t_11);
+ __pyx_t_23 = PyObject_Length(__pyx_t_11); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_11 = PyInt_FromSsize_t(__pyx_t_23); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_16 = PyObject_RichCompare(__pyx_t_3, __pyx_t_11, Py_LT); __Pyx_XGOTREF(__pyx_t_16); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_RichCompare(__pyx_t_3, __pyx_t_11, Py_LT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
if (__pyx_t_8) {
- __pyx_t_16 = PyNumber_Add(__pyx_cur_scope->__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyNumber_Add(__pyx_cur_scope->__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_3 = PyObject_RichCompare(__pyx_t_16, __pyx_t_11, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __pyx_t_3 = PyObject_RichCompare(__pyx_t_10, __pyx_t_11, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_28 = __pyx_t_27;
} else {
@@ -49729,57 +50141,57 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
if (__pyx_t_8) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1131
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1159
*
* if len(phrase) < self.max_length and i+spanlen < len(fwords) and pathlen+1 <= self.max_initial_size:
* for alt_id in range(len(fwords[i+spanlen])): # <<<<<<<<<<<<<<
* new_frontier.append((k, i+spanlen, input_match, alt_id, pathlen + 1, node, phrase, is_shadow_path))
* num_subpatterns = arity
*/
- __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_11 = PyNumber_Add(__pyx_t_3, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyNumber_Add(__pyx_t_3, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fwords, __pyx_t_11); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fwords, __pyx_t_11); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_23 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_23 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_23; __pyx_t_19+=1) {
__pyx_cur_scope->__pyx_v_alt_id = __pyx_t_19;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1132
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1160
* if len(phrase) < self.max_length and i+spanlen < len(fwords) and pathlen+1 <= self.max_initial_size:
* for alt_id in range(len(fwords[i+spanlen])):
* new_frontier.append((k, i+spanlen, input_match, alt_id, pathlen + 1, node, phrase, is_shadow_path)) # <<<<<<<<<<<<<<
* num_subpatterns = arity
* if not is_shadow_path:
*/
- __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_16 = PyNumber_Add(__pyx_t_11, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
+ __pyx_t_10 = PyNumber_Add(__pyx_t_11, __pyx_cur_scope->__pyx_v_spanlen); 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);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt_id); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt_id); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_2 = PyNumber_Add(__pyx_cur_scope->__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_9 = PyTuple_New(8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyNumber_Add(__pyx_cur_scope->__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_9 = PyTuple_New(8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_16);
- __Pyx_GIVEREF(__pyx_t_16);
+ PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10);
+ __Pyx_GIVEREF(__pyx_t_10);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_input_match);
PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_cur_scope->__pyx_v_input_match);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_input_match);
PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_11);
__Pyx_GIVEREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_14);
+ __Pyx_GIVEREF(__pyx_t_14);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_node);
PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_cur_scope->__pyx_v_node);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_node);
@@ -49790,14 +50202,14 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
PyTuple_SET_ITEM(__pyx_t_9, 7, __pyx_cur_scope->__pyx_v_is_shadow_path);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_is_shadow_path);
__pyx_t_3 = 0;
- __pyx_t_16 = 0;
+ __pyx_t_10 = 0;
__pyx_t_11 = 0;
- __pyx_t_2 = 0;
- __pyx_t_12 = PyList_Append(__pyx_cur_scope->__pyx_v_new_frontier, ((PyObject *)__pyx_t_9)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = 0;
+ __pyx_t_12 = PyList_Append(__pyx_cur_scope->__pyx_v_new_frontier, ((PyObject *)__pyx_t_9)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1133
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1161
* 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 # <<<<<<<<<<<<<<
@@ -49806,18 +50218,18 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
*/
__pyx_cur_scope->__pyx_v_num_subpatterns = __pyx_cur_scope->__pyx_v_arity;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1134
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1162
* new_frontier.append((k, i+spanlen, input_match, alt_id, pathlen + 1, node, phrase, is_shadow_path))
* num_subpatterns = arity
* if not is_shadow_path: # <<<<<<<<<<<<<<
* num_subpatterns = num_subpatterns + 1
* if len(phrase)+1 < self.max_length and arity < self.max_nonterminals and num_subpatterns < self.max_chunks:
*/
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_20 = (!__pyx_t_8);
if (__pyx_t_20) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1135
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1163
* num_subpatterns = arity
* if not is_shadow_path:
* num_subpatterns = num_subpatterns + 1 # <<<<<<<<<<<<<<
@@ -49825,18 +50237,18 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
* xcat = sym_setindex(self.category, arity+1)
*/
__pyx_cur_scope->__pyx_v_num_subpatterns = (__pyx_cur_scope->__pyx_v_num_subpatterns + 1);
- goto __pyx_L64;
+ goto __pyx_L65;
}
- __pyx_L64:;
+ __pyx_L65:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1136
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1164
* if not is_shadow_path:
* num_subpatterns = num_subpatterns + 1
* if len(phrase)+1 < self.max_length and arity < self.max_nonterminals and num_subpatterns < self.max_chunks: # <<<<<<<<<<<<<<
* xcat = sym_setindex(self.category, arity+1)
* xnode = node.children[xcat]
*/
- __pyx_t_23 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_23 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_20 = ((__pyx_t_23 + 1) < __pyx_cur_scope->__pyx_v_self->max_length);
if (__pyx_t_20) {
__pyx_t_8 = (__pyx_cur_scope->__pyx_v_arity < __pyx_cur_scope->__pyx_v_self->max_nonterminals);
@@ -49852,7 +50264,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
if (__pyx_t_8) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1137
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1165
* 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) # <<<<<<<<<<<<<<
@@ -49861,39 +50273,39 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
*/
__pyx_cur_scope->__pyx_v_xcat = __pyx_f_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, (__pyx_cur_scope->__pyx_v_arity + 1));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1138
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1166
* if len(phrase)+1 < self.max_length and arity < self.max_nonterminals and num_subpatterns < self.max_chunks:
* xcat = sym_setindex(self.category, arity+1)
* xnode = node.children[xcat] # <<<<<<<<<<<<<<
* # I put spanlen=1 below
* key = tuple([self.min_gap_size, i, 1, pathlen])
*/
- __pyx_t_9 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_9, __pyx_cur_scope->__pyx_v_xcat, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_9, __pyx_cur_scope->__pyx_v_xcat, sizeof(int), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_xnode);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_xnode);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_cur_scope->__pyx_v_xnode = __pyx_t_2;
- __pyx_t_2 = 0;
+ __Pyx_GIVEREF(__pyx_t_14);
+ __pyx_cur_scope->__pyx_v_xnode = __pyx_t_14;
+ __pyx_t_14 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1140
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1168
* xnode = node.children[xcat]
* # I put spanlen=1 below
* key = tuple([self.min_gap_size, i, 1, pathlen]) # <<<<<<<<<<<<<<
* frontier_nodes = []
* if (key in nodes_isteps_away_buffer):
*/
- __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_9 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_9 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_11 = PyList_New(4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyList_New(4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- PyList_SET_ITEM(__pyx_t_11, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
+ PyList_SET_ITEM(__pyx_t_11, 0, __pyx_t_14);
+ __Pyx_GIVEREF(__pyx_t_14);
PyList_SET_ITEM(__pyx_t_11, 1, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_9);
__Pyx_INCREF(__pyx_int_1);
@@ -49902,9 +50314,9 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_pathlen);
PyList_SET_ITEM(__pyx_t_11, 3, __pyx_cur_scope->__pyx_v_pathlen);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_pathlen);
- __pyx_t_2 = 0;
+ __pyx_t_14 = 0;
__pyx_t_9 = 0;
- __pyx_t_9 = ((PyObject *)PyList_AsTuple(__pyx_t_11)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = ((PyObject *)PyList_AsTuple(__pyx_t_11)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_9));
__Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_key));
@@ -49913,14 +50325,14 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_key = __pyx_t_9;
__pyx_t_9 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1141
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1169
* # I put spanlen=1 below
* key = tuple([self.min_gap_size, i, 1, pathlen])
* frontier_nodes = [] # <<<<<<<<<<<<<<
* if (key in nodes_isteps_away_buffer):
* frontier_nodes = nodes_isteps_away_buffer[key]
*/
- __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_frontier_nodes);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_frontier_nodes);
@@ -49928,92 +50340,92 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_frontier_nodes = ((PyObject *)__pyx_t_9);
__pyx_t_9 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1142
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1170
* key = tuple([self.min_gap_size, i, 1, pathlen])
* frontier_nodes = []
* if (key in nodes_isteps_away_buffer): # <<<<<<<<<<<<<<
* frontier_nodes = nodes_isteps_away_buffer[key]
* else:
*/
- __pyx_t_8 = (__Pyx_PyDict_Contains(((PyObject *)__pyx_cur_scope->__pyx_v_key), ((PyObject *)__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer), Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = (__Pyx_PyDict_Contains(((PyObject *)__pyx_cur_scope->__pyx_v_key), ((PyObject *)__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer), Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_8) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1143
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1171
* frontier_nodes = []
* if (key in nodes_isteps_away_buffer):
* frontier_nodes = nodes_isteps_away_buffer[key] # <<<<<<<<<<<<<<
* else:
* frontier_nodes = self.get_all_nodes_isteps_away(self.min_gap_size, i, 1, pathlen, fwords, next_states, reachable_buffer)
*/
- __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer), ((PyObject *)__pyx_cur_scope->__pyx_v_key)); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer), ((PyObject *)__pyx_cur_scope->__pyx_v_key)); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_frontier_nodes);
__Pyx_DECREF(__pyx_cur_scope->__pyx_v_frontier_nodes);
__Pyx_GIVEREF(__pyx_t_9);
__pyx_cur_scope->__pyx_v_frontier_nodes = __pyx_t_9;
__pyx_t_9 = 0;
- goto __pyx_L66;
+ goto __pyx_L67;
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1145
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1173
* frontier_nodes = nodes_isteps_away_buffer[key]
* else:
* frontier_nodes = self.get_all_nodes_isteps_away(self.min_gap_size, i, 1, pathlen, fwords, next_states, reachable_buffer) # <<<<<<<<<<<<<<
* nodes_isteps_away_buffer[key] = frontier_nodes
*
*/
- __pyx_t_9 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_123); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_123); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_16 = PyTuple_New(7); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_11);
+ __pyx_t_14 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_10 = PyTuple_New(7); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11);
__Pyx_GIVEREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_14);
+ __Pyx_GIVEREF(__pyx_t_14);
__Pyx_INCREF(__pyx_int_1);
- PyTuple_SET_ITEM(__pyx_t_16, 2, __pyx_int_1);
+ PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_int_1);
__Pyx_GIVEREF(__pyx_int_1);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_pathlen);
- PyTuple_SET_ITEM(__pyx_t_16, 3, __pyx_cur_scope->__pyx_v_pathlen);
+ PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_cur_scope->__pyx_v_pathlen);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_pathlen);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_fwords);
- PyTuple_SET_ITEM(__pyx_t_16, 4, __pyx_cur_scope->__pyx_v_fwords);
+ PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_cur_scope->__pyx_v_fwords);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_fwords);
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_next_states));
- PyTuple_SET_ITEM(__pyx_t_16, 5, ((PyObject *)__pyx_cur_scope->__pyx_v_next_states));
+ PyTuple_SET_ITEM(__pyx_t_10, 5, ((PyObject *)__pyx_cur_scope->__pyx_v_next_states));
__Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_next_states));
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_reachable_buffer));
- PyTuple_SET_ITEM(__pyx_t_16, 6, ((PyObject *)__pyx_cur_scope->__pyx_v_reachable_buffer));
+ PyTuple_SET_ITEM(__pyx_t_10, 6, ((PyObject *)__pyx_cur_scope->__pyx_v_reachable_buffer));
__Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_reachable_buffer));
__pyx_t_11 = 0;
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_14 = 0;
+ __pyx_t_14 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_frontier_nodes);
__Pyx_DECREF(__pyx_cur_scope->__pyx_v_frontier_nodes);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_cur_scope->__pyx_v_frontier_nodes = __pyx_t_2;
- __pyx_t_2 = 0;
+ __Pyx_GIVEREF(__pyx_t_14);
+ __pyx_cur_scope->__pyx_v_frontier_nodes = __pyx_t_14;
+ __pyx_t_14 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1146
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1174
* else:
* frontier_nodes = self.get_all_nodes_isteps_away(self.min_gap_size, i, 1, pathlen, fwords, next_states, reachable_buffer)
* nodes_isteps_away_buffer[key] = frontier_nodes # <<<<<<<<<<<<<<
*
* for (i, alt, pathlen) in frontier_nodes:
*/
- if (PyDict_SetItem(((PyObject *)__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer), ((PyObject *)__pyx_cur_scope->__pyx_v_key), __pyx_cur_scope->__pyx_v_frontier_nodes) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(((PyObject *)__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer), ((PyObject *)__pyx_cur_scope->__pyx_v_key), __pyx_cur_scope->__pyx_v_frontier_nodes) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_L66:;
+ __pyx_L67:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1148
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1176
* nodes_isteps_away_buffer[key] = frontier_nodes
*
* for (i, alt, pathlen) in frontier_nodes: # <<<<<<<<<<<<<<
@@ -50021,41 +50433,41 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
* frontier = new_frontier
*/
if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_frontier_nodes) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_frontier_nodes)) {
- __pyx_t_2 = __pyx_cur_scope->__pyx_v_frontier_nodes; __Pyx_INCREF(__pyx_t_2); __pyx_t_23 = 0;
+ __pyx_t_14 = __pyx_cur_scope->__pyx_v_frontier_nodes; __Pyx_INCREF(__pyx_t_14); __pyx_t_23 = 0;
__pyx_t_21 = NULL;
} else {
- __pyx_t_23 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_frontier_nodes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_21 = Py_TYPE(__pyx_t_2)->tp_iternext;
+ __pyx_t_23 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_frontier_nodes); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_21 = Py_TYPE(__pyx_t_14)->tp_iternext;
}
for (;;) {
- if (!__pyx_t_21 && PyList_CheckExact(__pyx_t_2)) {
- if (__pyx_t_23 >= PyList_GET_SIZE(__pyx_t_2)) break;
+ if (!__pyx_t_21 && PyList_CheckExact(__pyx_t_14)) {
+ if (__pyx_t_23 >= PyList_GET_SIZE(__pyx_t_14)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_16 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_23); __Pyx_INCREF(__pyx_t_16); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_23); __Pyx_INCREF(__pyx_t_10); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_16 = PySequence_ITEM(__pyx_t_2, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PySequence_ITEM(__pyx_t_14, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
- } else if (!__pyx_t_21 && PyTuple_CheckExact(__pyx_t_2)) {
- if (__pyx_t_23 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
+ } else if (!__pyx_t_21 && PyTuple_CheckExact(__pyx_t_14)) {
+ if (__pyx_t_23 >= PyTuple_GET_SIZE(__pyx_t_14)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_16 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_23); __Pyx_INCREF(__pyx_t_16); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_23); __Pyx_INCREF(__pyx_t_10); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_16 = PySequence_ITEM(__pyx_t_2, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PySequence_ITEM(__pyx_t_14, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
- __pyx_t_16 = __pyx_t_21(__pyx_t_2);
- if (unlikely(!__pyx_t_16)) {
+ __pyx_t_10 = __pyx_t_21(__pyx_t_14);
+ if (unlikely(!__pyx_t_10)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
- __Pyx_GOTREF(__pyx_t_16);
+ __Pyx_GOTREF(__pyx_t_10);
}
- if ((likely(PyTuple_CheckExact(__pyx_t_16))) || (PyList_CheckExact(__pyx_t_16))) {
- PyObject* sequence = __pyx_t_16;
+ if ((likely(PyTuple_CheckExact(__pyx_t_10))) || (PyList_CheckExact(__pyx_t_10))) {
+ PyObject* sequence = __pyx_t_10;
#if CYTHON_COMPILING_IN_CPYTHON
Py_ssize_t size = Py_SIZE(sequence);
#else
@@ -50064,7 +50476,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -50080,38 +50492,38 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__Pyx_INCREF(__pyx_t_11);
__Pyx_INCREF(__pyx_t_3);
#else
- __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_7 = PyObject_GetIter(__pyx_t_16); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __pyx_t_18 = Py_TYPE(__pyx_t_7)->tp_iternext;
- index = 0; __pyx_t_9 = __pyx_t_18(__pyx_t_7); if (unlikely(!__pyx_t_9)) goto __pyx_L69_unpacking_failed;
+ __pyx_t_1 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_18 = Py_TYPE(__pyx_t_1)->tp_iternext;
+ index = 0; __pyx_t_9 = __pyx_t_18(__pyx_t_1); if (unlikely(!__pyx_t_9)) goto __pyx_L70_unpacking_failed;
__Pyx_GOTREF(__pyx_t_9);
- index = 1; __pyx_t_11 = __pyx_t_18(__pyx_t_7); if (unlikely(!__pyx_t_11)) goto __pyx_L69_unpacking_failed;
+ index = 1; __pyx_t_11 = __pyx_t_18(__pyx_t_1); if (unlikely(!__pyx_t_11)) goto __pyx_L70_unpacking_failed;
__Pyx_GOTREF(__pyx_t_11);
- index = 2; __pyx_t_3 = __pyx_t_18(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L69_unpacking_failed;
+ index = 2; __pyx_t_3 = __pyx_t_18(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L70_unpacking_failed;
__Pyx_GOTREF(__pyx_t_3);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_18(__pyx_t_7), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_18(__pyx_t_1), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_18 = NULL;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- goto __pyx_L70_unpacking_done;
- __pyx_L69_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ goto __pyx_L71_unpacking_done;
+ __pyx_L70_unpacking_failed:;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_18 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_L70_unpacking_done:;
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_L71_unpacking_done:;
}
- __pyx_t_19 = __Pyx_PyInt_AsInt(__pyx_t_9); if (unlikely((__pyx_t_19 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_19 = __Pyx_PyInt_AsInt(__pyx_t_9); if (unlikely((__pyx_t_19 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_11); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_11); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_cur_scope->__pyx_v_i = __pyx_t_19;
__pyx_cur_scope->__pyx_v_alt = __pyx_t_6;
@@ -50121,85 +50533,85 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_pathlen = __pyx_t_3;
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1149
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1177
*
* for (i, alt, pathlen) in frontier_nodes:
* new_frontier.append((k, i, input_match + (i,), alt, pathlen, xnode, phrase +(xcat,), is_shadow_path)) # <<<<<<<<<<<<<<
* frontier = new_frontier
*
*/
- __pyx_t_16 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_11);
__Pyx_GIVEREF(__pyx_t_11);
__pyx_t_11 = 0;
- __pyx_t_11 = PyNumber_Add(__pyx_cur_scope->__pyx_v_input_match, ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyNumber_Add(__pyx_cur_scope->__pyx_v_input_match, ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
- __pyx_t_9 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_7 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_xcat); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_xcat); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_15);
- PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_7 = PyNumber_Add(__pyx_cur_scope->__pyx_v_phrase, ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_t_1 = PyNumber_Add(__pyx_cur_scope->__pyx_v_phrase, ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
+ __pyx_t_7 = PyTuple_New(8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
- __pyx_t_15 = PyTuple_New(8); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_15);
- PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_16);
- __Pyx_GIVEREF(__pyx_t_16);
- PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_10);
+ __Pyx_GIVEREF(__pyx_t_10);
+ PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_11);
+ PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_11);
__Pyx_GIVEREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_15, 3, __pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_9);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_pathlen);
- PyTuple_SET_ITEM(__pyx_t_15, 4, __pyx_cur_scope->__pyx_v_pathlen);
+ PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_cur_scope->__pyx_v_pathlen);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_pathlen);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_xnode);
- PyTuple_SET_ITEM(__pyx_t_15, 5, __pyx_cur_scope->__pyx_v_xnode);
+ PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_cur_scope->__pyx_v_xnode);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_xnode);
- PyTuple_SET_ITEM(__pyx_t_15, 6, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_7, 6, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_is_shadow_path);
- PyTuple_SET_ITEM(__pyx_t_15, 7, __pyx_cur_scope->__pyx_v_is_shadow_path);
+ PyTuple_SET_ITEM(__pyx_t_7, 7, __pyx_cur_scope->__pyx_v_is_shadow_path);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_is_shadow_path);
- __pyx_t_16 = 0;
+ __pyx_t_10 = 0;
__pyx_t_3 = 0;
__pyx_t_11 = 0;
__pyx_t_9 = 0;
- __pyx_t_7 = 0;
- __pyx_t_12 = PyList_Append(__pyx_cur_scope->__pyx_v_new_frontier, ((PyObject *)__pyx_t_15)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
+ __pyx_t_1 = 0;
+ __pyx_t_12 = PyList_Append(__pyx_cur_scope->__pyx_v_new_frontier, ((PyObject *)__pyx_t_7)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- goto __pyx_L65;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ goto __pyx_L66;
}
- __pyx_L65:;
- goto __pyx_L61;
+ __pyx_L66:;
+ goto __pyx_L62;
}
- __pyx_L61:;
+ __pyx_L62:;
__pyx_L19_continue:;
}
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1150
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1178
* 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 # <<<<<<<<<<<<<<
*
- * stop_time = monitor_cpu()
+ * # Online rule extraction and scoring
*/
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_new_frontier));
__Pyx_GOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_frontier));
@@ -50208,98 +50620,603 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_frontier = __pyx_cur_scope->__pyx_v_new_frontier;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1152
- * frontier = new_frontier
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1181
+ *
+ * # Online rule extraction and scoring
+ * if self.online: # <<<<<<<<<<<<<<
+ * f_syms = tuple(word[0][0] for word in fwords)
+ * for (f, lex_i, lex_j) in self.get_f_phrases(f_syms):
+ */
+ if (__pyx_cur_scope->__pyx_v_self->online) {
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1182
+ * # Online rule extraction and scoring
+ * if self.online:
+ * f_syms = tuple(word[0][0] for word in fwords) # <<<<<<<<<<<<<<
+ * for (f, lex_i, lex_j) in self.get_f_phrases(f_syms):
+ * spanlen = (lex_j - lex_i) + 1
+ */
+ __pyx_t_13 = __pyx_pf_3_sa_23HieroCachingRuleFactory_5input_2genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13);
+ __Pyx_GIVEREF(__pyx_t_13);
+ __pyx_t_13 = 0;
+ __pyx_t_13 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_13);
+ __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
+ __Pyx_GIVEREF(__pyx_t_13);
+ __pyx_cur_scope->__pyx_v_f_syms = ((PyObject*)__pyx_t_13);
+ __pyx_t_13 = 0;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1183
+ * if self.online:
+ * f_syms = tuple(word[0][0] for word in fwords)
+ * for (f, lex_i, lex_j) in self.get_f_phrases(f_syms): # <<<<<<<<<<<<<<
+ * spanlen = (lex_j - lex_i) + 1
+ * if not sym_isvar(f[0]):
+ */
+ __pyx_t_13 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__get_f_phrases); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_f_syms));
+ PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_f_syms));
+ __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_f_syms));
+ __pyx_t_7 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
+ if (PyList_CheckExact(__pyx_t_7) || PyTuple_CheckExact(__pyx_t_7)) {
+ __pyx_t_14 = __pyx_t_7; __Pyx_INCREF(__pyx_t_14); __pyx_t_2 = 0;
+ __pyx_t_21 = NULL;
+ } else {
+ __pyx_t_2 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_21 = Py_TYPE(__pyx_t_14)->tp_iternext;
+ }
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ for (;;) {
+ if (!__pyx_t_21 && PyList_CheckExact(__pyx_t_14)) {
+ if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_14)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_7 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ } else if (!__pyx_t_21 && PyTuple_CheckExact(__pyx_t_14)) {
+ if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_14)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ } else {
+ __pyx_t_7 = __pyx_t_21(__pyx_t_14);
+ if (unlikely(!__pyx_t_7)) {
+ if (PyErr_Occurred()) {
+ if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ break;
+ }
+ __Pyx_GOTREF(__pyx_t_7);
+ }
+ if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
+ PyObject* sequence = __pyx_t_7;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ Py_ssize_t size = Py_SIZE(sequence);
+ #else
+ Py_ssize_t size = PySequence_Size(sequence);
+ #endif
+ if (unlikely(size != 3)) {
+ if (size > 3) __Pyx_RaiseTooManyValuesError(3);
+ else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ #if CYTHON_COMPILING_IN_CPYTHON
+ if (likely(PyTuple_CheckExact(sequence))) {
+ __pyx_t_13 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
+ __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2);
+ } else {
+ __pyx_t_13 = PyList_GET_ITEM(sequence, 0);
+ __pyx_t_1 = PyList_GET_ITEM(sequence, 1);
+ __pyx_t_9 = PyList_GET_ITEM(sequence, 2);
+ }
+ __Pyx_INCREF(__pyx_t_13);
+ __Pyx_INCREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_t_9);
+ #else
+ __pyx_t_13 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ {
+ Py_ssize_t index = -1;
+ __pyx_t_11 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_18 = Py_TYPE(__pyx_t_11)->tp_iternext;
+ index = 0; __pyx_t_13 = __pyx_t_18(__pyx_t_11); if (unlikely(!__pyx_t_13)) goto __pyx_L75_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_13);
+ index = 1; __pyx_t_1 = __pyx_t_18(__pyx_t_11); if (unlikely(!__pyx_t_1)) goto __pyx_L75_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_1);
+ index = 2; __pyx_t_9 = __pyx_t_18(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L75_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_9);
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_18(__pyx_t_11), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = NULL;
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ goto __pyx_L76_unpacking_done;
+ __pyx_L75_unpacking_failed:;
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_18 = NULL;
+ if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_L76_unpacking_done:;
+ }
+ __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_f);
+ __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_f);
+ __Pyx_GIVEREF(__pyx_t_13);
+ __pyx_cur_scope->__pyx_v_f = __pyx_t_13;
+ __pyx_t_13 = 0;
+ __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_lex_i);
+ __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_lex_i);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_cur_scope->__pyx_v_lex_i = __pyx_t_1;
+ __pyx_t_1 = 0;
+ __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_lex_j);
+ __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_lex_j);
+ __Pyx_GIVEREF(__pyx_t_9);
+ __pyx_cur_scope->__pyx_v_lex_j = __pyx_t_9;
+ __pyx_t_9 = 0;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1184
+ * f_syms = tuple(word[0][0] for word in fwords)
+ * for (f, lex_i, lex_j) in self.get_f_phrases(f_syms):
+ * spanlen = (lex_j - lex_i) + 1 # <<<<<<<<<<<<<<
+ * if not sym_isvar(f[0]):
+ * spanlen += 1
+ */
+ __pyx_t_7 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_lex_j, __pyx_cur_scope->__pyx_v_lex_i); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_9 = PyNumber_Add(__pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_spanlen);
+ __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_spanlen);
+ __Pyx_GIVEREF(__pyx_t_9);
+ __pyx_cur_scope->__pyx_v_spanlen = __pyx_t_9;
+ __pyx_t_9 = 0;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1185
+ * for (f, lex_i, lex_j) in self.get_f_phrases(f_syms):
+ * spanlen = (lex_j - lex_i) + 1
+ * if not sym_isvar(f[0]): # <<<<<<<<<<<<<<
+ * spanlen += 1
+ * if not sym_isvar(f[1]):
+ */
+ __pyx_t_9 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_f, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_9); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_8 = (!__pyx_f_3_sa_sym_isvar(__pyx_t_6));
+ if (__pyx_t_8) {
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1186
+ * spanlen = (lex_j - lex_i) + 1
+ * if not sym_isvar(f[0]):
+ * spanlen += 1 # <<<<<<<<<<<<<<
+ * if not sym_isvar(f[1]):
+ * spanlen += 1
+ */
+ __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_spanlen, __pyx_int_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_spanlen);
+ __Pyx_DECREF(__pyx_cur_scope->__pyx_v_spanlen);
+ __Pyx_GIVEREF(__pyx_t_9);
+ __pyx_cur_scope->__pyx_v_spanlen = __pyx_t_9;
+ __pyx_t_9 = 0;
+ goto __pyx_L77;
+ }
+ __pyx_L77:;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1187
+ * if not sym_isvar(f[0]):
+ * spanlen += 1
+ * if not sym_isvar(f[1]): # <<<<<<<<<<<<<<
+ * spanlen += 1
+ * for e in self.phrases_fe.get(f, ()):
+ */
+ __pyx_t_9 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_f, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_9); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_8 = (!__pyx_f_3_sa_sym_isvar(__pyx_t_6));
+ if (__pyx_t_8) {
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1188
+ * spanlen += 1
+ * if not sym_isvar(f[1]):
+ * spanlen += 1 # <<<<<<<<<<<<<<
+ * for e in self.phrases_fe.get(f, ()):
+ * if (f, e) not in seen_phrases:
+ */
+ __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_spanlen, __pyx_int_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_spanlen);
+ __Pyx_DECREF(__pyx_cur_scope->__pyx_v_spanlen);
+ __Pyx_GIVEREF(__pyx_t_9);
+ __pyx_cur_scope->__pyx_v_spanlen = __pyx_t_9;
+ __pyx_t_9 = 0;
+ goto __pyx_L78;
+ }
+ __pyx_L78:;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1189
+ * if not sym_isvar(f[1]):
+ * spanlen += 1
+ * for e in self.phrases_fe.get(f, ()): # <<<<<<<<<<<<<<
+ * if (f, e) not in seen_phrases:
+ * # Don't add multiple instances of the same phrase here
+ */
+ __pyx_t_9 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_self->phrases_fe, __pyx_n_s__get); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_cur_scope->__pyx_v_f);
+ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f);
+ __Pyx_INCREF(((PyObject *)__pyx_empty_tuple));
+ PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_empty_tuple));
+ __Pyx_GIVEREF(((PyObject *)__pyx_empty_tuple));
+ __pyx_t_1 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
+ if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
+ __pyx_t_7 = __pyx_t_1; __Pyx_INCREF(__pyx_t_7); __pyx_t_23 = 0;
+ __pyx_t_29 = NULL;
+ } else {
+ __pyx_t_23 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_29 = Py_TYPE(__pyx_t_7)->tp_iternext;
+ }
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ for (;;) {
+ if (!__pyx_t_29 && PyList_CheckExact(__pyx_t_7)) {
+ if (__pyx_t_23 >= PyList_GET_SIZE(__pyx_t_7)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_1 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_23); __Pyx_INCREF(__pyx_t_1); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_7, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ } else if (!__pyx_t_29 && PyTuple_CheckExact(__pyx_t_7)) {
+ if (__pyx_t_23 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_23); __Pyx_INCREF(__pyx_t_1); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_7, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ } else {
+ __pyx_t_1 = __pyx_t_29(__pyx_t_7);
+ if (unlikely(!__pyx_t_1)) {
+ if (PyErr_Occurred()) {
+ if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ break;
+ }
+ __Pyx_GOTREF(__pyx_t_1);
+ }
+ __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_e);
+ __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_e);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_cur_scope->__pyx_v_e = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1190
+ * spanlen += 1
+ * for e in self.phrases_fe.get(f, ()):
+ * if (f, e) not in seen_phrases: # <<<<<<<<<<<<<<
+ * # Don't add multiple instances of the same phrase here
+ * seen_phrases.add((f, e))
+ */
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_f);
+ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f);
+ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_e);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_cur_scope->__pyx_v_e);
+ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e);
+ __pyx_t_8 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_cur_scope->__pyx_v_seen_phrases), Py_NE)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+ if (__pyx_t_8) {
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1192
+ * if (f, e) not in seen_phrases:
+ * # Don't add multiple instances of the same phrase here
+ * seen_phrases.add((f, e)) # <<<<<<<<<<<<<<
+ * scores = self.scorer.score(FeatureContext(
+ * f, e, 0, 0, 0,
+ */
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_f);
+ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f);
+ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_e);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_cur_scope->__pyx_v_e);
+ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e);
+ __pyx_t_12 = PySet_Add(__pyx_cur_scope->__pyx_v_seen_phrases, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1193
+ * # Don't add multiple instances of the same phrase here
+ * seen_phrases.add((f, e))
+ * scores = self.scorer.score(FeatureContext( # <<<<<<<<<<<<<<
+ * f, e, 0, 0, 0,
+ * spanlen, None, None,
+ */
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FeatureContext); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1198
+ * fwords, self.fda, self.eda,
+ * meta,
+ * self.online_ctx_lookup(f, e))) # <<<<<<<<<<<<<<
+ * alignment = self.phrases_al[f][e]
+ * yield Rule(self.category, f, e, scores, alignment)
+ */
+ __pyx_t_9 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__online_ctx_lookup); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_13);
+ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
+ PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_cur_scope->__pyx_v_f);
+ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f);
+ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_e);
+ PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_cur_scope->__pyx_v_e);
+ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e);
+ __pyx_t_11 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
+ __pyx_t_13 = PyTuple_New(13); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_13);
+ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
+ PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_cur_scope->__pyx_v_f);
+ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f);
+ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_e);
+ PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_cur_scope->__pyx_v_e);
+ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e);
+ __Pyx_INCREF(__pyx_int_0);
+ PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_int_0);
+ __Pyx_GIVEREF(__pyx_int_0);
+ __Pyx_INCREF(__pyx_int_0);
+ PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_int_0);
+ __Pyx_GIVEREF(__pyx_int_0);
+ __Pyx_INCREF(__pyx_int_0);
+ PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_int_0);
+ __Pyx_GIVEREF(__pyx_int_0);
+ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_spanlen);
+ PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_cur_scope->__pyx_v_spanlen);
+ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_spanlen);
+ __Pyx_INCREF(Py_None);
+ PyTuple_SET_ITEM(__pyx_t_13, 6, Py_None);
+ __Pyx_GIVEREF(Py_None);
+ __Pyx_INCREF(Py_None);
+ PyTuple_SET_ITEM(__pyx_t_13, 7, Py_None);
+ __Pyx_GIVEREF(Py_None);
+ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_fwords);
+ PyTuple_SET_ITEM(__pyx_t_13, 8, __pyx_cur_scope->__pyx_v_fwords);
+ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_fwords);
+ __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->fda));
+ PyTuple_SET_ITEM(__pyx_t_13, 9, ((PyObject *)__pyx_cur_scope->__pyx_v_self->fda));
+ __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->fda));
+ __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->eda));
+ PyTuple_SET_ITEM(__pyx_t_13, 10, ((PyObject *)__pyx_cur_scope->__pyx_v_self->eda));
+ __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->eda));
+ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_meta);
+ PyTuple_SET_ITEM(__pyx_t_13, 11, __pyx_cur_scope->__pyx_v_meta);
+ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_meta);
+ PyTuple_SET_ITEM(__pyx_t_13, 12, __pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_11);
+ __pyx_t_11 = 0;
+ __pyx_t_11 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
+ __pyx_t_13 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_Scorer *)__pyx_cur_scope->__pyx_v_self->scorer->__pyx_vtab)->score(__pyx_cur_scope->__pyx_v_self->scorer, __pyx_t_11)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_13);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_scores));
+ __Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_scores));
+ __Pyx_GIVEREF(__pyx_t_13);
+ __pyx_cur_scope->__pyx_v_scores = ((struct __pyx_obj_3_sa_FeatureVector *)__pyx_t_13);
+ __pyx_t_13 = 0;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1199
+ * meta,
+ * self.online_ctx_lookup(f, e)))
+ * alignment = self.phrases_al[f][e] # <<<<<<<<<<<<<<
+ * yield Rule(self.category, f, e, scores, alignment)
+ *
+ */
+ __pyx_t_13 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->phrases_al, __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_11 = PyObject_GetItem(__pyx_t_13, __pyx_cur_scope->__pyx_v_e); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_alignment);
+ __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_alignment);
+ __Pyx_GIVEREF(__pyx_t_11);
+ __pyx_cur_scope->__pyx_v_alignment = __pyx_t_11;
+ __pyx_t_11 = 0;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1200
+ * self.online_ctx_lookup(f, e)))
+ * alignment = self.phrases_al[f][e]
+ * yield Rule(self.category, f, e, scores, alignment) # <<<<<<<<<<<<<<
+ *
+ * stop_time = monitor_cpu()
+ */
+ __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->category); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_13 = PyTuple_New(5); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_13);
+ PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_11);
+ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
+ PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_cur_scope->__pyx_v_f);
+ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f);
+ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_e);
+ PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_cur_scope->__pyx_v_e);
+ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e);
+ __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_scores));
+ PyTuple_SET_ITEM(__pyx_t_13, 3, ((PyObject *)__pyx_cur_scope->__pyx_v_scores));
+ __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_scores));
+ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_alignment);
+ PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_cur_scope->__pyx_v_alignment);
+ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_alignment);
+ __pyx_t_11 = 0;
+ __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Rule)), ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
+ __pyx_r = __pyx_t_11;
+ __pyx_t_11 = 0;
+ __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
+ __Pyx_XGIVEREF(__pyx_t_7);
+ __pyx_cur_scope->__pyx_t_1 = __pyx_t_7;
+ __Pyx_XGIVEREF(__pyx_t_14);
+ __pyx_cur_scope->__pyx_t_4 = __pyx_t_14;
+ __pyx_cur_scope->__pyx_t_10 = __pyx_t_21;
+ __pyx_cur_scope->__pyx_t_2 = __pyx_t_23;
+ __pyx_cur_scope->__pyx_t_11 = __pyx_t_29;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ /* return from generator, yielding value */
+ __pyx_generator->resume_label = 2;
+ return __pyx_r;
+ __pyx_L82_resume_from_yield:;
+ __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
+ __pyx_t_7 = __pyx_cur_scope->__pyx_t_1;
+ __pyx_cur_scope->__pyx_t_1 = 0;
+ __Pyx_XGOTREF(__pyx_t_7);
+ __pyx_t_14 = __pyx_cur_scope->__pyx_t_4;
+ __pyx_cur_scope->__pyx_t_4 = 0;
+ __Pyx_XGOTREF(__pyx_t_14);
+ __pyx_t_21 = __pyx_cur_scope->__pyx_t_10;
+ __pyx_t_23 = __pyx_cur_scope->__pyx_t_2;
+ __pyx_t_29 = __pyx_cur_scope->__pyx_t_11;
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L81;
+ }
+ __pyx_L81:;
+ }
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ goto __pyx_L72;
+ }
+ __pyx_L72:;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1202
+ * yield Rule(self.category, f, e, scores, alignment)
*
* stop_time = monitor_cpu() # <<<<<<<<<<<<<<
* logger.info("Total time for rule lookup, extraction, and scoring = %f seconds", (stop_time - start_time))
* gc.collect()
*/
- __pyx_t_13 = PyFloat_FromDouble(__pyx_f_3_sa_monitor_cpu()); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_GIVEREF(__pyx_t_13);
- __pyx_cur_scope->__pyx_v_stop_time = __pyx_t_13;
- __pyx_t_13 = 0;
+ __pyx_t_14 = PyFloat_FromDouble(__pyx_f_3_sa_monitor_cpu()); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __Pyx_GIVEREF(__pyx_t_14);
+ __pyx_cur_scope->__pyx_v_stop_time = __pyx_t_14;
+ __pyx_t_14 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1153
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1203
*
* stop_time = monitor_cpu()
* logger.info("Total time for rule lookup, extraction, and scoring = %f seconds", (stop_time - start_time)) # <<<<<<<<<<<<<<
* gc.collect()
* logger.info(" Extract time = %f seconds", self.extract_time)
*/
- __pyx_t_13 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_2 = PyObject_GetAttr(__pyx_t_13, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_13 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_start_time); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_15 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_stop_time, __pyx_t_13); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_15);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_14 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_7 = PyObject_GetAttr(__pyx_t_14, __pyx_n_s__info); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __pyx_t_14 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_start_time); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_11 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_stop_time, __pyx_t_14); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_124));
- PyTuple_SET_ITEM(__pyx_t_13, 0, ((PyObject *)__pyx_kp_s_124));
+ PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_kp_s_124));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_124));
- PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_15);
- __Pyx_GIVEREF(__pyx_t_15);
- __pyx_t_15 = 0;
- __pyx_t_15 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_15);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_11);
+ __pyx_t_11 = 0;
+ __pyx_t_11 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1154
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1204
* stop_time = monitor_cpu()
* logger.info("Total time for rule lookup, extraction, and scoring = %f seconds", (stop_time - start_time))
* gc.collect() # <<<<<<<<<<<<<<
* logger.info(" Extract time = %f seconds", self.extract_time)
*
*/
- __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s__gc); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_15);
- __pyx_t_13 = PyObject_GetAttr(__pyx_t_15, __pyx_n_s__collect); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_15 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_15);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __pyx_t_11 = __Pyx_GetName(__pyx_m, __pyx_n_s__gc); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_14 = PyObject_GetAttr(__pyx_t_11, __pyx_n_s__collect); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_11 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1155
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1205
* logger.info("Total time for rule lookup, extraction, and scoring = %f seconds", (stop_time - start_time))
* gc.collect()
* logger.info(" Extract time = %f seconds", self.extract_time) # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_15);
- __pyx_t_13 = PyObject_GetAttr(__pyx_t_15, __pyx_n_s__info); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_15 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->extract_time); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_15);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_11 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_14 = PyObject_GetAttr(__pyx_t_11, __pyx_n_s__info); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_11 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->extract_time); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_125));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_125));
+ PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_kp_s_125));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_125));
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_15);
- __Pyx_GIVEREF(__pyx_t_15);
- __pyx_t_15 = 0;
- __pyx_t_15 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_15);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_11);
+ __pyx_t_11 = 0;
+ __pyx_t_11 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
PyErr_SetNone(PyExc_StopIteration);
goto __pyx_L0;
__pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_9);
@@ -50319,7 +51236,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
return NULL;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1158
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1208
*
*
* cdef int find_fixpoint(self, # <<<<<<<<<<<<<<
@@ -50349,7 +51266,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("find_fixpoint", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1173
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1223
* 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 # <<<<<<<<<<<<<<
@@ -50358,7 +51275,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
(__pyx_v_e_low[0]) = __pyx_v_e_in_low;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1174
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1224
*
* e_low[0] = e_in_low
* e_high[0] = e_in_high # <<<<<<<<<<<<<<
@@ -50367,19 +51284,19 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
(__pyx_v_e_high[0]) = __pyx_v_e_in_high;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1175
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1225
* e_low[0] = e_in_low
* e_high[0] = e_in_high
* self.find_projection(f_low, f_high, f_links_low, f_links_high, e_low, e_high) # <<<<<<<<<<<<<<
* if e_low[0] == -1:
* # low-priority corner case: if phrase w is unaligned,
*/
- __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_f_high); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, __pyx_v_f_low, __pyx_t_1, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_low, __pyx_v_e_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_f_high); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, __pyx_v_f_low, __pyx_t_1, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_low, __pyx_v_e_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1176
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1226
* 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: # <<<<<<<<<<<<<<
@@ -50389,7 +51306,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_3 = ((__pyx_v_e_low[0]) == -1);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1182
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1232
* # rule X -> X_1 w X_2 / X_1 X_2. This is probably
* # not worth the bother, though.
* return 0 # <<<<<<<<<<<<<<
@@ -50401,7 +51318,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
goto __pyx_L3;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1183
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1233
* # not worth the bother, though.
* return 0
* elif e_in_low != -1 and e_low[0] != e_in_low: # <<<<<<<<<<<<<<
@@ -50417,7 +51334,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1184
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1234
* return 0
* elif e_in_low != -1 and e_low[0] != e_in_low:
* if e_in_low - e_low[0] < min_ex_size: # <<<<<<<<<<<<<<
@@ -50427,7 +51344,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_5 = ((__pyx_v_e_in_low - (__pyx_v_e_low[0])) < __pyx_v_min_ex_size);
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1185
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1235
* 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 # <<<<<<<<<<<<<<
@@ -50436,7 +51353,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
(__pyx_v_e_low[0]) = (__pyx_v_e_in_low - __pyx_v_min_ex_size);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1186
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1236
* if e_in_low - e_low[0] < min_ex_size:
* e_low[0] = e_in_low - min_ex_size
* if e_low[0] < 0: # <<<<<<<<<<<<<<
@@ -50446,7 +51363,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_5 = ((__pyx_v_e_low[0]) < 0);
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1187
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1237
* e_low[0] = e_in_low - min_ex_size
* if e_low[0] < 0:
* return 0 # <<<<<<<<<<<<<<
@@ -50465,7 +51382,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1189
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1239
* return 0
*
* if e_high[0] - e_low[0] > max_e_len: # <<<<<<<<<<<<<<
@@ -50475,7 +51392,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_5 = (((__pyx_v_e_high[0]) - (__pyx_v_e_low[0])) > __pyx_v_max_e_len);
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1190
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1240
*
* if e_high[0] - e_low[0] > max_e_len:
* return 0 # <<<<<<<<<<<<<<
@@ -50487,7 +51404,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
goto __pyx_L6;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1191
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1241
* if e_high[0] - e_low[0] > max_e_len:
* return 0
* elif e_in_high != -1 and e_high[0] != e_in_high: # <<<<<<<<<<<<<<
@@ -50503,7 +51420,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1192
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1242
* return 0
* elif e_in_high != -1 and e_high[0] != e_in_high:
* if e_high[0] - e_in_high < min_ex_size: # <<<<<<<<<<<<<<
@@ -50513,7 +51430,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_4 = (((__pyx_v_e_high[0]) - __pyx_v_e_in_high) < __pyx_v_min_ex_size);
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1193
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1243
* 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 # <<<<<<<<<<<<<<
@@ -50522,7 +51439,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
(__pyx_v_e_high[0]) = (__pyx_v_e_in_high + __pyx_v_min_ex_size);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1194
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1244
* 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: # <<<<<<<<<<<<<<
@@ -50532,7 +51449,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_4 = ((__pyx_v_e_high[0]) > __pyx_v_e_sent_len);
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1195
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1245
* e_high[0] = e_in_high + min_ex_size
* if e_high[0] > e_sent_len:
* return 0 # <<<<<<<<<<<<<<
@@ -50551,7 +51468,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L6:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1197
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1247
* return 0
*
* f_back_low[0] = -1 # <<<<<<<<<<<<<<
@@ -50560,7 +51477,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
(__pyx_v_f_back_low[0]) = -1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1198
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1248
*
* f_back_low[0] = -1
* f_back_high[0] = -1 # <<<<<<<<<<<<<<
@@ -50569,7 +51486,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
(__pyx_v_f_back_high[0]) = -1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1199
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1249
* f_back_low[0] = -1
* f_back_high[0] = -1
* f_low_prev = f_low # <<<<<<<<<<<<<<
@@ -50578,17 +51495,17 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
__pyx_v_f_low_prev = __pyx_v_f_low;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1200
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1250
* f_back_high[0] = -1
* f_low_prev = f_low
* f_high_prev = f_high # <<<<<<<<<<<<<<
* new_x = 0
* new_low_x = 0
*/
- __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_f_high); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_f_high); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_f_high_prev = __pyx_t_1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1201
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1251
* f_low_prev = f_low
* f_high_prev = f_high
* new_x = 0 # <<<<<<<<<<<<<<
@@ -50597,7 +51514,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
__pyx_v_new_x = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1202
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1252
* f_high_prev = f_high
* new_x = 0
* new_low_x = 0 # <<<<<<<<<<<<<<
@@ -50606,7 +51523,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
__pyx_v_new_low_x = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1203
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1253
* new_x = 0
* new_low_x = 0
* new_high_x = 0 # <<<<<<<<<<<<<<
@@ -50615,7 +51532,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
__pyx_v_new_high_x = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1205
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1255
* new_high_x = 0
*
* while True: # <<<<<<<<<<<<<<
@@ -50625,7 +51542,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
while (1) {
if (!1) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1207
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1257
* while True:
*
* if f_back_low[0] == -1: # <<<<<<<<<<<<<<
@@ -50635,45 +51552,45 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_4 = ((__pyx_v_f_back_low[0]) == -1);
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1208
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1258
*
* if f_back_low[0] == -1:
* self.find_projection(e_low[0], e_high[0], e_links_low, e_links_high, f_back_low, f_back_high) # <<<<<<<<<<<<<<
* else:
* self.find_projection(e_low[0], e_low_prev, e_links_low, e_links_high, f_back_low, f_back_high)
*/
- __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, (__pyx_v_e_low[0]), (__pyx_v_e_high[0]), __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_f_back_low, __pyx_v_f_back_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, (__pyx_v_e_low[0]), (__pyx_v_e_high[0]), __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_f_back_low, __pyx_v_f_back_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
goto __pyx_L11;
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1210
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1260
* self.find_projection(e_low[0], e_high[0], e_links_low, e_links_high, f_back_low, f_back_high)
* else:
* self.find_projection(e_low[0], e_low_prev, e_links_low, e_links_high, f_back_low, f_back_high) # <<<<<<<<<<<<<<
* self.find_projection(e_high_prev, e_high[0], e_links_low, e_links_high, f_back_low, f_back_high)
*
*/
- __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, (__pyx_v_e_low[0]), __pyx_v_e_low_prev, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_f_back_low, __pyx_v_f_back_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, (__pyx_v_e_low[0]), __pyx_v_e_low_prev, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_f_back_low, __pyx_v_f_back_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1211
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1261
* else:
* self.find_projection(e_low[0], e_low_prev, e_links_low, e_links_high, f_back_low, f_back_high)
* self.find_projection(e_high_prev, e_high[0], e_links_low, e_links_high, f_back_low, f_back_high) # <<<<<<<<<<<<<<
*
* if f_back_low[0] > f_low:
*/
- __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, __pyx_v_e_high_prev, (__pyx_v_e_high[0]), __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_f_back_low, __pyx_v_f_back_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, __pyx_v_e_high_prev, (__pyx_v_e_high[0]), __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_f_back_low, __pyx_v_f_back_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
__pyx_L11:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1213
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1263
* 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: # <<<<<<<<<<<<<<
@@ -50683,7 +51600,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_4 = ((__pyx_v_f_back_low[0]) > __pyx_v_f_low);
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1214
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1264
*
* if f_back_low[0] > f_low:
* f_back_low[0] = f_low # <<<<<<<<<<<<<<
@@ -50695,35 +51612,35 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L12:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1216
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1266
* f_back_low[0] = f_low
*
* if f_back_high[0] < f_high: # <<<<<<<<<<<<<<
* f_back_high[0] = f_high
*
*/
- __pyx_t_2 = PyInt_FromLong((__pyx_v_f_back_high[0])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong((__pyx_v_f_back_high[0])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_v_f_high, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_v_f_high, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1217
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1267
*
* if f_back_high[0] < f_high:
* f_back_high[0] = f_high # <<<<<<<<<<<<<<
*
* if f_back_low[0] == f_low_prev and f_back_high[0] == f_high_prev:
*/
- __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_f_high); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_f_high); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
(__pyx_v_f_back_high[0]) = __pyx_t_1;
goto __pyx_L13;
}
__pyx_L13:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1219
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1269
* f_back_high[0] = f_high
*
* if f_back_low[0] == f_low_prev and f_back_high[0] == f_high_prev: # <<<<<<<<<<<<<<
@@ -50739,7 +51656,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1220
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1270
*
* if f_back_low[0] == f_low_prev and f_back_high[0] == f_high_prev:
* return 1 # <<<<<<<<<<<<<<
@@ -50752,7 +51669,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L14:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1222
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1272
* return 1
*
* if allow_low_x == 0 and f_back_low[0] < f_low: # <<<<<<<<<<<<<<
@@ -50768,7 +51685,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1224
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1274
* if allow_low_x == 0 and f_back_low[0] < f_low:
* # FAIL: f phrase is not tight
* return 0 # <<<<<<<<<<<<<<
@@ -50781,7 +51698,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L15:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1226
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1276
* return 0
*
* if f_back_high[0] - f_back_low[0] > max_f_len: # <<<<<<<<<<<<<<
@@ -50791,7 +51708,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_5 = (((__pyx_v_f_back_high[0]) - (__pyx_v_f_back_low[0])) > __pyx_v_max_f_len);
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1228
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1278
* if f_back_high[0] - f_back_low[0] > max_f_len:
* # FAIL: f back projection is too wide
* return 0 # <<<<<<<<<<<<<<
@@ -50804,7 +51721,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L16:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1230
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1280
* return 0
*
* if allow_high_x == 0 and f_back_high[0] > f_high: # <<<<<<<<<<<<<<
@@ -50813,11 +51730,11 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
__pyx_t_5 = (__pyx_v_allow_high_x == 0);
if (__pyx_t_5) {
- __pyx_t_6 = PyInt_FromLong((__pyx_v_f_back_high[0])); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyInt_FromLong((__pyx_v_f_back_high[0])); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_v_f_high, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_v_f_high, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_4 = __pyx_t_3;
} else {
@@ -50825,7 +51742,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1232
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1282
* if allow_high_x == 0 and f_back_high[0] > f_high:
* # FAIL: extension on high side not allowed
* return 0 # <<<<<<<<<<<<<<
@@ -50838,7 +51755,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L17:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1234
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1284
* return 0
*
* if f_low != f_back_low[0]: # <<<<<<<<<<<<<<
@@ -50848,7 +51765,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_4 = (__pyx_v_f_low != (__pyx_v_f_back_low[0]));
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1235
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1285
*
* if f_low != f_back_low[0]:
* if new_low_x == 0: # <<<<<<<<<<<<<<
@@ -50858,7 +51775,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_4 = (__pyx_v_new_low_x == 0);
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1236
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1286
* if f_low != f_back_low[0]:
* if new_low_x == 0:
* if new_x >= max_new_x: # <<<<<<<<<<<<<<
@@ -50868,7 +51785,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_4 = (__pyx_v_new_x >= __pyx_v_max_new_x);
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1238
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1288
* if new_x >= max_new_x:
* # FAIL: extension required on low side violates max # of gaps
* return 0 # <<<<<<<<<<<<<<
@@ -50881,7 +51798,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1240
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1290
* return 0
* else:
* new_x = new_x + 1 # <<<<<<<<<<<<<<
@@ -50890,7 +51807,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
__pyx_v_new_x = (__pyx_v_new_x + 1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1241
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1291
* else:
* new_x = new_x + 1
* new_low_x = 1 # <<<<<<<<<<<<<<
@@ -50904,7 +51821,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L19:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1242
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1292
* new_x = new_x + 1
* new_low_x = 1
* if f_low - f_back_low[0] < min_fx_size: # <<<<<<<<<<<<<<
@@ -50914,7 +51831,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_4 = ((__pyx_v_f_low - (__pyx_v_f_back_low[0])) < __pyx_v_min_fx_size);
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1243
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1293
* new_low_x = 1
* if f_low - f_back_low[0] < min_fx_size:
* f_back_low[0] = f_low - min_fx_size # <<<<<<<<<<<<<<
@@ -50923,7 +51840,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
(__pyx_v_f_back_low[0]) = (__pyx_v_f_low - __pyx_v_min_fx_size);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1244
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1294
* 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: # <<<<<<<<<<<<<<
@@ -50933,7 +51850,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_4 = (((__pyx_v_f_back_high[0]) - (__pyx_v_f_back_low[0])) > __pyx_v_max_f_len);
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1246
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1296
* if f_back_high[0] - f_back_low[0] > max_f_len:
* # FAIL: extension required on low side violates max initial length
* return 0 # <<<<<<<<<<<<<<
@@ -50946,7 +51863,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L22:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1247
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1297
* # FAIL: extension required on low side violates max initial length
* return 0
* if f_back_low[0] < 0: # <<<<<<<<<<<<<<
@@ -50956,7 +51873,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_4 = ((__pyx_v_f_back_low[0]) < 0);
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1249
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1299
* if f_back_low[0] < 0:
* # FAIL: extension required on low side violates sentence boundary
* return 0 # <<<<<<<<<<<<<<
@@ -50975,22 +51892,22 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L18:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1251
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1301
* return 0
*
* if f_high != f_back_high[0]: # <<<<<<<<<<<<<<
* if new_high_x == 0:
* if new_x >= max_new_x:
*/
- __pyx_t_2 = PyInt_FromLong((__pyx_v_f_back_high[0])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong((__pyx_v_f_back_high[0])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = PyObject_RichCompare(__pyx_v_f_high, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_RichCompare(__pyx_v_f_high, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1252
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1302
*
* if f_high != f_back_high[0]:
* if new_high_x == 0: # <<<<<<<<<<<<<<
@@ -51000,7 +51917,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_4 = (__pyx_v_new_high_x == 0);
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1253
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1303
* if f_high != f_back_high[0]:
* if new_high_x == 0:
* if new_x >= max_new_x: # <<<<<<<<<<<<<<
@@ -51010,7 +51927,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_4 = (__pyx_v_new_x >= __pyx_v_max_new_x);
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1255
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1305
* if new_x >= max_new_x:
* # FAIL: extension required on high side violates max # of gaps
* return 0 # <<<<<<<<<<<<<<
@@ -51023,7 +51940,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1257
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1307
* return 0
* else:
* new_x = new_x + 1 # <<<<<<<<<<<<<<
@@ -51032,7 +51949,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
__pyx_v_new_x = (__pyx_v_new_x + 1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1258
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1308
* else:
* new_x = new_x + 1
* new_high_x = 1 # <<<<<<<<<<<<<<
@@ -51046,44 +51963,44 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L25:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1259
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1309
* new_x = new_x + 1
* new_high_x = 1
* if f_back_high[0] - f_high < min_fx_size: # <<<<<<<<<<<<<<
* f_back_high[0] = f_high + min_fx_size
* if f_back_high[0] - f_back_low[0] > max_f_len:
*/
- __pyx_t_6 = PyInt_FromLong((__pyx_v_f_back_high[0])); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyInt_FromLong((__pyx_v_f_back_high[0])); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_2 = PyNumber_Subtract(__pyx_t_6, __pyx_v_f_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Subtract(__pyx_t_6, __pyx_v_f_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyInt_FromLong(__pyx_v_min_fx_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyInt_FromLong(__pyx_v_min_fx_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1260
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1310
* new_high_x = 1
* if f_back_high[0] - f_high < min_fx_size:
* f_back_high[0] = f_high + min_fx_size # <<<<<<<<<<<<<<
* if f_back_high[0] - f_back_low[0] > max_f_len:
* # FAIL: extension required on high side violates max initial length
*/
- __pyx_t_7 = PyInt_FromLong(__pyx_v_min_fx_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyInt_FromLong(__pyx_v_min_fx_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = PyNumber_Add(__pyx_v_f_high, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyNumber_Add(__pyx_v_f_high, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_t_6); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_t_6); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
(__pyx_v_f_back_high[0]) = __pyx_t_1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1261
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1311
* 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: # <<<<<<<<<<<<<<
@@ -51093,7 +52010,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_4 = (((__pyx_v_f_back_high[0]) - (__pyx_v_f_back_low[0])) > __pyx_v_max_f_len);
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1263
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1313
* if f_back_high[0] - f_back_low[0] > max_f_len:
* # FAIL: extension required on high side violates max initial length
* return 0 # <<<<<<<<<<<<<<
@@ -51106,7 +52023,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L28:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1264
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1314
* # FAIL: extension required on high side violates max initial length
* return 0
* if f_back_high[0] > f_sent_len: # <<<<<<<<<<<<<<
@@ -51116,7 +52033,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_4 = ((__pyx_v_f_back_high[0]) > __pyx_v_f_sent_len);
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1266
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1316
* if f_back_high[0] > f_sent_len:
* # FAIL: extension required on high side violates sentence boundary
* return 0 # <<<<<<<<<<<<<<
@@ -51135,7 +52052,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L24:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1268
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1318
* return 0
*
* e_low_prev = e_low[0] # <<<<<<<<<<<<<<
@@ -51144,7 +52061,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
__pyx_v_e_low_prev = (__pyx_v_e_low[0]);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1269
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1319
*
* e_low_prev = e_low[0]
* e_high_prev = e_high[0] # <<<<<<<<<<<<<<
@@ -51153,29 +52070,29 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
__pyx_v_e_high_prev = (__pyx_v_e_high[0]);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1271
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1321
* e_high_prev = e_high[0]
*
* self.find_projection(f_back_low[0], f_low_prev, f_links_low, f_links_high, e_low, e_high) # <<<<<<<<<<<<<<
* self.find_projection(f_high_prev, f_back_high[0], f_links_low, f_links_high, e_low, e_high)
* if e_low[0] == e_low_prev and e_high[0] == e_high_prev:
*/
- __pyx_t_6 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, (__pyx_v_f_back_low[0]), __pyx_v_f_low_prev, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_low, __pyx_v_e_high); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, (__pyx_v_f_back_low[0]), __pyx_v_f_low_prev, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_low, __pyx_v_e_high); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1272
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1322
*
* self.find_projection(f_back_low[0], f_low_prev, f_links_low, f_links_high, e_low, e_high)
* self.find_projection(f_high_prev, f_back_high[0], f_links_low, f_links_high, e_low, e_high) # <<<<<<<<<<<<<<
* if e_low[0] == e_low_prev and e_high[0] == e_high_prev:
* return 1
*/
- __pyx_t_6 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, __pyx_v_f_high_prev, (__pyx_v_f_back_high[0]), __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_low, __pyx_v_e_high); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, __pyx_v_f_high_prev, (__pyx_v_f_back_high[0]), __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_low, __pyx_v_e_high); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1273
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1323
* self.find_projection(f_back_low[0], f_low_prev, f_links_low, f_links_high, e_low, e_high)
* self.find_projection(f_high_prev, f_back_high[0], f_links_low, f_links_high, e_low, e_high)
* if e_low[0] == e_low_prev and e_high[0] == e_high_prev: # <<<<<<<<<<<<<<
@@ -51191,7 +52108,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1274
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1324
* 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 # <<<<<<<<<<<<<<
@@ -51204,7 +52121,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L30:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1275
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1325
* if e_low[0] == e_low_prev and e_high[0] == e_high_prev:
* return 1
* if allow_arbitrary_x == 0: # <<<<<<<<<<<<<<
@@ -51214,7 +52131,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_3 = (__pyx_v_allow_arbitrary_x == 0);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1277
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1327
* if allow_arbitrary_x == 0:
* # FAIL: arbitrary expansion not permitted
* return 0 # <<<<<<<<<<<<<<
@@ -51227,7 +52144,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L31:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1278
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1328
* # FAIL: arbitrary expansion not permitted
* return 0
* if e_high[0] - e_low[0] > max_e_len: # <<<<<<<<<<<<<<
@@ -51237,7 +52154,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_3 = (((__pyx_v_e_high[0]) - (__pyx_v_e_low[0])) > __pyx_v_max_e_len);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1280
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1330
* if e_high[0] - e_low[0] > max_e_len:
* # FAIL: re-projection violates sentence max phrase length
* return 0 # <<<<<<<<<<<<<<
@@ -51250,7 +52167,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L32:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1281
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1331
* # FAIL: re-projection violates sentence max phrase length
* return 0
* f_low_prev = f_back_low[0] # <<<<<<<<<<<<<<
@@ -51259,7 +52176,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
__pyx_v_f_low_prev = (__pyx_v_f_back_low[0]);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1282
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1332
* return 0
* f_low_prev = f_back_low[0]
* f_high_prev = f_back_high[0] # <<<<<<<<<<<<<<
@@ -51282,7 +52199,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1285
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1335
*
*
* cdef find_projection(self, int in_low, int in_high, int* in_links_low, int* in_links_high, # <<<<<<<<<<<<<<
@@ -51300,7 +52217,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_find_projection(CYTHON_U
int __pyx_t_4;
__Pyx_RefNannySetupContext("find_projection", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1288
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1338
* int* out_low, int* out_high):
* cdef int i
* for i from in_low <= i < in_high: # <<<<<<<<<<<<<<
@@ -51310,7 +52227,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_find_projection(CYTHON_U
__pyx_t_1 = __pyx_v_in_high;
for (__pyx_v_i = __pyx_v_in_low; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1289
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1339
* cdef int i
* for i from in_low <= i < in_high:
* if in_links_low[i] != -1: # <<<<<<<<<<<<<<
@@ -51320,7 +52237,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_find_projection(CYTHON_U
__pyx_t_2 = ((__pyx_v_in_links_low[__pyx_v_i]) != -1);
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1290
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1340
* 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]: # <<<<<<<<<<<<<<
@@ -51336,7 +52253,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_find_projection(CYTHON_U
}
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1291
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1341
* 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] # <<<<<<<<<<<<<<
@@ -51348,7 +52265,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_find_projection(CYTHON_U
}
__pyx_L6:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1292
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1342
* 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]: # <<<<<<<<<<<<<<
@@ -51364,7 +52281,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_find_projection(CYTHON_U
}
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1293
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1343
* 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] # <<<<<<<<<<<<<<
@@ -51386,7 +52303,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_find_projection(CYTHON_U
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1296
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1346
*
*
* cdef int* int_arr_extend(self, int* arr, int* arr_len, int* data, int data_len): # <<<<<<<<<<<<<<
@@ -51400,7 +52317,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTHON_UNUSED
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("int_arr_extend", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1298
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1348
* 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 # <<<<<<<<<<<<<<
@@ -51409,7 +52326,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTHON_UNUSED
*/
__pyx_v_new_len = ((__pyx_v_arr_len[0]) + __pyx_v_data_len);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1299
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1349
* cdef int new_len
* new_len = arr_len[0] + data_len
* arr = <int*> realloc(arr, new_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -51418,7 +52335,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTHON_UNUSED
*/
__pyx_v_arr = ((int *)realloc(__pyx_v_arr, (__pyx_v_new_len * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1300
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1350
* 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)) # <<<<<<<<<<<<<<
@@ -51427,7 +52344,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTHON_UNUSED
*/
memcpy((__pyx_v_arr + (__pyx_v_arr_len[0])), __pyx_v_data, (__pyx_v_data_len * (sizeof(int))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1301
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1351
* arr = <int*> realloc(arr, new_len*sizeof(int))
* memcpy(arr+arr_len[0], data, data_len*sizeof(int))
* arr_len[0] = new_len # <<<<<<<<<<<<<<
@@ -51436,7 +52353,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTHON_UNUSED
*/
(__pyx_v_arr_len[0]) = __pyx_v_new_len;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1302
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1352
* memcpy(arr+arr_len[0], data, data_len*sizeof(int))
* arr_len[0] = new_len
* return arr # <<<<<<<<<<<<<<
@@ -51452,7 +52369,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTHON_UNUSED
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1305
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1355
*
*
* 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, # <<<<<<<<<<<<<<
@@ -51498,19 +52415,19 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("extract_phrases", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1313
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1363
* cdef result
*
* result = [] # <<<<<<<<<<<<<<
* len1 = 0
* e_gaps1 = <int*> malloc(0)
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_result = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1314
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1364
*
* result = []
* len1 = 0 # <<<<<<<<<<<<<<
@@ -51519,7 +52436,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_len1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1315
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1365
* result = []
* len1 = 0
* e_gaps1 = <int*> malloc(0) # <<<<<<<<<<<<<<
@@ -51528,19 +52445,19 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_e_gaps1 = ((int *)malloc(0));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1316
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1366
* len1 = 0
* e_gaps1 = <int*> malloc(0)
* ephr_arr = IntList() # <<<<<<<<<<<<<<
*
* e_gap_order = <int*> malloc(num_gaps*sizeof(int))
*/
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ephr_arr = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1318
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1368
* ephr_arr = IntList()
*
* e_gap_order = <int*> malloc(num_gaps*sizeof(int)) # <<<<<<<<<<<<<<
@@ -51549,7 +52466,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_e_gap_order = ((int *)malloc((__pyx_v_num_gaps * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1319
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1369
*
* e_gap_order = <int*> malloc(num_gaps*sizeof(int))
* if num_gaps > 0: # <<<<<<<<<<<<<<
@@ -51559,7 +52476,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_2 = (__pyx_v_num_gaps > 0);
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1320
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1370
* e_gap_order = <int*> malloc(num_gaps*sizeof(int))
* if num_gaps > 0:
* e_gap_order[0] = 0 # <<<<<<<<<<<<<<
@@ -51568,7 +52485,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
(__pyx_v_e_gap_order[0]) = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1321
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1371
* if num_gaps > 0:
* e_gap_order[0] = 0
* for i from 1 <= i < num_gaps: # <<<<<<<<<<<<<<
@@ -51578,7 +52495,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_3 = __pyx_v_num_gaps;
for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1322
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1372
* e_gap_order[0] = 0
* for i from 1 <= i < num_gaps:
* for j from 0 <= j < i: # <<<<<<<<<<<<<<
@@ -51588,7 +52505,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_4 = __pyx_v_i;
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_4; __pyx_v_j++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1323
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1373
* for i from 1 <= i < num_gaps:
* for j from 0 <= j < i:
* if e_gap_low[i] < e_gap_low[j]: # <<<<<<<<<<<<<<
@@ -51598,7 +52515,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_2 = ((__pyx_v_e_gap_low[__pyx_v_i]) < (__pyx_v_e_gap_low[__pyx_v_j]));
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1324
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1374
* for j from 0 <= j < i:
* if e_gap_low[i] < e_gap_low[j]:
* for k from j <= k < i: # <<<<<<<<<<<<<<
@@ -51608,7 +52525,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_5 = __pyx_v_i;
for (__pyx_v_k = __pyx_v_j; __pyx_v_k < __pyx_t_5; __pyx_v_k++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1325
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1375
* if e_gap_low[i] < e_gap_low[j]:
* for k from j <= k < i:
* e_gap_order[k+1] = e_gap_order[k] # <<<<<<<<<<<<<<
@@ -51618,7 +52535,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
(__pyx_v_e_gap_order[(__pyx_v_k + 1)]) = (__pyx_v_e_gap_order[__pyx_v_k]);
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1326
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1376
* for k from j <= k < i:
* e_gap_order[k+1] = e_gap_order[k]
* e_gap_order[j] = i # <<<<<<<<<<<<<<
@@ -51627,7 +52544,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
(__pyx_v_e_gap_order[__pyx_v_j]) = __pyx_v_i;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1327
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1377
* e_gap_order[k+1] = e_gap_order[k]
* e_gap_order[j] = i
* break # <<<<<<<<<<<<<<
@@ -51641,7 +52558,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1329
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1379
* break
* else:
* e_gap_order[i] = i # <<<<<<<<<<<<<<
@@ -51656,7 +52573,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1331
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1381
* e_gap_order[i] = i
*
* e_x_low = e_low # <<<<<<<<<<<<<<
@@ -51665,7 +52582,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_e_x_low = __pyx_v_e_low;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1332
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1382
*
* e_x_low = e_low
* e_x_high = e_high # <<<<<<<<<<<<<<
@@ -51674,7 +52591,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_e_x_high = __pyx_v_e_high;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1333
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1383
* e_x_low = e_low
* e_x_high = e_high
* if not self.tight_phrases: # <<<<<<<<<<<<<<
@@ -51684,7 +52601,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_2 = (!__pyx_v_self->tight_phrases);
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1334
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1384
* 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: # <<<<<<<<<<<<<<
@@ -51707,7 +52624,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
if (!__pyx_t_6) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1335
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1385
* 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 # <<<<<<<<<<<<<<
@@ -51717,7 +52634,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_v_e_x_low = (__pyx_v_e_x_low - 1);
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1336
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1386
* 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: # <<<<<<<<<<<<<<
@@ -51740,7 +52657,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
if (!__pyx_t_2) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1337
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1387
* 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 # <<<<<<<<<<<<<<
@@ -51753,7 +52670,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
__pyx_L11:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1339
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1389
* e_x_high = e_x_high + 1
*
* for i from e_x_low <= i <= e_low: # <<<<<<<<<<<<<<
@@ -51763,7 +52680,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_3 = __pyx_v_e_low;
for (__pyx_v_i = __pyx_v_e_x_low; __pyx_v_i <= __pyx_t_3; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1340
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1390
*
* for i from e_x_low <= i <= e_low:
* e_gaps1 = self.int_arr_extend(e_gaps1, &len1, &i, 1) # <<<<<<<<<<<<<<
@@ -51773,7 +52690,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_v_e_gaps1 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps1, (&__pyx_v_len1), (&__pyx_v_i), 1);
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1342
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1392
* e_gaps1 = self.int_arr_extend(e_gaps1, &len1, &i, 1)
*
* for i from 0 <= i < num_gaps: # <<<<<<<<<<<<<<
@@ -51783,7 +52700,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_3 = __pyx_v_num_gaps;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1343
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1393
*
* for i from 0 <= i < num_gaps:
* e_gaps2 = <int*> malloc(0) # <<<<<<<<<<<<<<
@@ -51792,7 +52709,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_e_gaps2 = ((int *)malloc(0));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1344
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1394
* for i from 0 <= i < num_gaps:
* e_gaps2 = <int*> malloc(0)
* len2 = 0 # <<<<<<<<<<<<<<
@@ -51801,7 +52718,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_len2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1346
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1396
* len2 = 0
*
* j = e_gap_order[i] # <<<<<<<<<<<<<<
@@ -51810,7 +52727,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_j = (__pyx_v_e_gap_order[__pyx_v_i]);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1347
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1397
*
* j = e_gap_order[i]
* e_x_gap_low = e_gap_low[j] # <<<<<<<<<<<<<<
@@ -51819,7 +52736,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_e_x_gap_low = (__pyx_v_e_gap_low[__pyx_v_j]);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1348
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1398
* j = e_gap_order[i]
* e_x_gap_low = e_gap_low[j]
* e_x_gap_high = e_gap_high[j] # <<<<<<<<<<<<<<
@@ -51828,7 +52745,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_e_x_gap_high = (__pyx_v_e_gap_high[__pyx_v_j]);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1349
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1399
* e_x_gap_low = e_gap_low[j]
* e_x_gap_high = e_gap_high[j]
* if not self.tight_phrases: # <<<<<<<<<<<<<<
@@ -51838,7 +52755,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_2 = (!__pyx_v_self->tight_phrases);
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1350
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1400
* 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: # <<<<<<<<<<<<<<
@@ -51855,7 +52772,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
if (!__pyx_t_7) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1351
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1401
* 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 # <<<<<<<<<<<<<<
@@ -51865,7 +52782,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_v_e_x_gap_low = (__pyx_v_e_x_gap_low - 1);
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1352
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1402
* 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: # <<<<<<<<<<<<<<
@@ -51882,7 +52799,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
if (!__pyx_t_6) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1353
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1403
* 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 # <<<<<<<<<<<<<<
@@ -51895,7 +52812,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
__pyx_L20:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1355
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1405
* e_x_gap_high = e_x_gap_high + 1
*
* k = 0 # <<<<<<<<<<<<<<
@@ -51904,7 +52821,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_k = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1356
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1406
*
* k = 0
* step = 1+(i*2) # <<<<<<<<<<<<<<
@@ -51913,7 +52830,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_step = (1 + (__pyx_v_i * 2));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1357
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1407
* k = 0
* step = 1+(i*2)
* while k < len1: # <<<<<<<<<<<<<<
@@ -51924,7 +52841,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_6 = (__pyx_v_k < __pyx_v_len1);
if (!__pyx_t_6) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1358
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1408
* step = 1+(i*2)
* while k < len1:
* for m from e_x_gap_low <= m <= e_gap_low[j]: # <<<<<<<<<<<<<<
@@ -51934,7 +52851,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_4 = (__pyx_v_e_gap_low[__pyx_v_j]);
for (__pyx_v_m = __pyx_v_e_x_gap_low; __pyx_v_m <= __pyx_t_4; __pyx_v_m++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1359
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1409
* while k < len1:
* for m from e_x_gap_low <= m <= e_gap_low[j]:
* if m >= e_gaps1[k+step-1]: # <<<<<<<<<<<<<<
@@ -51944,7 +52861,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_6 = (__pyx_v_m >= (__pyx_v_e_gaps1[((__pyx_v_k + __pyx_v_step) - 1)]));
if (__pyx_t_6) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1360
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1410
* 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: # <<<<<<<<<<<<<<
@@ -51954,7 +52871,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_5 = __pyx_v_e_x_gap_high;
for (__pyx_v_n = (__pyx_v_e_gap_high[__pyx_v_j]); __pyx_v_n <= __pyx_t_5; __pyx_v_n++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1361
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1411
* 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 # <<<<<<<<<<<<<<
@@ -51964,7 +52881,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_6 = ((__pyx_v_n - __pyx_v_m) >= 1);
if (__pyx_t_6) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1362
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1412
* 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) # <<<<<<<<<<<<<<
@@ -51973,7 +52890,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_e_gaps2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps2, (&__pyx_v_len2), (__pyx_v_e_gaps1 + __pyx_v_k), __pyx_v_step);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1363
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1413
* 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) # <<<<<<<<<<<<<<
@@ -51982,7 +52899,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_e_gaps2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps2, (&__pyx_v_len2), (&__pyx_v_m), 1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1364
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1414
* 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) # <<<<<<<<<<<<<<
@@ -51999,7 +52916,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_L29:;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1365
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1415
* 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 # <<<<<<<<<<<<<<
@@ -52009,7 +52926,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_v_k = (__pyx_v_k + __pyx_v_step);
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1366
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1416
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &n, 1)
* k = k + step
* free(e_gaps1) # <<<<<<<<<<<<<<
@@ -52018,7 +52935,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
free(__pyx_v_e_gaps1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1367
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1417
* k = k + step
* free(e_gaps1)
* e_gaps1 = e_gaps2 # <<<<<<<<<<<<<<
@@ -52027,7 +52944,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_e_gaps1 = __pyx_v_e_gaps2;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1368
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1418
* free(e_gaps1)
* e_gaps1 = e_gaps2
* len1 = len2 # <<<<<<<<<<<<<<
@@ -52037,7 +52954,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_v_len1 = __pyx_v_len2;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1370
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1420
* len1 = len2
*
* step = 1+(num_gaps*2) # <<<<<<<<<<<<<<
@@ -52046,7 +52963,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_step = (1 + (__pyx_v_num_gaps * 2));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1371
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1421
*
* step = 1+(num_gaps*2)
* e_gaps2 = <int*> malloc(0) # <<<<<<<<<<<<<<
@@ -52055,7 +52972,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_e_gaps2 = ((int *)malloc(0));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1372
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1422
* step = 1+(num_gaps*2)
* e_gaps2 = <int*> malloc(0)
* len2 = 0 # <<<<<<<<<<<<<<
@@ -52064,7 +52981,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_len2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1373
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1423
* e_gaps2 = <int*> malloc(0)
* len2 = 0
* for i from e_high <= i <= e_x_high: # <<<<<<<<<<<<<<
@@ -52074,7 +52991,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_3 = __pyx_v_e_x_high;
for (__pyx_v_i = __pyx_v_e_high; __pyx_v_i <= __pyx_t_3; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1374
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1424
* len2 = 0
* for i from e_high <= i <= e_x_high:
* j = 0 # <<<<<<<<<<<<<<
@@ -52083,7 +53000,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_j = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1375
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1425
* for i from e_high <= i <= e_x_high:
* j = 0
* while j < len1: # <<<<<<<<<<<<<<
@@ -52094,7 +53011,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_6 = (__pyx_v_j < __pyx_v_len1);
if (!__pyx_t_6) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1376
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1426
* j = 0
* while j < len1:
* if i - e_gaps1[j] <= self.train_max_initial_size and i >= e_gaps1[j+step-1]: # <<<<<<<<<<<<<<
@@ -52110,7 +53027,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1377
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1427
* 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) # <<<<<<<<<<<<<<
@@ -52119,7 +53036,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_e_gaps2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps2, (&__pyx_v_len2), (__pyx_v_e_gaps1 + __pyx_v_j), __pyx_v_step);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1378
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1428
* 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) # <<<<<<<<<<<<<<
@@ -52131,7 +53048,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
__pyx_L37:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1379
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1429
* 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 # <<<<<<<<<<<<<<
@@ -52142,7 +53059,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1380
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1430
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &i, 1)
* j = j + step
* free(e_gaps1) # <<<<<<<<<<<<<<
@@ -52151,7 +53068,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
free(__pyx_v_e_gaps1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1381
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1431
* j = j + step
* free(e_gaps1)
* e_gaps1 = e_gaps2 # <<<<<<<<<<<<<<
@@ -52160,7 +53077,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_e_gaps1 = __pyx_v_e_gaps2;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1382
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1432
* free(e_gaps1)
* e_gaps1 = e_gaps2
* len1 = len2 # <<<<<<<<<<<<<<
@@ -52169,7 +53086,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_len1 = __pyx_v_len2;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1384
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1434
* len1 = len2
*
* step = (num_gaps+1)*2 # <<<<<<<<<<<<<<
@@ -52178,7 +53095,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_step = ((__pyx_v_num_gaps + 1) * 2);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1385
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1435
*
* step = (num_gaps+1)*2
* i = 0 # <<<<<<<<<<<<<<
@@ -52187,7 +53104,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_i = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1387
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1437
* i = 0
*
* while i < len1: # <<<<<<<<<<<<<<
@@ -52198,7 +53115,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_2 = (__pyx_v_i < __pyx_v_len1);
if (!__pyx_t_2) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1388
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1438
*
* while i < len1:
* ephr_arr._clear() # <<<<<<<<<<<<<<
@@ -52207,7 +53124,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_ephr_arr->__pyx_vtab)->_clear(__pyx_v_ephr_arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1389
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1439
* while i < len1:
* ephr_arr._clear()
* num_chunks = 0 # <<<<<<<<<<<<<<
@@ -52216,20 +53133,20 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_num_chunks = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1390
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1440
* ephr_arr._clear()
* num_chunks = 0
* indexes = [] # <<<<<<<<<<<<<<
* for j from 0 <= j < num_gaps+1:
* if e_gaps1[i+2*j] < e_gaps1[i+(2*j)+1]:
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_XDECREF(((PyObject *)__pyx_v_indexes));
__pyx_v_indexes = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1391
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1441
* num_chunks = 0
* indexes = []
* for j from 0 <= j < num_gaps+1: # <<<<<<<<<<<<<<
@@ -52239,7 +53156,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_9 = (__pyx_v_num_gaps + 1);
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_9; __pyx_v_j++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1392
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1442
* indexes = []
* for j from 0 <= j < num_gaps+1:
* if e_gaps1[i+2*j] < e_gaps1[i+(2*j)+1]: # <<<<<<<<<<<<<<
@@ -52249,7 +53166,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_2 = ((__pyx_v_e_gaps1[(__pyx_v_i + (2 * __pyx_v_j))]) < (__pyx_v_e_gaps1[((__pyx_v_i + (2 * __pyx_v_j)) + 1)]));
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1393
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1443
* 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 # <<<<<<<<<<<<<<
@@ -52261,7 +53178,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
__pyx_L42:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1394
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1444
* 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]: # <<<<<<<<<<<<<<
@@ -52271,19 +53188,19 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_3 = (__pyx_v_e_gaps1[((__pyx_v_i + (2 * __pyx_v_j)) + 1)]);
for (__pyx_v_k = (__pyx_v_e_gaps1[(__pyx_v_i + (2 * __pyx_v_j))]); __pyx_v_k < __pyx_t_3; __pyx_v_k++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1395
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1445
* num_chunks = num_chunks + 1
* for k from e_gaps1[i+2*j] <= k < e_gaps1[i+(2*j)+1]:
* indexes.append(k) # <<<<<<<<<<<<<<
* ephr_arr._append(self.eid2symid[self.eda.data.arr[e_sent_start+k]])
* if j < num_gaps:
*/
- __pyx_t_1 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_10 = PyList_Append(__pyx_v_indexes, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyList_Append(__pyx_v_indexes, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1396
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1446
* 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]]) # <<<<<<<<<<<<<<
@@ -52291,14 +53208,14 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
* indexes.append(sym_setindex(self.category, e_gap_order[j]+1))
*/
__pyx_t_4 = (__pyx_v_self->eda->data->arr[(__pyx_v_e_sent_start + __pyx_v_k)]);
- __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->eid2symid), __pyx_t_4, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->eid2symid), __pyx_t_4, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_ephr_arr->__pyx_vtab)->_append(__pyx_v_ephr_arr, __pyx_t_4);
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1397
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1447
* indexes.append(k)
* ephr_arr._append(self.eid2symid[self.eda.data.arr[e_sent_start+k]])
* if j < num_gaps: # <<<<<<<<<<<<<<
@@ -52308,19 +53225,19 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_2 = (__pyx_v_j < __pyx_v_num_gaps);
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1398
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1448
* ephr_arr._append(self.eid2symid[self.eda.data.arr[e_sent_start+k]])
* if j < num_gaps:
* indexes.append(sym_setindex(self.category, e_gap_order[j]+1)) # <<<<<<<<<<<<<<
* ephr_arr._append(sym_setindex(self.category, e_gap_order[j]+1))
* i = i + step
*/
- __pyx_t_1 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, ((__pyx_v_e_gap_order[__pyx_v_j]) + 1))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, ((__pyx_v_e_gap_order[__pyx_v_j]) + 1))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_10 = PyList_Append(__pyx_v_indexes, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyList_Append(__pyx_v_indexes, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1399
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1449
* 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)) # <<<<<<<<<<<<<<
@@ -52333,7 +53250,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_L45:;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1400
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1450
* 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 # <<<<<<<<<<<<<<
@@ -52342,7 +53259,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_i = (__pyx_v_i + __pyx_v_step);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1401
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1451
* 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: # <<<<<<<<<<<<<<
@@ -52358,22 +53275,22 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1402
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1452
* i = i + step
* if ephr_arr.len <= self.max_target_length and num_chunks <= self.max_target_chunks:
* result.append((Phrase(ephr_arr),indexes)) # <<<<<<<<<<<<<<
*
* free(e_gaps1)
*/
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_ephr_arr));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_ephr_arr));
__Pyx_GIVEREF(((PyObject *)__pyx_v_ephr_arr));
- __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_11);
__Pyx_GIVEREF(__pyx_t_11);
@@ -52381,7 +53298,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_indexes));
__Pyx_GIVEREF(((PyObject *)__pyx_v_indexes));
__pyx_t_11 = 0;
- __pyx_t_11 = __Pyx_PyObject_Append(__pyx_v_result, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_PyObject_Append(__pyx_v_result, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
@@ -52390,7 +53307,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_L46:;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1404
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1454
* result.append((Phrase(ephr_arr),indexes))
*
* free(e_gaps1) # <<<<<<<<<<<<<<
@@ -52399,7 +53316,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
free(__pyx_v_e_gaps1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1405
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1455
*
* free(e_gaps1)
* free(e_gap_order) # <<<<<<<<<<<<<<
@@ -52408,7 +53325,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
free(__pyx_v_e_gap_order);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1406
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1456
* free(e_gaps1)
* free(e_gap_order)
* return result # <<<<<<<<<<<<<<
@@ -52436,7 +53353,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1408
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1458
* return result
*
* cdef IntList create_alignments(self, int* sent_links, int num_links, findexes, eindexes): # <<<<<<<<<<<<<<
@@ -52464,55 +53381,55 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("create_alignments", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1410
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1460
* cdef IntList create_alignments(self, int* sent_links, int num_links, findexes, eindexes):
* cdef unsigned i
* cdef IntList ret = IntList() # <<<<<<<<<<<<<<
* for i in range(len(findexes)):
* s = findexes[i]
*/
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ret = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1411
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1461
* cdef unsigned i
* cdef IntList ret = IntList()
* for i in range(len(findexes)): # <<<<<<<<<<<<<<
* s = findexes[i]
* if (s<0):
*/
- __pyx_t_2 = PyObject_Length(__pyx_v_findexes); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Length(__pyx_v_findexes); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1412
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1462
* cdef IntList ret = IntList()
* for i in range(len(findexes)):
* s = findexes[i] # <<<<<<<<<<<<<<
* if (s<0):
* continue
*/
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_findexes, __pyx_v_i, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_findexes, __pyx_v_i, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_v_s);
__pyx_v_s = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1413
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1463
* for i in range(len(findexes)):
* s = findexes[i]
* if (s<0): # <<<<<<<<<<<<<<
* continue
* idx = 0
*/
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_s, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_s, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1414
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1464
* s = findexes[i]
* if (s<0):
* continue # <<<<<<<<<<<<<<
@@ -52524,7 +53441,7 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1415
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1465
* if (s<0):
* continue
* idx = 0 # <<<<<<<<<<<<<<
@@ -52535,7 +53452,7 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre
__Pyx_XDECREF(__pyx_v_idx);
__pyx_v_idx = __pyx_int_0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1416
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1466
* continue
* idx = 0
* while (idx < num_links*2): # <<<<<<<<<<<<<<
@@ -52543,51 +53460,51 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre
* j = eindexes.index(sent_links[idx+1])
*/
while (1) {
- __pyx_t_1 = PyInt_FromLong((__pyx_v_num_links * 2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong((__pyx_v_num_links * 2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyObject_RichCompare(__pyx_v_idx, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_RichCompare(__pyx_v_idx, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (!__pyx_t_4) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1417
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1467
* idx = 0
* while (idx < num_links*2):
* if (sent_links[idx] == s): # <<<<<<<<<<<<<<
* j = eindexes.index(sent_links[idx+1])
* ret.append(i*65536+j)
*/
- __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_5 = PyInt_FromLong((__pyx_v_sent_links[__pyx_t_6])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyInt_FromLong((__pyx_v_sent_links[__pyx_t_6])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_v_s, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_v_s, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1418
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1468
* while (idx < num_links*2):
* if (sent_links[idx] == s):
* j = eindexes.index(sent_links[idx+1]) # <<<<<<<<<<<<<<
* ret.append(i*65536+j)
* idx += 2
*/
- __pyx_t_1 = PyObject_GetAttr(__pyx_v_eindexes, __pyx_n_s__index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(__pyx_v_eindexes, __pyx_n_s__index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyNumber_Add(__pyx_v_idx, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyNumber_Add(__pyx_v_idx, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyInt_FromLong((__pyx_v_sent_links[__pyx_t_6])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyInt_FromLong((__pyx_v_sent_links[__pyx_t_6])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
__pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
@@ -52595,19 +53512,19 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre
__pyx_v_j = __pyx_t_5;
__pyx_t_5 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1419
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1469
* if (sent_links[idx] == s):
* j = eindexes.index(sent_links[idx+1])
* ret.append(i*65536+j) # <<<<<<<<<<<<<<
* idx += 2
* return ret
*/
- __pyx_t_5 = PyInt_FromLong((__pyx_v_i * 65536)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyInt_FromLong((__pyx_v_i * 65536)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = PyNumber_Add(__pyx_t_5, __pyx_v_j); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyNumber_Add(__pyx_t_5, __pyx_v_j); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_ret), __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_ret), __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
@@ -52615,14 +53532,14 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre
}
__pyx_L8:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1420
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1470
* j = eindexes.index(sent_links[idx+1])
* ret.append(i*65536+j)
* idx += 2 # <<<<<<<<<<<<<<
* return ret
*
*/
- __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_idx, __pyx_int_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_idx, __pyx_int_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_v_idx);
__pyx_v_idx = __pyx_t_5;
@@ -52631,7 +53548,7 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre
__pyx_L3_continue:;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1421
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1471
* ret.append(i*65536+j)
* idx += 2
* return ret # <<<<<<<<<<<<<<
@@ -52661,7 +53578,7 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1423
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1473
* return ret
*
* cdef extract(self, Phrase phrase, Matching* matching, int* chunklen, int num_chunks): # <<<<<<<<<<<<<<
@@ -52755,19 +53672,19 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("extract", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1436
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1486
* cdef reason_for_failure
*
* fphr_arr = IntList() # <<<<<<<<<<<<<<
* phrase_len = phrase.n
* extracts = []
*/
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_fphr_arr = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1437
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1487
*
* fphr_arr = IntList()
* phrase_len = phrase.n # <<<<<<<<<<<<<<
@@ -52776,19 +53693,19 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_phrase_len = __pyx_v_phrase->n;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1438
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1488
* fphr_arr = IntList()
* phrase_len = phrase.n
* extracts = [] # <<<<<<<<<<<<<<
* sent_links = self.alignment._get_sent_links(matching.sent_id, &num_links)
*
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_extracts = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1439
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1489
* phrase_len = phrase.n
* extracts = []
* sent_links = self.alignment._get_sent_links(matching.sent_id, &num_links) # <<<<<<<<<<<<<<
@@ -52797,7 +53714,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_sent_links = ((struct __pyx_vtabstruct_3_sa_Alignment *)__pyx_v_self->alignment->__pyx_vtab)->_get_sent_links(__pyx_v_self->alignment, __pyx_v_matching->sent_id, (&__pyx_v_num_links));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1441
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1491
* sent_links = self.alignment._get_sent_links(matching.sent_id, &num_links)
*
* e_sent_start = self.eda.sent_index.arr[matching.sent_id] # <<<<<<<<<<<<<<
@@ -52806,7 +53723,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_e_sent_start = (__pyx_v_self->eda->sent_index->arr[__pyx_v_matching->sent_id]);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1442
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1492
*
* e_sent_start = self.eda.sent_index.arr[matching.sent_id]
* e_sent_end = self.eda.sent_index.arr[matching.sent_id+1] # <<<<<<<<<<<<<<
@@ -52815,7 +53732,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_e_sent_end = (__pyx_v_self->eda->sent_index->arr[(__pyx_v_matching->sent_id + 1)]);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1443
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1493
* 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 # <<<<<<<<<<<<<<
@@ -52824,7 +53741,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_e_sent_len = ((__pyx_v_e_sent_end - __pyx_v_e_sent_start) - 1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1444
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1494
* 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] # <<<<<<<<<<<<<<
@@ -52833,7 +53750,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_f_sent_start = (__pyx_v_self->fda->sent_index->arr[__pyx_v_matching->sent_id]);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1445
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1495
* 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] # <<<<<<<<<<<<<<
@@ -52842,7 +53759,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_f_sent_end = (__pyx_v_self->fda->sent_index->arr[(__pyx_v_matching->sent_id + 1)]);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1446
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1496
* 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 # <<<<<<<<<<<<<<
@@ -52851,21 +53768,21 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_f_sent_len = ((__pyx_v_f_sent_end - __pyx_v_f_sent_start) - 1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1448
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1498
* f_sent_len = f_sent_end - f_sent_start - 1
*
* self.findexes1.reset() # <<<<<<<<<<<<<<
* sofar = 0
* for i in range(num_chunks):
*/
- __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes1), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes1), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1449
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1499
*
* self.findexes1.reset()
* sofar = 0 # <<<<<<<<<<<<<<
@@ -52875,7 +53792,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_INCREF(__pyx_int_0);
__pyx_v_sofar = __pyx_int_0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1450
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1500
* self.findexes1.reset()
* sofar = 0
* for i in range(num_chunks): # <<<<<<<<<<<<<<
@@ -52886,7 +53803,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_i = __pyx_t_4;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1451
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1501
* sofar = 0
* for i in range(num_chunks):
* for j in range(chunklen[i]): # <<<<<<<<<<<<<<
@@ -52897,35 +53814,35 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
__pyx_v_j = __pyx_t_6;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1452
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1502
* for i in range(num_chunks):
* for j in range(chunklen[i]):
* self.findexes1.append(matching.arr[matching.start+i]+j-f_sent_start); # <<<<<<<<<<<<<<
* sofar += 1
* if (i+1<num_chunks):
*/
- __pyx_t_2 = PyInt_FromLong((((__pyx_v_matching->arr[(__pyx_v_matching->start + __pyx_v_i)]) + __pyx_v_j) - __pyx_v_f_sent_start)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong((((__pyx_v_matching->arr[(__pyx_v_matching->start + __pyx_v_i)]) + __pyx_v_j) - __pyx_v_f_sent_start)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes1), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes1), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1453
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1503
* for j in range(chunklen[i]):
* self.findexes1.append(matching.arr[matching.start+i]+j-f_sent_start);
* sofar += 1 # <<<<<<<<<<<<<<
* if (i+1<num_chunks):
* self.findexes1.append(phrase[sofar])
*/
- __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_sofar, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_sofar, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_v_sofar);
__pyx_v_sofar = __pyx_t_1;
__pyx_t_1 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1454
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1504
* self.findexes1.append(matching.arr[matching.start+i]+j-f_sent_start);
* sofar += 1
* if (i+1<num_chunks): # <<<<<<<<<<<<<<
@@ -52935,28 +53852,28 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_7 = ((__pyx_v_i + 1) < __pyx_v_num_chunks);
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1455
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1505
* sofar += 1
* if (i+1<num_chunks):
* self.findexes1.append(phrase[sofar]) # <<<<<<<<<<<<<<
* sofar += 1
*
*/
- __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_phrase), __pyx_v_sofar); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_phrase), __pyx_v_sofar); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes1), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes1), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1456
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1506
* if (i+1<num_chunks):
* self.findexes1.append(phrase[sofar])
* sofar += 1 # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_sofar, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_sofar, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_v_sofar);
__pyx_v_sofar = __pyx_t_2;
@@ -52966,7 +53883,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_L7:;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1459
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1509
*
*
* e_links_low = <int*> malloc(e_sent_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -52975,7 +53892,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_e_links_low = ((int *)malloc((__pyx_v_e_sent_len * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1460
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1510
*
* e_links_low = <int*> malloc(e_sent_len*sizeof(int))
* e_links_high = <int*> malloc(e_sent_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -52984,7 +53901,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_e_links_high = ((int *)malloc((__pyx_v_e_sent_len * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1461
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1511
* 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)) # <<<<<<<<<<<<<<
@@ -52993,7 +53910,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_f_links_low = ((int *)malloc((__pyx_v_f_sent_len * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1462
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1512
* 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)) # <<<<<<<<<<<<<<
@@ -53002,7 +53919,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_f_links_high = ((int *)malloc((__pyx_v_f_sent_len * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1463
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1513
* 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)) # <<<<<<<<<<<<<<
@@ -53011,7 +53928,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_f_gap_low = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1464
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1514
* 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)) # <<<<<<<<<<<<<<
@@ -53020,7 +53937,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_f_gap_high = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1465
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1515
* 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)) # <<<<<<<<<<<<<<
@@ -53029,7 +53946,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_e_gap_low = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1466
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1516
* 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)) # <<<<<<<<<<<<<<
@@ -53038,7 +53955,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_e_gap_high = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1467
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1517
* 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)) # <<<<<<<<<<<<<<
@@ -53047,7 +53964,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
memset(__pyx_v_f_gap_low, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1468
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1518
* 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)) # <<<<<<<<<<<<<<
@@ -53056,7 +53973,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
memset(__pyx_v_f_gap_high, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1469
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1519
* 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)) # <<<<<<<<<<<<<<
@@ -53065,7 +53982,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
memset(__pyx_v_e_gap_low, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1470
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1520
* 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)) # <<<<<<<<<<<<<<
@@ -53074,7 +53991,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
memset(__pyx_v_e_gap_high, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1472
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1522
* memset(e_gap_high, 0, (num_chunks+1)*sizeof(int))
*
* reason_for_failure = "" # <<<<<<<<<<<<<<
@@ -53084,7 +54001,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_INCREF(((PyObject *)__pyx_kp_s_45));
__pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_45);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1474
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1524
* reason_for_failure = ""
*
* for i from 0 <= i < e_sent_len: # <<<<<<<<<<<<<<
@@ -53094,7 +54011,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_3 = __pyx_v_e_sent_len;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1475
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1525
*
* for i from 0 <= i < e_sent_len:
* e_links_low[i] = -1 # <<<<<<<<<<<<<<
@@ -53103,7 +54020,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
(__pyx_v_e_links_low[__pyx_v_i]) = -1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1476
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1526
* for i from 0 <= i < e_sent_len:
* e_links_low[i] = -1
* e_links_high[i] = -1 # <<<<<<<<<<<<<<
@@ -53113,7 +54030,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
(__pyx_v_e_links_high[__pyx_v_i]) = -1;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1477
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1527
* e_links_low[i] = -1
* e_links_high[i] = -1
* for i from 0 <= i < f_sent_len: # <<<<<<<<<<<<<<
@@ -53123,7 +54040,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_3 = __pyx_v_f_sent_len;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1478
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1528
* e_links_high[i] = -1
* for i from 0 <= i < f_sent_len:
* f_links_low[i] = -1 # <<<<<<<<<<<<<<
@@ -53132,7 +54049,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
(__pyx_v_f_links_low[__pyx_v_i]) = -1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1479
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1529
* for i from 0 <= i < f_sent_len:
* f_links_low[i] = -1
* f_links_high[i] = -1 # <<<<<<<<<<<<<<
@@ -53142,7 +54059,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
(__pyx_v_f_links_high[__pyx_v_i]) = -1;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1485
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1535
* # links that we care about (but then how to look up
* # when we want to check something on the e side?)
* i = 0 # <<<<<<<<<<<<<<
@@ -53151,7 +54068,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_i = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1486
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1536
* # when we want to check something on the e side?)
* i = 0
* while i < num_links*2: # <<<<<<<<<<<<<<
@@ -53162,7 +54079,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_7 = (__pyx_v_i < (__pyx_v_num_links * 2));
if (!__pyx_t_7) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1487
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1537
* i = 0
* while i < num_links*2:
* f_i = sent_links[i] # <<<<<<<<<<<<<<
@@ -53171,7 +54088,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_f_i = (__pyx_v_sent_links[__pyx_v_i]);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1488
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1538
* while i < num_links*2:
* f_i = sent_links[i]
* e_i = sent_links[i+1] # <<<<<<<<<<<<<<
@@ -53180,7 +54097,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_e_i = (__pyx_v_sent_links[(__pyx_v_i + 1)]);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1489
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1539
* 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: # <<<<<<<<<<<<<<
@@ -53196,7 +54113,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1490
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1540
* 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 # <<<<<<<<<<<<<<
@@ -53208,7 +54125,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L14:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1491
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1541
* 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: # <<<<<<<<<<<<<<
@@ -53224,7 +54141,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_8) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1492
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1542
* 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 # <<<<<<<<<<<<<<
@@ -53236,7 +54153,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L15:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1493
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1543
* 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: # <<<<<<<<<<<<<<
@@ -53252,7 +54169,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1494
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1544
* 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 # <<<<<<<<<<<<<<
@@ -53264,7 +54181,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L16:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1495
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1545
* 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: # <<<<<<<<<<<<<<
@@ -53280,7 +54197,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1496
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1546
* 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 # <<<<<<<<<<<<<<
@@ -53292,7 +54209,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L17:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1497
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1547
* 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 # <<<<<<<<<<<<<<
@@ -53302,19 +54219,19 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_v_i = (__pyx_v_i + 2);
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1499
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1549
* i = i + 2
*
* als = [] # <<<<<<<<<<<<<<
* for x in range(matching.start,matching.end):
* al = (matching.arr[x]-f_sent_start,f_links_low[matching.arr[x]-f_sent_start])
*/
- __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_als = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1500
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1550
*
* als = []
* for x in range(matching.start,matching.end): # <<<<<<<<<<<<<<
@@ -53325,18 +54242,18 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
for (__pyx_t_4 = __pyx_v_matching->start; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_x = __pyx_t_4;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1501
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1551
* als = []
* for x in range(matching.start,matching.end):
* al = (matching.arr[x]-f_sent_start,f_links_low[matching.arr[x]-f_sent_start]) # <<<<<<<<<<<<<<
* als.append(al)
* # check all source-side alignment constraints
*/
- __pyx_t_2 = PyInt_FromLong(((__pyx_v_matching->arr[__pyx_v_x]) - __pyx_v_f_sent_start)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong(((__pyx_v_matching->arr[__pyx_v_x]) - __pyx_v_f_sent_start)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyInt_FromLong((__pyx_v_f_links_low[((__pyx_v_matching->arr[__pyx_v_x]) - __pyx_v_f_sent_start)])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong((__pyx_v_f_links_low[((__pyx_v_matching->arr[__pyx_v_x]) - __pyx_v_f_sent_start)])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
@@ -53348,17 +54265,17 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_v_al = __pyx_t_10;
__pyx_t_10 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1502
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1552
* for x in range(matching.start,matching.end):
* al = (matching.arr[x]-f_sent_start,f_links_low[matching.arr[x]-f_sent_start])
* als.append(al) # <<<<<<<<<<<<<<
* # check all source-side alignment constraints
* met_constraints = 1
*/
- __pyx_t_11 = PyList_Append(__pyx_v_als, ((PyObject *)__pyx_v_al)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyList_Append(__pyx_v_als, ((PyObject *)__pyx_v_al)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1504
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1554
* als.append(al)
* # check all source-side alignment constraints
* met_constraints = 1 # <<<<<<<<<<<<<<
@@ -53367,7 +54284,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_met_constraints = 1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1505
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1555
* # check all source-side alignment constraints
* met_constraints = 1
* if self.require_aligned_terminal: # <<<<<<<<<<<<<<
@@ -53376,7 +54293,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
if (__pyx_v_self->require_aligned_terminal) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1506
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1556
* met_constraints = 1
* if self.require_aligned_terminal:
* num_aligned_chunks = 0 # <<<<<<<<<<<<<<
@@ -53385,7 +54302,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_num_aligned_chunks = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1507
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1557
* if self.require_aligned_terminal:
* num_aligned_chunks = 0
* for i from 0 <= i < num_chunks: # <<<<<<<<<<<<<<
@@ -53395,7 +54312,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_3 = __pyx_v_num_chunks;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1508
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1558
* num_aligned_chunks = 0
* for i from 0 <= i < num_chunks:
* for j from 0 <= j < chunklen[i]: # <<<<<<<<<<<<<<
@@ -53405,7 +54322,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_4 = (__pyx_v_chunklen[__pyx_v_i]);
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_4; __pyx_v_j++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1509
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1559
* 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: # <<<<<<<<<<<<<<
@@ -53415,7 +54332,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_9 = ((__pyx_v_f_links_low[(((__pyx_v_matching->arr[(__pyx_v_matching->start + __pyx_v_i)]) + __pyx_v_j) - __pyx_v_f_sent_start)]) > -1);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1510
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1560
* 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 # <<<<<<<<<<<<<<
@@ -53424,7 +54341,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_num_aligned_chunks = (__pyx_v_num_aligned_chunks + 1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1511
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1561
* if f_links_low[matching.arr[matching.start+i]+j-f_sent_start] > -1:
* num_aligned_chunks = num_aligned_chunks + 1
* break # <<<<<<<<<<<<<<
@@ -53439,7 +54356,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_L24_break:;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1512
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1562
* num_aligned_chunks = num_aligned_chunks + 1
* break
* if num_aligned_chunks == 0: # <<<<<<<<<<<<<<
@@ -53449,7 +54366,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_9 = (__pyx_v_num_aligned_chunks == 0);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1513
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1563
* break
* if num_aligned_chunks == 0:
* reason_for_failure = "No aligned terminals" # <<<<<<<<<<<<<<
@@ -53460,7 +54377,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_DECREF(__pyx_v_reason_for_failure);
__pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_126);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1514
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1564
* if num_aligned_chunks == 0:
* reason_for_failure = "No aligned terminals"
* met_constraints = 0 # <<<<<<<<<<<<<<
@@ -53472,7 +54389,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L26:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1515
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1565
* reason_for_failure = "No aligned terminals"
* met_constraints = 0
* if self.require_aligned_chunks and num_aligned_chunks < num_chunks: # <<<<<<<<<<<<<<
@@ -53487,7 +54404,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1516
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1566
* met_constraints = 0
* if self.require_aligned_chunks and num_aligned_chunks < num_chunks:
* reason_for_failure = "Unaligned chunk" # <<<<<<<<<<<<<<
@@ -53498,7 +54415,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_DECREF(__pyx_v_reason_for_failure);
__pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_127);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1517
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1567
* if self.require_aligned_chunks and num_aligned_chunks < num_chunks:
* reason_for_failure = "Unaligned chunk"
* met_constraints = 0 # <<<<<<<<<<<<<<
@@ -53513,7 +54430,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L20:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1519
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1569
* met_constraints = 0
*
* if met_constraints and self.tight_phrases: # <<<<<<<<<<<<<<
@@ -53528,7 +54445,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1521
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1571
* if met_constraints and self.tight_phrases:
* # outside edge constraints are checked later
* for i from 0 <= i < num_chunks-1: # <<<<<<<<<<<<<<
@@ -53538,7 +54455,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_12 = (__pyx_v_num_chunks - 1);
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_12; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1522
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1572
* # 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: # <<<<<<<<<<<<<<
@@ -53548,7 +54465,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_9 = ((__pyx_v_f_links_low[(((__pyx_v_matching->arr[(__pyx_v_matching->start + __pyx_v_i)]) + (__pyx_v_chunklen[__pyx_v_i])) - __pyx_v_f_sent_start)]) == -1);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1523
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1573
* 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" # <<<<<<<<<<<<<<
@@ -53559,7 +54476,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_DECREF(__pyx_v_reason_for_failure);
__pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_128);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1524
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1574
* 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 # <<<<<<<<<<<<<<
@@ -53568,7 +54485,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_met_constraints = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1525
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1575
* reason_for_failure = "Gaps are not tight phrases"
* met_constraints = 0
* break # <<<<<<<<<<<<<<
@@ -53580,7 +54497,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L31:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1526
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1576
* met_constraints = 0
* break
* if f_links_low[matching.arr[matching.start+i+1]-1-f_sent_start] == -1: # <<<<<<<<<<<<<<
@@ -53590,7 +54507,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_9 = ((__pyx_v_f_links_low[(((__pyx_v_matching->arr[((__pyx_v_matching->start + __pyx_v_i) + 1)]) - 1) - __pyx_v_f_sent_start)]) == -1);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1527
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1577
* break
* if f_links_low[matching.arr[matching.start+i+1]-1-f_sent_start] == -1:
* reason_for_failure = "Gaps are not tight phrases" # <<<<<<<<<<<<<<
@@ -53601,7 +54518,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_DECREF(__pyx_v_reason_for_failure);
__pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_128);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1528
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1578
* 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 # <<<<<<<<<<<<<<
@@ -53610,7 +54527,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_met_constraints = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1529
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1579
* reason_for_failure = "Gaps are not tight phrases"
* met_constraints = 0
* break # <<<<<<<<<<<<<<
@@ -53627,7 +54544,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L28:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1531
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1581
* break
*
* f_low = matching.arr[matching.start] - f_sent_start # <<<<<<<<<<<<<<
@@ -53636,7 +54553,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_f_low = ((__pyx_v_matching->arr[__pyx_v_matching->start]) - __pyx_v_f_sent_start);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1532
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1582
*
* 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 # <<<<<<<<<<<<<<
@@ -53645,7 +54562,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_f_high = (((__pyx_v_matching->arr[((__pyx_v_matching->start + __pyx_v_matching->size) - 1)]) + (__pyx_v_chunklen[(__pyx_v_num_chunks - 1)])) - __pyx_v_f_sent_start);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1533
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1583
* 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: # <<<<<<<<<<<<<<
@@ -53654,17 +54571,17 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
if (__pyx_v_met_constraints) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1535
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1585
* if met_constraints:
*
* if self.find_fixpoint(f_low, f_high, f_links_low, f_links_high, e_links_low, e_links_high, # <<<<<<<<<<<<<<
* -1, -1, &e_low, &e_high, &f_back_low, &f_back_high, f_sent_len, e_sent_len,
* self.train_max_initial_size, self.train_max_initial_size,
*/
- __pyx_t_10 = PyInt_FromLong(__pyx_v_f_high); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyInt_FromLong(__pyx_v_f_high); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1539
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1589
* 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): # <<<<<<<<<<<<<<
@@ -53675,7 +54592,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1540
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1590
* self.train_min_gap_size, 0,
* self.max_nonterminals - num_chunks + 1, 1, 1, 0, 0):
* gap_error = 0 # <<<<<<<<<<<<<<
@@ -53684,7 +54601,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_gap_error = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1541
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1591
* self.max_nonterminals - num_chunks + 1, 1, 1, 0, 0):
* gap_error = 0
* num_gaps = 0 # <<<<<<<<<<<<<<
@@ -53693,7 +54610,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_num_gaps = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1543
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1593
* num_gaps = 0
*
* if f_back_low < f_low: # <<<<<<<<<<<<<<
@@ -53703,7 +54620,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_9 = (__pyx_v_f_back_low < __pyx_v_f_low);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1544
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1594
*
* if f_back_low < f_low:
* f_gap_low[0] = f_back_low # <<<<<<<<<<<<<<
@@ -53712,7 +54629,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
(__pyx_v_f_gap_low[0]) = __pyx_v_f_back_low;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1545
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1595
* if f_back_low < f_low:
* f_gap_low[0] = f_back_low
* f_gap_high[0] = f_low # <<<<<<<<<<<<<<
@@ -53721,7 +54638,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
(__pyx_v_f_gap_high[0]) = __pyx_v_f_low;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1546
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1596
* f_gap_low[0] = f_back_low
* f_gap_high[0] = f_low
* num_gaps = 1 # <<<<<<<<<<<<<<
@@ -53730,7 +54647,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_num_gaps = 1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1547
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1597
* f_gap_high[0] = f_low
* num_gaps = 1
* gap_start = 0 # <<<<<<<<<<<<<<
@@ -53739,7 +54656,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_gap_start = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1548
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1598
* num_gaps = 1
* gap_start = 0
* phrase_len = phrase_len+1 # <<<<<<<<<<<<<<
@@ -53748,7 +54665,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_phrase_len = (__pyx_v_phrase_len + 1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1549
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1599
* gap_start = 0
* phrase_len = phrase_len+1
* if phrase_len > self.max_length: # <<<<<<<<<<<<<<
@@ -53758,7 +54675,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_9 = (__pyx_v_phrase_len > __pyx_v_self->max_length);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1550
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1600
* phrase_len = phrase_len+1
* if phrase_len > self.max_length:
* gap_error = 1 # <<<<<<<<<<<<<<
@@ -53770,7 +54687,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L36:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1551
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1601
* if phrase_len > self.max_length:
* gap_error = 1
* if self.tight_phrases: # <<<<<<<<<<<<<<
@@ -53779,7 +54696,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
if (__pyx_v_self->tight_phrases) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1552
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1602
* gap_error = 1
* if self.tight_phrases:
* if f_links_low[f_back_low] == -1 or f_links_low[f_low-1] == -1: # <<<<<<<<<<<<<<
@@ -53795,7 +54712,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_8) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1553
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1603
* if self.tight_phrases:
* if f_links_low[f_back_low] == -1 or f_links_low[f_low-1] == -1:
* gap_error = 1 # <<<<<<<<<<<<<<
@@ -53804,7 +54721,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_gap_error = 1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1554
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1604
* 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" # <<<<<<<<<<<<<<
@@ -53824,7 +54741,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1556
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1606
* reason_for_failure = "Inside edges of preceding subphrase are not tight"
* else:
* gap_start = 1 # <<<<<<<<<<<<<<
@@ -53833,7 +54750,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_gap_start = 1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1557
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1607
* else:
* gap_start = 1
* if self.tight_phrases and f_links_low[f_low] == -1: # <<<<<<<<<<<<<<
@@ -53848,7 +54765,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1560
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1610
* # 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 # <<<<<<<<<<<<<<
@@ -53862,7 +54779,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L35:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1562
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1612
* met_constraints = 0
*
* for i from 0 <= i < matching.size - 1: # <<<<<<<<<<<<<<
@@ -53872,7 +54789,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_12 = (__pyx_v_matching->size - 1);
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_12; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1563
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1613
*
* for i from 0 <= i < matching.size - 1:
* f_gap_low[1+i] = matching.arr[matching.start+i] + chunklen[i] - f_sent_start # <<<<<<<<<<<<<<
@@ -53881,7 +54798,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
(__pyx_v_f_gap_low[(1 + __pyx_v_i)]) = (((__pyx_v_matching->arr[(__pyx_v_matching->start + __pyx_v_i)]) + (__pyx_v_chunklen[__pyx_v_i])) - __pyx_v_f_sent_start);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1564
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1614
* 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 # <<<<<<<<<<<<<<
@@ -53890,7 +54807,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
(__pyx_v_f_gap_high[(1 + __pyx_v_i)]) = ((__pyx_v_matching->arr[((__pyx_v_matching->start + __pyx_v_i) + 1)]) - __pyx_v_f_sent_start);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1565
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1615
* 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 # <<<<<<<<<<<<<<
@@ -53900,7 +54817,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_v_num_gaps = (__pyx_v_num_gaps + 1);
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1567
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1617
* num_gaps = num_gaps + 1
*
* if f_high < f_back_high: # <<<<<<<<<<<<<<
@@ -53910,7 +54827,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_9 = (__pyx_v_f_high < __pyx_v_f_back_high);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1568
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1618
*
* if f_high < f_back_high:
* f_gap_low[gap_start+num_gaps] = f_high # <<<<<<<<<<<<<<
@@ -53919,7 +54836,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
(__pyx_v_f_gap_low[(__pyx_v_gap_start + __pyx_v_num_gaps)]) = __pyx_v_f_high;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1569
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1619
* 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 # <<<<<<<<<<<<<<
@@ -53928,7 +54845,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
(__pyx_v_f_gap_high[(__pyx_v_gap_start + __pyx_v_num_gaps)]) = __pyx_v_f_back_high;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1570
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1620
* f_gap_low[gap_start+num_gaps] = f_high
* f_gap_high[gap_start+num_gaps] = f_back_high
* num_gaps = num_gaps + 1 # <<<<<<<<<<<<<<
@@ -53937,7 +54854,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_num_gaps = (__pyx_v_num_gaps + 1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1571
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1621
* f_gap_high[gap_start+num_gaps] = f_back_high
* num_gaps = num_gaps + 1
* phrase_len = phrase_len+1 # <<<<<<<<<<<<<<
@@ -53946,7 +54863,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_phrase_len = (__pyx_v_phrase_len + 1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1572
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1622
* num_gaps = num_gaps + 1
* phrase_len = phrase_len+1
* if phrase_len > self.max_length: # <<<<<<<<<<<<<<
@@ -53956,7 +54873,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_9 = (__pyx_v_phrase_len > __pyx_v_self->max_length);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1573
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1623
* phrase_len = phrase_len+1
* if phrase_len > self.max_length:
* gap_error = 1 # <<<<<<<<<<<<<<
@@ -53968,7 +54885,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L43:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1574
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1624
* if phrase_len > self.max_length:
* gap_error = 1
* if self.tight_phrases: # <<<<<<<<<<<<<<
@@ -53977,7 +54894,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
if (__pyx_v_self->tight_phrases) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1575
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1625
* gap_error = 1
* if self.tight_phrases:
* if f_links_low[f_back_high-1] == -1 or f_links_low[f_high] == -1: # <<<<<<<<<<<<<<
@@ -53993,7 +54910,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1576
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1626
* if self.tight_phrases:
* if f_links_low[f_back_high-1] == -1 or f_links_low[f_high] == -1:
* gap_error = 1 # <<<<<<<<<<<<<<
@@ -54002,7 +54919,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_gap_error = 1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1577
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1627
* 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" # <<<<<<<<<<<<<<
@@ -54022,7 +54939,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1579
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1629
* reason_for_failure = "Inside edges of following subphrase are not tight"
* else:
* if self.tight_phrases and f_links_low[f_high-1] == -1: # <<<<<<<<<<<<<<
@@ -54037,7 +54954,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1580
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1630
* else:
* if self.tight_phrases and f_links_low[f_high-1] == -1:
* met_constraints = 0 # <<<<<<<<<<<<<<
@@ -54051,7 +54968,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L42:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1582
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1632
* met_constraints = 0
*
* if gap_error == 0: # <<<<<<<<<<<<<<
@@ -54061,7 +54978,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_9 = (__pyx_v_gap_error == 0);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1583
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1633
*
* if gap_error == 0:
* e_word_count = e_high - e_low # <<<<<<<<<<<<<<
@@ -54070,7 +54987,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_e_word_count = (__pyx_v_e_high - __pyx_v_e_low);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1584
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1634
* if gap_error == 0:
* e_word_count = e_high - e_low
* for i from 0 <= i < num_gaps: # check integrity of subphrases # <<<<<<<<<<<<<<
@@ -54080,17 +54997,17 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_3 = __pyx_v_num_gaps;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1585
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1635
* e_word_count = e_high - e_low
* for i from 0 <= i < num_gaps: # check integrity of subphrases
* if self.find_fixpoint(f_gap_low[gap_start+i], f_gap_high[gap_start+i], # <<<<<<<<<<<<<<
* f_links_low, f_links_high, e_links_low, e_links_high,
* -1, -1, e_gap_low+gap_start+i, e_gap_high+gap_start+i,
*/
- __pyx_t_10 = PyInt_FromLong((__pyx_v_f_gap_high[(__pyx_v_gap_start + __pyx_v_i)])); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyInt_FromLong((__pyx_v_f_gap_high[(__pyx_v_gap_start + __pyx_v_i)])); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1590
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1640
* f_gap_low+gap_start+i, f_gap_high+gap_start+i,
* f_sent_len, e_sent_len,
* self.train_max_initial_size, self.train_max_initial_size, # <<<<<<<<<<<<<<
@@ -54101,7 +55018,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1592
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1642
* self.train_max_initial_size, self.train_max_initial_size,
* 0, 0, 0, 0, 0, 0, 0) == 0:
* gap_error = 1 # <<<<<<<<<<<<<<
@@ -54110,18 +55027,18 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_gap_error = 1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1593
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1643
* 0, 0, 0, 0, 0, 0, 0) == 0:
* gap_error = 1
* reason_for_failure = "Subphrase [%d, %d] failed integrity check" % (f_gap_low[gap_start+i], f_gap_high[gap_start+i]) # <<<<<<<<<<<<<<
* break
*
*/
- __pyx_t_10 = PyInt_FromLong((__pyx_v_f_gap_low[(__pyx_v_gap_start + __pyx_v_i)])); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyInt_FromLong((__pyx_v_f_gap_low[(__pyx_v_gap_start + __pyx_v_i)])); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_1 = PyInt_FromLong((__pyx_v_f_gap_high[(__pyx_v_gap_start + __pyx_v_i)])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong((__pyx_v_f_gap_high[(__pyx_v_gap_start + __pyx_v_i)])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10);
__Pyx_GIVEREF(__pyx_t_10);
@@ -54129,14 +55046,14 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_10 = 0;
__pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_131), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_131), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_v_reason_for_failure);
__pyx_v_reason_for_failure = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1594
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1644
* 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 # <<<<<<<<<<<<<<
@@ -54153,7 +55070,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L47:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1596
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1646
* break
*
* if gap_error == 0: # <<<<<<<<<<<<<<
@@ -54163,7 +55080,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_9 = (__pyx_v_gap_error == 0);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1597
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1647
*
* if gap_error == 0:
* i = 1 # <<<<<<<<<<<<<<
@@ -54172,21 +55089,21 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_i = 1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1598
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1648
* if gap_error == 0:
* i = 1
* self.findexes.reset() # <<<<<<<<<<<<<<
* if f_back_low < f_low:
* fphr_arr._append(sym_setindex(self.category, i))
*/
- __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1599
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1649
* i = 1
* self.findexes.reset()
* if f_back_low < f_low: # <<<<<<<<<<<<<<
@@ -54196,7 +55113,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_9 = (__pyx_v_f_back_low < __pyx_v_f_low);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1600
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1650
* self.findexes.reset()
* if f_back_low < f_low:
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -54205,7 +55122,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1601
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1651
* if f_back_low < f_low:
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1 # <<<<<<<<<<<<<<
@@ -54214,16 +55131,16 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_i = (__pyx_v_i + 1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1602
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1652
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1
* self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n:
*/
- __pyx_t_2 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -54231,27 +55148,27 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L52:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1603
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1653
* i = i+1
* self.findexes.append(sym_setindex(self.category, i))
* self.findexes.extend(self.findexes1) # <<<<<<<<<<<<<<
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]):
*/
- __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)__pyx_v_self->findexes1));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self->findexes1));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->findexes1));
- __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1604
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1654
* self.findexes.append(sym_setindex(self.category, i))
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<<
@@ -54261,7 +55178,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_3 = __pyx_v_phrase->n;
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_3; __pyx_v_j++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1605
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1655
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<<
@@ -54271,7 +55188,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_4 = __pyx_f_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j]));
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1606
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1656
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -54280,7 +55197,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1607
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1657
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i))
* i = i + 1 # <<<<<<<<<<<<<<
@@ -54292,7 +55209,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1609
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1659
* i = i + 1
* else:
* fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<<
@@ -54304,7 +55221,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_L55:;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1610
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1660
* else:
* fphr_arr._append(phrase.syms[j])
* if f_back_high > f_high: # <<<<<<<<<<<<<<
@@ -54314,7 +55231,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_9 = (__pyx_v_f_back_high > __pyx_v_f_high);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1611
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1661
* fphr_arr._append(phrase.syms[j])
* if f_back_high > f_high:
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -54323,16 +55240,16 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1612
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1662
* if f_back_high > f_high:
* fphr_arr._append(sym_setindex(self.category, i))
* self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
*
* fphr = Phrase(fphr_arr)
*/
- __pyx_t_10 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_2 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -54340,25 +55257,25 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L56:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1614
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1664
* self.findexes.append(sym_setindex(self.category, i))
*
* fphr = Phrase(fphr_arr) # <<<<<<<<<<<<<<
* if met_constraints:
* phrase_list = self.extract_phrases(e_low, e_high, e_gap_low + gap_start, e_gap_high + gap_start, e_links_low, num_gaps,
*/
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)__pyx_v_fphr_arr));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_fphr_arr));
__Pyx_GIVEREF(((PyObject *)__pyx_v_fphr_arr));
- __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__pyx_v_fphr = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_10);
__pyx_t_10 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1615
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1665
*
* fphr = Phrase(fphr_arr)
* if met_constraints: # <<<<<<<<<<<<<<
@@ -54367,47 +55284,47 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
if (__pyx_v_met_constraints) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1618
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1668
* phrase_list = self.extract_phrases(e_low, e_high, e_gap_low + gap_start, e_gap_high + gap_start, e_links_low, num_gaps,
* f_back_low, f_back_high, f_gap_low + gap_start, f_gap_high + gap_start, f_links_low,
* matching.sent_id, e_sent_len, e_sent_start) # <<<<<<<<<<<<<<
* if len(phrase_list) > 0:
* pair_count = 1.0 / len(phrase_list)
*/
- __pyx_t_10 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->extract_phrases(__pyx_v_self, __pyx_v_e_low, __pyx_v_e_high, (__pyx_v_e_gap_low + __pyx_v_gap_start), (__pyx_v_e_gap_high + __pyx_v_gap_start), __pyx_v_e_links_low, __pyx_v_num_gaps, __pyx_v_f_back_low, __pyx_v_f_back_high, (__pyx_v_f_gap_low + __pyx_v_gap_start), (__pyx_v_f_gap_high + __pyx_v_gap_start), __pyx_v_f_links_low, __pyx_v_matching->sent_id, __pyx_v_e_sent_len, __pyx_v_e_sent_start); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->extract_phrases(__pyx_v_self, __pyx_v_e_low, __pyx_v_e_high, (__pyx_v_e_gap_low + __pyx_v_gap_start), (__pyx_v_e_gap_high + __pyx_v_gap_start), __pyx_v_e_links_low, __pyx_v_num_gaps, __pyx_v_f_back_low, __pyx_v_f_back_high, (__pyx_v_f_gap_low + __pyx_v_gap_start), (__pyx_v_f_gap_high + __pyx_v_gap_start), __pyx_v_f_links_low, __pyx_v_matching->sent_id, __pyx_v_e_sent_len, __pyx_v_e_sent_start); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__pyx_v_phrase_list = __pyx_t_10;
__pyx_t_10 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1619
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1669
* f_back_low, f_back_high, f_gap_low + gap_start, f_gap_high + gap_start, f_links_low,
* matching.sent_id, e_sent_len, e_sent_start)
* if len(phrase_list) > 0: # <<<<<<<<<<<<<<
* pair_count = 1.0 / len(phrase_list)
* else:
*/
- __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_9 = (__pyx_t_13 > 0);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1620
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1670
* matching.sent_id, e_sent_len, e_sent_start)
* if len(phrase_list) > 0:
* pair_count = 1.0 / len(phrase_list) # <<<<<<<<<<<<<<
* else:
* pair_count = 0
*/
- __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (unlikely(__pyx_t_13 == 0)) {
PyErr_Format(PyExc_ZeroDivisionError, "float division");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_v_pair_count = (1.0 / __pyx_t_13);
goto __pyx_L58;
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1622
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1672
* pair_count = 1.0 / len(phrase_list)
* else:
* pair_count = 0 # <<<<<<<<<<<<<<
@@ -54416,22 +55333,22 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_pair_count = 0.0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1623
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1673
* else:
* pair_count = 0
* reason_for_failure = "Didn't extract anything from [%d, %d] -> [%d, %d]" % (f_back_low, f_back_high, e_low, e_high) # <<<<<<<<<<<<<<
* for (phrase2,eindexes) in phrase_list:
* als1 = self.create_alignments(sent_links,num_links,self.findexes,eindexes)
*/
- __pyx_t_10 = PyInt_FromLong(__pyx_v_f_back_low); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyInt_FromLong(__pyx_v_f_back_low); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_2 = PyInt_FromLong(__pyx_v_f_back_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong(__pyx_v_f_back_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyInt_FromLong(__pyx_v_e_low); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_v_e_low); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_14 = PyInt_FromLong(__pyx_v_e_high); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyInt_FromLong(__pyx_v_e_high); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
- __pyx_t_15 = PyTuple_New(4); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(4); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_10);
__Pyx_GIVEREF(__pyx_t_10);
@@ -54445,7 +55362,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_2 = 0;
__pyx_t_1 = 0;
__pyx_t_14 = 0;
- __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_132), ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_132), ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_14));
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_v_reason_for_failure);
@@ -54454,7 +55371,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L58:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1624
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1674
* 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: # <<<<<<<<<<<<<<
@@ -54465,7 +55382,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_14 = __pyx_v_phrase_list; __Pyx_INCREF(__pyx_t_14); __pyx_t_13 = 0;
__pyx_t_16 = NULL;
} else {
- __pyx_t_13 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_v_phrase_list); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_v_phrase_list); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__pyx_t_16 = Py_TYPE(__pyx_t_14)->tp_iternext;
}
@@ -54473,23 +55390,23 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_14)) {
if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_14)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_15 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_15 = PySequence_ITEM(__pyx_t_14, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PySequence_ITEM(__pyx_t_14, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_14)) {
if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_14)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_15 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_15 = PySequence_ITEM(__pyx_t_14, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PySequence_ITEM(__pyx_t_14, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_15 = __pyx_t_16(__pyx_t_14);
if (unlikely(!__pyx_t_15)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -54505,7 +55422,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -54518,14 +55435,14 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_2);
#else
- __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_10 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__pyx_t_17 = Py_TYPE(__pyx_t_10)->tp_iternext;
@@ -54533,7 +55450,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_GOTREF(__pyx_t_1);
index = 1; __pyx_t_2 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L61_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_17 = NULL;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
goto __pyx_L62_unpacking_done;
@@ -54541,7 +55458,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_17 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L62_unpacking_done:;
}
__Pyx_XDECREF(__pyx_v_phrase2);
@@ -54551,7 +55468,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_v_eindexes = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1625
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1675
* 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) # <<<<<<<<<<<<<<
@@ -54560,31 +55477,31 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_t_15 = ((PyObject *)__pyx_v_self->findexes);
__Pyx_INCREF(__pyx_t_15);
- __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, __pyx_t_15, __pyx_v_eindexes)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, __pyx_t_15, __pyx_v_eindexes)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_XDECREF(((PyObject *)__pyx_v_als1));
__pyx_v_als1 = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1626
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1676
* for (phrase2,eindexes) in phrase_list:
* als1 = self.create_alignments(sent_links,num_links,self.findexes,eindexes)
* extracts.append((fphr, phrase2, pair_count, tuple(als1))) # <<<<<<<<<<<<<<
*
* if (num_gaps < self.max_nonterminals and
*/
- __pyx_t_2 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(((PyObject *)__pyx_v_als1));
PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_v_als1));
__Pyx_GIVEREF(((PyObject *)__pyx_v_als1));
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
- __pyx_t_15 = PyTuple_New(4); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(4); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(((PyObject *)__pyx_v_fphr));
PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_v_fphr));
@@ -54598,7 +55515,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_2 = 0;
__pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_extracts, ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_extracts, ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -54608,7 +55525,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L57:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1628
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1678
* extracts.append((fphr, phrase2, pair_count, tuple(als1)))
*
* if (num_gaps < self.max_nonterminals and # <<<<<<<<<<<<<<
@@ -54618,7 +55535,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_9 = (__pyx_v_num_gaps < __pyx_v_self->max_nonterminals);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1629
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1679
*
* if (num_gaps < self.max_nonterminals and
* phrase_len < self.max_length and # <<<<<<<<<<<<<<
@@ -54628,7 +55545,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_7 = (__pyx_v_phrase_len < __pyx_v_self->max_length);
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1630
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1680
* 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): # <<<<<<<<<<<<<<
@@ -54646,7 +55563,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1631
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1681
* 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 # <<<<<<<<<<<<<<
@@ -54656,7 +55573,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_7 = (__pyx_v_f_back_low == __pyx_v_f_low);
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1632
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1682
* 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 # <<<<<<<<<<<<<<
@@ -54666,7 +55583,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_9 = (__pyx_v_f_low >= __pyx_v_self->train_min_gap_size);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1633
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1683
* 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))): # <<<<<<<<<<<<<<
@@ -54696,7 +55613,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1634
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1684
* 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 # <<<<<<<<<<<<<<
@@ -54705,7 +55622,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_f_x_low = (__pyx_v_f_low - __pyx_v_self->train_min_gap_size);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1635
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1685
* ((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 # <<<<<<<<<<<<<<
@@ -54714,7 +55631,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_met_constraints = 1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1636
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1686
* f_x_low = f_low-self.train_min_gap_size
* met_constraints = 1
* if self.tight_phrases: # <<<<<<<<<<<<<<
@@ -54723,7 +55640,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
if (__pyx_v_self->tight_phrases) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1637
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1687
* met_constraints = 1
* if self.tight_phrases:
* while f_x_low >= 0 and f_links_low[f_x_low] == -1: # <<<<<<<<<<<<<<
@@ -54740,7 +55657,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (!__pyx_t_18) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1638
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1688
* if self.tight_phrases:
* while f_x_low >= 0 and f_links_low[f_x_low] == -1:
* f_x_low = f_x_low - 1 # <<<<<<<<<<<<<<
@@ -54753,7 +55670,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L65:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1639
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1689
* 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: # <<<<<<<<<<<<<<
@@ -54769,7 +55686,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1640
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1690
* 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 # <<<<<<<<<<<<<<
@@ -54781,7 +55698,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L68:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1642
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1692
* met_constraints = 0
*
* if (met_constraints and # <<<<<<<<<<<<<<
@@ -54790,17 +55707,17 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
if (__pyx_v_met_constraints) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1643
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1693
*
* if (met_constraints and
* self.find_fixpoint(f_x_low, f_back_high, # <<<<<<<<<<<<<<
* f_links_low, f_links_high, e_links_low, e_links_high,
* e_low, e_high, &e_x_low, &e_x_high, &f_x_low, &f_x_high,
*/
- __pyx_t_14 = PyInt_FromLong(__pyx_v_f_back_high); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyInt_FromLong(__pyx_v_f_back_high); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1647
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1697
* 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, # <<<<<<<<<<<<<<
@@ -54810,7 +55727,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
if (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_x_low, __pyx_t_14, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_e_low, __pyx_v_e_high, (&__pyx_v_e_x_low), (&__pyx_v_e_x_high), (&__pyx_v_f_x_low), (&__pyx_v_f_x_high), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 1, 1, 1, 1, 0, 1, 0)) {
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1649
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1699
* self.train_max_initial_size, self.train_max_initial_size,
* 1, 1, 1, 1, 0, 1, 0) and
* ((not self.tight_phrases) or f_links_low[f_x_low] != -1) and # <<<<<<<<<<<<<<
@@ -54826,17 +55743,17 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1650
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1700
* 1, 1, 1, 1, 0, 1, 0) and
* ((not self.tight_phrases) or f_links_low[f_x_low] != -1) and
* self.find_fixpoint(f_x_low, f_low, # check integrity of new subphrase # <<<<<<<<<<<<<<
* f_links_low, f_links_high, e_links_low, e_links_high,
* -1, -1, e_gap_low, e_gap_high, f_gap_low, f_gap_high,
*/
- __pyx_t_1 = PyInt_FromLong(__pyx_v_f_low); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_v_f_low); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1654
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1704
* -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, # <<<<<<<<<<<<<<
@@ -54859,7 +55776,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1656
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1706
* self.train_max_initial_size, self.train_max_initial_size,
* 0, 0, 0, 0, 0, 0, 0)):
* fphr_arr._clear() # <<<<<<<<<<<<<<
@@ -54868,7 +55785,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_clear(__pyx_v_fphr_arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1657
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1707
* 0, 0, 0, 0, 0, 0, 0)):
* fphr_arr._clear()
* i = 1 # <<<<<<<<<<<<<<
@@ -54877,35 +55794,35 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_i = 1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1658
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1708
* fphr_arr._clear()
* i = 1
* self.findexes.reset() # <<<<<<<<<<<<<<
* self.findexes.append(sym_setindex(self.category, i))
* fphr_arr._append(sym_setindex(self.category, i))
*/
- __pyx_t_14 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
- __pyx_t_1 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1659
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1709
* i = 1
* self.findexes.reset()
* self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1
*/
- __pyx_t_1 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_14 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1660
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1710
* self.findexes.reset()
* self.findexes.append(sym_setindex(self.category, i))
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -54914,7 +55831,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1661
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1711
* self.findexes.append(sym_setindex(self.category, i))
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1 # <<<<<<<<<<<<<<
@@ -54923,27 +55840,27 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_i = (__pyx_v_i + 1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1662
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1712
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1
* self.findexes.extend(self.findexes1) # <<<<<<<<<<<<<<
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]):
*/
- __pyx_t_14 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_self->findexes1));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->findexes1));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->findexes1));
- __pyx_t_15 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1663
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1713
* i = i+1
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<<
@@ -54953,7 +55870,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_3 = __pyx_v_phrase->n;
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_3; __pyx_v_j++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1664
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1714
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<<
@@ -54963,7 +55880,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_4 = __pyx_f_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j]));
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1665
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1715
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -54972,7 +55889,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1666
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1716
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i))
* i = i + 1 # <<<<<<<<<<<<<<
@@ -54984,7 +55901,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1668
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1718
* i = i + 1
* else:
* fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<<
@@ -54996,7 +55913,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_L72:;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1669
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1719
* else:
* fphr_arr._append(phrase.syms[j])
* if f_back_high > f_high: # <<<<<<<<<<<<<<
@@ -55006,7 +55923,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_7 = (__pyx_v_f_back_high > __pyx_v_f_high);
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1670
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1720
* fphr_arr._append(phrase.syms[j])
* if f_back_high > f_high:
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -55015,16 +55932,16 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1671
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1721
* if f_back_high > f_high:
* fphr_arr._append(sym_setindex(self.category, i))
* self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
* fphr = Phrase(fphr_arr)
* phrase_list = self.extract_phrases(e_x_low, e_x_high, e_gap_low, e_gap_high, e_links_low, num_gaps+1,
*/
- __pyx_t_15 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_15); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_15); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -55032,67 +55949,67 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L73:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1672
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1722
* fphr_arr._append(sym_setindex(self.category, i))
* self.findexes.append(sym_setindex(self.category, i))
* fphr = Phrase(fphr_arr) # <<<<<<<<<<<<<<
* phrase_list = self.extract_phrases(e_x_low, e_x_high, e_gap_low, e_gap_high, e_links_low, num_gaps+1,
* f_x_low, f_x_high, f_gap_low, f_gap_high, f_links_low, matching.sent_id,
*/
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_fphr_arr));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_fphr_arr));
__Pyx_GIVEREF(((PyObject *)__pyx_v_fphr_arr));
- __pyx_t_15 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_v_fphr));
__pyx_v_fphr = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_15);
__pyx_t_15 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1675
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1725
* phrase_list = self.extract_phrases(e_x_low, e_x_high, e_gap_low, e_gap_high, e_links_low, num_gaps+1,
* f_x_low, f_x_high, f_gap_low, f_gap_high, f_links_low, matching.sent_id,
* e_sent_len, e_sent_start) # <<<<<<<<<<<<<<
* if len(phrase_list) > 0:
* pair_count = 1.0 / len(phrase_list)
*/
- __pyx_t_15 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->extract_phrases(__pyx_v_self, __pyx_v_e_x_low, __pyx_v_e_x_high, __pyx_v_e_gap_low, __pyx_v_e_gap_high, __pyx_v_e_links_low, (__pyx_v_num_gaps + 1), __pyx_v_f_x_low, __pyx_v_f_x_high, __pyx_v_f_gap_low, __pyx_v_f_gap_high, __pyx_v_f_links_low, __pyx_v_matching->sent_id, __pyx_v_e_sent_len, __pyx_v_e_sent_start); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->extract_phrases(__pyx_v_self, __pyx_v_e_x_low, __pyx_v_e_x_high, __pyx_v_e_gap_low, __pyx_v_e_gap_high, __pyx_v_e_links_low, (__pyx_v_num_gaps + 1), __pyx_v_f_x_low, __pyx_v_f_x_high, __pyx_v_f_gap_low, __pyx_v_f_gap_high, __pyx_v_f_links_low, __pyx_v_matching->sent_id, __pyx_v_e_sent_len, __pyx_v_e_sent_start); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_XDECREF(__pyx_v_phrase_list);
__pyx_v_phrase_list = __pyx_t_15;
__pyx_t_15 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1676
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1726
* f_x_low, f_x_high, f_gap_low, f_gap_high, f_links_low, matching.sent_id,
* e_sent_len, e_sent_start)
* if len(phrase_list) > 0: # <<<<<<<<<<<<<<
* pair_count = 1.0 / len(phrase_list)
* else:
*/
- __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_7 = (__pyx_t_13 > 0);
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1677
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1727
* e_sent_len, e_sent_start)
* if len(phrase_list) > 0:
* pair_count = 1.0 / len(phrase_list) # <<<<<<<<<<<<<<
* else:
* pair_count = 0
*/
- __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (unlikely(__pyx_t_13 == 0)) {
PyErr_Format(PyExc_ZeroDivisionError, "float division");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_v_pair_count = (1.0 / __pyx_t_13);
goto __pyx_L74;
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1679
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1729
* pair_count = 1.0 / len(phrase_list)
* else:
* pair_count = 0 # <<<<<<<<<<<<<<
@@ -55103,7 +56020,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L74:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1680
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1730
* else:
* pair_count = 0
* for phrase2,eindexes in phrase_list: # <<<<<<<<<<<<<<
@@ -55114,7 +56031,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_15 = __pyx_v_phrase_list; __Pyx_INCREF(__pyx_t_15); __pyx_t_13 = 0;
__pyx_t_16 = NULL;
} else {
- __pyx_t_13 = -1; __pyx_t_15 = PyObject_GetIter(__pyx_v_phrase_list); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = -1; __pyx_t_15 = PyObject_GetIter(__pyx_v_phrase_list); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__pyx_t_16 = Py_TYPE(__pyx_t_15)->tp_iternext;
}
@@ -55122,23 +56039,23 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_15)) {
if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_15)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_15, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_GET_ITEM(__pyx_t_15, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_15, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_15, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_15)) {
if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_15)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_15, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_15, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_15, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_15, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_1 = __pyx_t_16(__pyx_t_15);
if (unlikely(!__pyx_t_1)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -55154,7 +56071,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -55167,14 +56084,14 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_INCREF(__pyx_t_14);
__Pyx_INCREF(__pyx_t_2);
#else
- __pyx_t_14 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_17 = Py_TYPE(__pyx_t_10)->tp_iternext;
@@ -55182,7 +56099,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_GOTREF(__pyx_t_14);
index = 1; __pyx_t_2 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L77_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_17 = NULL;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
goto __pyx_L78_unpacking_done;
@@ -55190,7 +56107,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_17 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L78_unpacking_done:;
}
__Pyx_XDECREF(__pyx_v_phrase2);
@@ -55200,7 +56117,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_v_eindexes = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1681
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1731
* pair_count = 0
* for phrase2,eindexes in phrase_list:
* als2 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) # <<<<<<<<<<<<<<
@@ -55209,31 +56126,31 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_t_1 = ((PyObject *)__pyx_v_self->findexes);
__Pyx_INCREF(__pyx_t_1);
- __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, __pyx_t_1, __pyx_v_eindexes)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, __pyx_t_1, __pyx_v_eindexes)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(((PyObject *)__pyx_v_als2));
__pyx_v_als2 = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1682
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1732
* for phrase2,eindexes in phrase_list:
* als2 = self.create_alignments(sent_links,num_links,self.findexes,eindexes)
* extracts.append((fphr, phrase2, pair_count, tuple(als2))) # <<<<<<<<<<<<<<
*
* if (f_back_high == f_high and
*/
- __pyx_t_2 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_als2));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_als2));
__Pyx_GIVEREF(((PyObject *)__pyx_v_als2));
- __pyx_t_14 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_fphr));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_fphr));
@@ -55247,7 +56164,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_GIVEREF(__pyx_t_14);
__pyx_t_2 = 0;
__pyx_t_14 = 0;
- __pyx_t_14 = __Pyx_PyObject_Append(__pyx_v_extracts, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyObject_Append(__pyx_v_extracts, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
@@ -55260,7 +56177,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L64:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1684
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1734
* extracts.append((fphr, phrase2, pair_count, tuple(als2)))
*
* if (f_back_high == f_high and # <<<<<<<<<<<<<<
@@ -55270,7 +56187,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_7 = (__pyx_v_f_back_high == __pyx_v_f_high);
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1685
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1735
*
* if (f_back_high == f_high and
* f_sent_len - f_high >= self.train_min_gap_size and # <<<<<<<<<<<<<<
@@ -55280,7 +56197,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_9 = ((__pyx_v_f_sent_len - __pyx_v_f_high) >= __pyx_v_self->train_min_gap_size);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1686
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1736
* 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))): # <<<<<<<<<<<<<<
@@ -55310,7 +56227,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1687
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1737
* 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 # <<<<<<<<<<<<<<
@@ -55319,7 +56236,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_f_x_high = (__pyx_v_f_high + __pyx_v_self->train_min_gap_size);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1688
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1738
* ((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 # <<<<<<<<<<<<<<
@@ -55328,7 +56245,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_met_constraints = 1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1689
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1739
* f_x_high = f_high+self.train_min_gap_size
* met_constraints = 1
* if self.tight_phrases: # <<<<<<<<<<<<<<
@@ -55337,7 +56254,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
if (__pyx_v_self->tight_phrases) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1690
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1740
* met_constraints = 1
* if self.tight_phrases:
* while f_x_high <= f_sent_len and f_links_low[f_x_high-1] == -1: # <<<<<<<<<<<<<<
@@ -55354,7 +56271,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (!__pyx_t_18) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1691
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1741
* 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 # <<<<<<<<<<<<<<
@@ -55367,7 +56284,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L80:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1692
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1742
* 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: # <<<<<<<<<<<<<<
@@ -55383,7 +56300,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1693
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1743
* 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 # <<<<<<<<<<<<<<
@@ -55395,7 +56312,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L83:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1695
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1745
* met_constraints = 0
*
* if (met_constraints and # <<<<<<<<<<<<<<
@@ -55404,17 +56321,17 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
if (__pyx_v_met_constraints) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1696
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1746
*
* if (met_constraints and
* self.find_fixpoint(f_back_low, f_x_high, # <<<<<<<<<<<<<<
* f_links_low, f_links_high, e_links_low, e_links_high,
* e_low, e_high, &e_x_low, &e_x_high, &f_x_low, &f_x_high,
*/
- __pyx_t_15 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1700
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1750
* 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, # <<<<<<<<<<<<<<
@@ -55424,7 +56341,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
if (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_back_low, __pyx_t_15, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_e_low, __pyx_v_e_high, (&__pyx_v_e_x_low), (&__pyx_v_e_x_high), (&__pyx_v_f_x_low), (&__pyx_v_f_x_high), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 1, 1, 1, 0, 1, 1, 0)) {
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1702
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1752
* 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 # <<<<<<<<<<<<<<
@@ -55440,17 +56357,17 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1703
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1753
* 1, 1, 1, 0, 1, 1, 0) and
* ((not self.tight_phrases) or f_links_low[f_x_high-1] != -1) and
* self.find_fixpoint(f_high, f_x_high, # <<<<<<<<<<<<<<
* f_links_low, f_links_high, e_links_low, e_links_high,
* -1, -1, e_gap_low+gap_start+num_gaps, e_gap_high+gap_start+num_gaps,
*/
- __pyx_t_14 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1708
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1758
* 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, # <<<<<<<<<<<<<<
@@ -55473,7 +56390,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1710
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1760
* self.train_max_initial_size, self.train_max_initial_size,
* 0, 0, 0, 0, 0, 0, 0)):
* fphr_arr._clear() # <<<<<<<<<<<<<<
@@ -55482,7 +56399,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_clear(__pyx_v_fphr_arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1711
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1761
* 0, 0, 0, 0, 0, 0, 0)):
* fphr_arr._clear()
* i = 1 # <<<<<<<<<<<<<<
@@ -55491,21 +56408,21 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_i = 1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1712
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1762
* fphr_arr._clear()
* i = 1
* self.findexes.reset() # <<<<<<<<<<<<<<
* if f_back_low < f_low:
* fphr_arr._append(sym_setindex(self.category, i))
*/
- __pyx_t_15 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_14 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1713
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1763
* i = 1
* self.findexes.reset()
* if f_back_low < f_low: # <<<<<<<<<<<<<<
@@ -55515,7 +56432,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_7 = (__pyx_v_f_back_low < __pyx_v_f_low);
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1714
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1764
* self.findexes.reset()
* if f_back_low < f_low:
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -55524,7 +56441,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1715
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1765
* if f_back_low < f_low:
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1 # <<<<<<<<<<<<<<
@@ -55533,16 +56450,16 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_i = (__pyx_v_i + 1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1716
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1766
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1
* self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n:
*/
- __pyx_t_14 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
- __pyx_t_15 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_14); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_14); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
@@ -55550,27 +56467,27 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L85:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1717
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1767
* i = i+1
* self.findexes.append(sym_setindex(self.category, i))
* self.findexes.extend(self.findexes1) # <<<<<<<<<<<<<<
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]):
*/
- __pyx_t_15 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_INCREF(((PyObject *)__pyx_v_self->findexes1));
PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_v_self->findexes1));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->findexes1));
- __pyx_t_1 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1718
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1768
* self.findexes.append(sym_setindex(self.category, i))
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<<
@@ -55580,7 +56497,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_3 = __pyx_v_phrase->n;
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_3; __pyx_v_j++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1719
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1769
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<<
@@ -55590,7 +56507,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_4 = __pyx_f_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j]));
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1720
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1770
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -55599,7 +56516,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1721
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1771
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i))
* i = i + 1 # <<<<<<<<<<<<<<
@@ -55611,7 +56528,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1723
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1773
* i = i + 1
* else:
* fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<<
@@ -55623,7 +56540,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_L88:;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1724
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1774
* else:
* fphr_arr._append(phrase.syms[j])
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -55632,81 +56549,81 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1725
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1775
* fphr_arr._append(phrase.syms[j])
* fphr_arr._append(sym_setindex(self.category, i))
* self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
* fphr = Phrase(fphr_arr)
* phrase_list = self.extract_phrases(e_x_low, e_x_high, e_gap_low+gap_start, e_gap_high+gap_start, e_links_low, num_gaps+1,
*/
- __pyx_t_1 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_14 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1726
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1776
* fphr_arr._append(sym_setindex(self.category, i))
* self.findexes.append(sym_setindex(self.category, i))
* fphr = Phrase(fphr_arr) # <<<<<<<<<<<<<<
* phrase_list = self.extract_phrases(e_x_low, e_x_high, e_gap_low+gap_start, e_gap_high+gap_start, e_links_low, num_gaps+1,
* f_x_low, f_x_high, f_gap_low+gap_start, f_gap_high+gap_start, f_links_low,
*/
- __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_INCREF(((PyObject *)__pyx_v_fphr_arr));
PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_v_fphr_arr));
__Pyx_GIVEREF(((PyObject *)__pyx_v_fphr_arr));
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
__Pyx_DECREF(((PyObject *)__pyx_v_fphr));
__pyx_v_fphr = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1729
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1779
* phrase_list = self.extract_phrases(e_x_low, e_x_high, e_gap_low+gap_start, e_gap_high+gap_start, e_links_low, num_gaps+1,
* f_x_low, f_x_high, f_gap_low+gap_start, f_gap_high+gap_start, f_links_low,
* matching.sent_id, e_sent_len, e_sent_start) # <<<<<<<<<<<<<<
* if len(phrase_list) > 0:
* pair_count = 1.0 / len(phrase_list)
*/
- __pyx_t_1 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->extract_phrases(__pyx_v_self, __pyx_v_e_x_low, __pyx_v_e_x_high, (__pyx_v_e_gap_low + __pyx_v_gap_start), (__pyx_v_e_gap_high + __pyx_v_gap_start), __pyx_v_e_links_low, (__pyx_v_num_gaps + 1), __pyx_v_f_x_low, __pyx_v_f_x_high, (__pyx_v_f_gap_low + __pyx_v_gap_start), (__pyx_v_f_gap_high + __pyx_v_gap_start), __pyx_v_f_links_low, __pyx_v_matching->sent_id, __pyx_v_e_sent_len, __pyx_v_e_sent_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->extract_phrases(__pyx_v_self, __pyx_v_e_x_low, __pyx_v_e_x_high, (__pyx_v_e_gap_low + __pyx_v_gap_start), (__pyx_v_e_gap_high + __pyx_v_gap_start), __pyx_v_e_links_low, (__pyx_v_num_gaps + 1), __pyx_v_f_x_low, __pyx_v_f_x_high, (__pyx_v_f_gap_low + __pyx_v_gap_start), (__pyx_v_f_gap_high + __pyx_v_gap_start), __pyx_v_f_links_low, __pyx_v_matching->sent_id, __pyx_v_e_sent_len, __pyx_v_e_sent_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_v_phrase_list);
__pyx_v_phrase_list = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1730
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1780
* f_x_low, f_x_high, f_gap_low+gap_start, f_gap_high+gap_start, f_links_low,
* matching.sent_id, e_sent_len, e_sent_start)
* if len(phrase_list) > 0: # <<<<<<<<<<<<<<
* pair_count = 1.0 / len(phrase_list)
* else:
*/
- __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_7 = (__pyx_t_13 > 0);
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1731
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1781
* matching.sent_id, e_sent_len, e_sent_start)
* if len(phrase_list) > 0:
* pair_count = 1.0 / len(phrase_list) # <<<<<<<<<<<<<<
* else:
* pair_count = 0
*/
- __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (unlikely(__pyx_t_13 == 0)) {
PyErr_Format(PyExc_ZeroDivisionError, "float division");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_v_pair_count = (1.0 / __pyx_t_13);
goto __pyx_L89;
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1733
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1783
* pair_count = 1.0 / len(phrase_list)
* else:
* pair_count = 0 # <<<<<<<<<<<<<<
@@ -55717,7 +56634,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L89:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1734
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1784
* else:
* pair_count = 0
* for phrase2, eindexes in phrase_list: # <<<<<<<<<<<<<<
@@ -55728,7 +56645,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_1 = __pyx_v_phrase_list; __Pyx_INCREF(__pyx_t_1); __pyx_t_13 = 0;
__pyx_t_16 = NULL;
} else {
- __pyx_t_13 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_phrase_list); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_phrase_list); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_16 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -55736,23 +56653,23 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_14 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_14); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_14); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_14 = PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_14); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_14); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_14 = PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_14 = __pyx_t_16(__pyx_t_1);
if (unlikely(!__pyx_t_14)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -55768,7 +56685,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -55781,14 +56698,14 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_INCREF(__pyx_t_15);
__Pyx_INCREF(__pyx_t_2);
#else
- __pyx_t_15 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_10 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__pyx_t_17 = Py_TYPE(__pyx_t_10)->tp_iternext;
@@ -55796,7 +56713,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_GOTREF(__pyx_t_15);
index = 1; __pyx_t_2 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L92_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_17 = NULL;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
goto __pyx_L93_unpacking_done;
@@ -55804,7 +56721,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_17 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L93_unpacking_done:;
}
__Pyx_XDECREF(__pyx_v_phrase2);
@@ -55814,7 +56731,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_v_eindexes = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1735
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1785
* pair_count = 0
* for phrase2, eindexes in phrase_list:
* als3 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) # <<<<<<<<<<<<<<
@@ -55823,31 +56740,31 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_t_14 = ((PyObject *)__pyx_v_self->findexes);
__Pyx_INCREF(__pyx_t_14);
- __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, __pyx_t_14, __pyx_v_eindexes)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, __pyx_t_14, __pyx_v_eindexes)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__Pyx_XDECREF(((PyObject *)__pyx_v_als3));
__pyx_v_als3 = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1736
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1786
* for phrase2, eindexes in phrase_list:
* als3 = self.create_alignments(sent_links,num_links,self.findexes,eindexes)
* extracts.append((fphr, phrase2, pair_count, tuple(als3))) # <<<<<<<<<<<<<<
* if (num_gaps < self.max_nonterminals - 1 and
* phrase_len+1 < self.max_length and
*/
- __pyx_t_2 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_INCREF(((PyObject *)__pyx_v_als3));
PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_v_als3));
__Pyx_GIVEREF(((PyObject *)__pyx_v_als3));
- __pyx_t_15 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
- __pyx_t_14 = PyTuple_New(4); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyTuple_New(4); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_INCREF(((PyObject *)__pyx_v_fphr));
PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_v_fphr));
@@ -55861,7 +56778,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_GIVEREF(__pyx_t_15);
__pyx_t_2 = 0;
__pyx_t_15 = 0;
- __pyx_t_15 = __Pyx_PyObject_Append(__pyx_v_extracts, ((PyObject *)__pyx_t_14)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_PyObject_Append(__pyx_v_extracts, ((PyObject *)__pyx_t_14)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
@@ -55874,7 +56791,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L79:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1737
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1787
* 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 # <<<<<<<<<<<<<<
@@ -55884,7 +56801,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_7 = (__pyx_v_num_gaps < (__pyx_v_self->max_nonterminals - 1));
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1738
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1788
* extracts.append((fphr, phrase2, pair_count, tuple(als3)))
* if (num_gaps < self.max_nonterminals - 1 and
* phrase_len+1 < self.max_length and # <<<<<<<<<<<<<<
@@ -55894,7 +56811,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_9 = ((__pyx_v_phrase_len + 1) < __pyx_v_self->max_length);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1739
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1789
* if (num_gaps < self.max_nonterminals - 1 and
* phrase_len+1 < self.max_length and
* f_back_high == f_high and # <<<<<<<<<<<<<<
@@ -55904,7 +56821,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_18 = (__pyx_v_f_back_high == __pyx_v_f_high);
if (__pyx_t_18) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1740
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1790
* phrase_len+1 < self.max_length and
* f_back_high == f_high and
* f_back_low == f_low and # <<<<<<<<<<<<<<
@@ -55914,7 +56831,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_8 = (__pyx_v_f_back_low == __pyx_v_f_low);
if (__pyx_t_8) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1741
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1791
* 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 # <<<<<<<<<<<<<<
@@ -55924,7 +56841,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_19 = (((__pyx_v_f_back_high - __pyx_v_f_back_low) + (2 * __pyx_v_self->train_min_gap_size)) <= __pyx_v_self->train_max_initial_size);
if (__pyx_t_19) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1742
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1792
* 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 # <<<<<<<<<<<<<<
@@ -55934,7 +56851,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_20 = (__pyx_v_f_low >= __pyx_v_self->train_min_gap_size);
if (__pyx_t_20) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1743
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1793
* 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 # <<<<<<<<<<<<<<
@@ -55944,7 +56861,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_21 = (__pyx_v_f_high <= (__pyx_v_f_sent_len - __pyx_v_self->train_min_gap_size));
if (__pyx_t_21) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1744
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1794
* 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))): # <<<<<<<<<<<<<<
@@ -55994,7 +56911,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1746
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1796
* ((not self.tight_phrases) or (f_links_low[f_low-1] != -1 and f_links_low[f_high] != -1))):
*
* met_constraints = 1 # <<<<<<<<<<<<<<
@@ -56003,7 +56920,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_met_constraints = 1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1747
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1797
*
* met_constraints = 1
* f_x_low = f_low-self.train_min_gap_size # <<<<<<<<<<<<<<
@@ -56012,7 +56929,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_f_x_low = (__pyx_v_f_low - __pyx_v_self->train_min_gap_size);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1748
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1798
* met_constraints = 1
* f_x_low = f_low-self.train_min_gap_size
* if self.tight_phrases: # <<<<<<<<<<<<<<
@@ -56021,7 +56938,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
if (__pyx_v_self->tight_phrases) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1749
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1799
* 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: # <<<<<<<<<<<<<<
@@ -56038,7 +56955,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (!__pyx_t_18) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1750
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1800
* if self.tight_phrases:
* while f_x_low >= 0 and f_links_low[f_x_low] == -1:
* f_x_low = f_x_low - 1 # <<<<<<<<<<<<<<
@@ -56051,7 +56968,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L95:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1751
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1801
* 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: # <<<<<<<<<<<<<<
@@ -56061,7 +56978,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_18 = (__pyx_v_f_x_low < 0);
if (__pyx_t_18) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1752
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1802
* f_x_low = f_x_low - 1
* if f_x_low < 0:
* met_constraints = 0 # <<<<<<<<<<<<<<
@@ -56073,7 +56990,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L98:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1754
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1804
* met_constraints = 0
*
* f_x_high = f_high+self.train_min_gap_size # <<<<<<<<<<<<<<
@@ -56082,7 +56999,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_f_x_high = (__pyx_v_f_high + __pyx_v_self->train_min_gap_size);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1755
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1805
*
* f_x_high = f_high+self.train_min_gap_size
* if self.tight_phrases: # <<<<<<<<<<<<<<
@@ -56091,7 +57008,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
if (__pyx_v_self->tight_phrases) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1756
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1806
* 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: # <<<<<<<<<<<<<<
@@ -56108,7 +57025,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (!__pyx_t_7) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1757
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1807
* 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 # <<<<<<<<<<<<<<
@@ -56121,7 +57038,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L99:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1758
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1808
* 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: # <<<<<<<<<<<<<<
@@ -56137,7 +57054,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1759
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1809
* 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 # <<<<<<<<<<<<<<
@@ -56149,7 +57066,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L102:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1761
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1811
* met_constraints = 0
*
* if (met_constraints and # <<<<<<<<<<<<<<
@@ -56158,17 +57075,17 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
if (__pyx_v_met_constraints) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1762
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1812
*
* if (met_constraints and
* self.find_fixpoint(f_x_low, f_x_high, # <<<<<<<<<<<<<<
* f_links_low, f_links_high, e_links_low, e_links_high,
* e_low, e_high, &e_x_low, &e_x_high, &f_x_low, &f_x_high,
*/
- __pyx_t_1 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1766
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1816
* 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, # <<<<<<<<<<<<<<
@@ -56178,7 +57095,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
if (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_x_low, __pyx_t_1, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_e_low, __pyx_v_e_high, (&__pyx_v_e_x_low), (&__pyx_v_e_x_high), (&__pyx_v_f_x_low), (&__pyx_v_f_x_high), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 1, 1, 2, 1, 1, 1, 1)) {
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1768
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1818
* self.train_max_initial_size, self.train_max_initial_size,
* 1, 1, 2, 1, 1, 1, 1) and
* ((not self.tight_phrases) or (f_links_low[f_x_low] != -1 and f_links_low[f_x_high-1] != -1)) and # <<<<<<<<<<<<<<
@@ -56200,17 +57117,17 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1769
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1819
* 1, 1, 2, 1, 1, 1, 1) and
* ((not self.tight_phrases) or (f_links_low[f_x_low] != -1 and f_links_low[f_x_high-1] != -1)) and
* self.find_fixpoint(f_x_low, f_low, # <<<<<<<<<<<<<<
* f_links_low, f_links_high, e_links_low, e_links_high,
* -1, -1, e_gap_low, e_gap_high, f_gap_low, f_gap_high,
*/
- __pyx_t_15 = PyInt_FromLong(__pyx_v_f_low); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyInt_FromLong(__pyx_v_f_low); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1773
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1823
* -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, # <<<<<<<<<<<<<<
@@ -56221,17 +57138,17 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1775
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1825
* self.train_max_initial_size, self.train_max_initial_size,
* 0, 0, 0, 0, 0, 0, 0) and
* self.find_fixpoint(f_high, f_x_high, # <<<<<<<<<<<<<<
* f_links_low, f_links_high, e_links_low, e_links_high,
* -1, -1, e_gap_low+1+num_gaps, e_gap_high+1+num_gaps,
*/
- __pyx_t_15 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1780
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1830
* 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, # <<<<<<<<<<<<<<
@@ -56259,7 +57176,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_8) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1782
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1832
* self.train_max_initial_size, self.train_max_initial_size,
* 0, 0, 0, 0, 0, 0, 0)):
* fphr_arr._clear() # <<<<<<<<<<<<<<
@@ -56268,7 +57185,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_clear(__pyx_v_fphr_arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1783
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1833
* 0, 0, 0, 0, 0, 0, 0)):
* fphr_arr._clear()
* i = 1 # <<<<<<<<<<<<<<
@@ -56277,35 +57194,35 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_i = 1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1784
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1834
* fphr_arr._clear()
* i = 1
* self.findexes.reset() # <<<<<<<<<<<<<<
* self.findexes.append(sym_setindex(self.category, i))
* fphr_arr._append(sym_setindex(self.category, i))
*/
- __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_15 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1785
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1835
* i = 1
* self.findexes.reset()
* self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1
*/
- __pyx_t_15 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_15); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_15); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1786
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1836
* self.findexes.reset()
* self.findexes.append(sym_setindex(self.category, i))
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -56314,7 +57231,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1787
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1837
* self.findexes.append(sym_setindex(self.category, i))
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1 # <<<<<<<<<<<<<<
@@ -56323,27 +57240,27 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_i = (__pyx_v_i + 1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1788
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1838
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1
* self.findexes.extend(self.findexes1) # <<<<<<<<<<<<<<
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]):
*/
- __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(((PyObject *)__pyx_v_self->findexes1));
PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_v_self->findexes1));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->findexes1));
- __pyx_t_14 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1789
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1839
* i = i+1
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<<
@@ -56353,7 +57270,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_3 = __pyx_v_phrase->n;
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_3; __pyx_v_j++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1790
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1840
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<<
@@ -56363,7 +57280,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_4 = __pyx_f_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j]));
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1791
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1841
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -56372,7 +57289,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1792
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1842
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i))
* i = i + 1 # <<<<<<<<<<<<<<
@@ -56384,7 +57301,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1794
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1844
* i = i + 1
* else:
* fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<<
@@ -56396,7 +57313,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_L106:;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1795
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1845
* else:
* fphr_arr._append(phrase.syms[j])
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -56405,81 +57322,81 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1796
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1846
* fphr_arr._append(phrase.syms[j])
* fphr_arr._append(sym_setindex(self.category, i))
* self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
* fphr = Phrase(fphr_arr)
* phrase_list = self.extract_phrases(e_x_low, e_x_high, e_gap_low, e_gap_high, e_links_low, num_gaps+2,
*/
- __pyx_t_14 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
- __pyx_t_15 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_14); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_14); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1797
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1847
* fphr_arr._append(sym_setindex(self.category, i))
* self.findexes.append(sym_setindex(self.category, i))
* fphr = Phrase(fphr_arr) # <<<<<<<<<<<<<<
* phrase_list = self.extract_phrases(e_x_low, e_x_high, e_gap_low, e_gap_high, e_links_low, num_gaps+2,
* f_x_low, f_x_high, f_gap_low, f_gap_high, f_links_low,
*/
- __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(((PyObject *)__pyx_v_fphr_arr));
PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_v_fphr_arr));
__Pyx_GIVEREF(((PyObject *)__pyx_v_fphr_arr));
- __pyx_t_14 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
__Pyx_DECREF(((PyObject *)__pyx_v_fphr));
__pyx_v_fphr = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_14);
__pyx_t_14 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1800
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1850
* phrase_list = self.extract_phrases(e_x_low, e_x_high, e_gap_low, e_gap_high, e_links_low, num_gaps+2,
* f_x_low, f_x_high, f_gap_low, f_gap_high, f_links_low,
* matching.sent_id, e_sent_len, e_sent_start) # <<<<<<<<<<<<<<
* if len(phrase_list) > 0:
* pair_count = 1.0 / len(phrase_list)
*/
- __pyx_t_14 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->extract_phrases(__pyx_v_self, __pyx_v_e_x_low, __pyx_v_e_x_high, __pyx_v_e_gap_low, __pyx_v_e_gap_high, __pyx_v_e_links_low, (__pyx_v_num_gaps + 2), __pyx_v_f_x_low, __pyx_v_f_x_high, __pyx_v_f_gap_low, __pyx_v_f_gap_high, __pyx_v_f_links_low, __pyx_v_matching->sent_id, __pyx_v_e_sent_len, __pyx_v_e_sent_start); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->extract_phrases(__pyx_v_self, __pyx_v_e_x_low, __pyx_v_e_x_high, __pyx_v_e_gap_low, __pyx_v_e_gap_high, __pyx_v_e_links_low, (__pyx_v_num_gaps + 2), __pyx_v_f_x_low, __pyx_v_f_x_high, __pyx_v_f_gap_low, __pyx_v_f_gap_high, __pyx_v_f_links_low, __pyx_v_matching->sent_id, __pyx_v_e_sent_len, __pyx_v_e_sent_start); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_XDECREF(__pyx_v_phrase_list);
__pyx_v_phrase_list = __pyx_t_14;
__pyx_t_14 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1801
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1851
* f_x_low, f_x_high, f_gap_low, f_gap_high, f_links_low,
* matching.sent_id, e_sent_len, e_sent_start)
* if len(phrase_list) > 0: # <<<<<<<<<<<<<<
* pair_count = 1.0 / len(phrase_list)
* else:
*/
- __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_8 = (__pyx_t_13 > 0);
if (__pyx_t_8) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1802
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1852
* matching.sent_id, e_sent_len, e_sent_start)
* if len(phrase_list) > 0:
* pair_count = 1.0 / len(phrase_list) # <<<<<<<<<<<<<<
* else:
* pair_count = 0
*/
- __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (unlikely(__pyx_t_13 == 0)) {
PyErr_Format(PyExc_ZeroDivisionError, "float division");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_v_pair_count = (1.0 / __pyx_t_13);
goto __pyx_L107;
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1804
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1854
* pair_count = 1.0 / len(phrase_list)
* else:
* pair_count = 0 # <<<<<<<<<<<<<<
@@ -56490,7 +57407,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L107:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1805
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1855
* else:
* pair_count = 0
* for phrase2, eindexes in phrase_list: # <<<<<<<<<<<<<<
@@ -56501,7 +57418,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_14 = __pyx_v_phrase_list; __Pyx_INCREF(__pyx_t_14); __pyx_t_13 = 0;
__pyx_t_16 = NULL;
} else {
- __pyx_t_13 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_v_phrase_list); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_v_phrase_list); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__pyx_t_16 = Py_TYPE(__pyx_t_14)->tp_iternext;
}
@@ -56509,23 +57426,23 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_14)) {
if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_14)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_15 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_15 = PySequence_ITEM(__pyx_t_14, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PySequence_ITEM(__pyx_t_14, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_14)) {
if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_14)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_15 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_15 = PySequence_ITEM(__pyx_t_14, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PySequence_ITEM(__pyx_t_14, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_15 = __pyx_t_16(__pyx_t_14);
if (unlikely(!__pyx_t_15)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -56541,7 +57458,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -56554,14 +57471,14 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_2);
#else
- __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_10 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__pyx_t_17 = Py_TYPE(__pyx_t_10)->tp_iternext;
@@ -56569,7 +57486,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_GOTREF(__pyx_t_1);
index = 1; __pyx_t_2 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L110_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_17 = NULL;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
goto __pyx_L111_unpacking_done;
@@ -56577,7 +57494,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_17 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L111_unpacking_done:;
}
__Pyx_XDECREF(__pyx_v_phrase2);
@@ -56587,7 +57504,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_v_eindexes = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1806
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1856
* pair_count = 0
* for phrase2, eindexes in phrase_list:
* als4 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) # <<<<<<<<<<<<<<
@@ -56596,31 +57513,31 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_t_15 = ((PyObject *)__pyx_v_self->findexes);
__Pyx_INCREF(__pyx_t_15);
- __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, __pyx_t_15, __pyx_v_eindexes)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, __pyx_t_15, __pyx_v_eindexes)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_XDECREF(((PyObject *)__pyx_v_als4));
__pyx_v_als4 = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1807
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1857
* for phrase2, eindexes in phrase_list:
* als4 = self.create_alignments(sent_links,num_links,self.findexes,eindexes)
* extracts.append((fphr, phrase2, pair_count, tuple(als4))) # <<<<<<<<<<<<<<
* else:
* reason_for_failure = "Unable to extract basic phrase"
*/
- __pyx_t_2 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(((PyObject *)__pyx_v_als4));
PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_v_als4));
__Pyx_GIVEREF(((PyObject *)__pyx_v_als4));
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
- __pyx_t_15 = PyTuple_New(4); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(4); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(((PyObject *)__pyx_v_fphr));
PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_v_fphr));
@@ -56634,7 +57551,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_2 = 0;
__pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_extracts, ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_extracts, ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -56656,7 +57573,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1809
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1859
* extracts.append((fphr, phrase2, pair_count, tuple(als4)))
* else:
* reason_for_failure = "Unable to extract basic phrase" # <<<<<<<<<<<<<<
@@ -56672,7 +57589,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L33:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1811
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1861
* reason_for_failure = "Unable to extract basic phrase"
*
* free(sent_links) # <<<<<<<<<<<<<<
@@ -56681,7 +57598,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
free(__pyx_v_sent_links);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1812
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1862
*
* free(sent_links)
* free(f_links_low) # <<<<<<<<<<<<<<
@@ -56690,7 +57607,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
free(__pyx_v_f_links_low);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1813
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1863
* free(sent_links)
* free(f_links_low)
* free(f_links_high) # <<<<<<<<<<<<<<
@@ -56699,7 +57616,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
free(__pyx_v_f_links_high);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1814
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1864
* free(f_links_low)
* free(f_links_high)
* free(e_links_low) # <<<<<<<<<<<<<<
@@ -56708,7 +57625,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
free(__pyx_v_e_links_low);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1815
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1865
* free(f_links_high)
* free(e_links_low)
* free(e_links_high) # <<<<<<<<<<<<<<
@@ -56717,7 +57634,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
free(__pyx_v_e_links_high);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1816
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1866
* free(e_links_low)
* free(e_links_high)
* free(f_gap_low) # <<<<<<<<<<<<<<
@@ -56726,7 +57643,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
free(__pyx_v_f_gap_low);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1817
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1867
* free(e_links_high)
* free(f_gap_low)
* free(f_gap_high) # <<<<<<<<<<<<<<
@@ -56735,7 +57652,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
free(__pyx_v_f_gap_high);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1818
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1868
* free(f_gap_low)
* free(f_gap_high)
* free(e_gap_low) # <<<<<<<<<<<<<<
@@ -56744,7 +57661,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
free(__pyx_v_e_gap_low);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1819
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1869
* free(f_gap_high)
* free(e_gap_low)
* free(e_gap_high) # <<<<<<<<<<<<<<
@@ -56753,7 +57670,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
free(__pyx_v_e_gap_high);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1821
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1871
* free(e_gap_high)
*
* return extracts # <<<<<<<<<<<<<<
@@ -56825,16 +57742,16 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_26add_instance(PyObject
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e_words)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("add_instance", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1829; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("add_instance", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__alignment)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("add_instance", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1829; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("add_instance", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_instance") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1829; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_instance") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
@@ -56849,7 +57766,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_26add_instance(PyObject
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("add_instance", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1829; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("add_instance", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.HieroCachingRuleFactory.add_instance", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -56903,46 +57820,46 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_12add_instance_1extract
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f_j)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1861; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e_i)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1861; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e_j)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1861; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__min_bound)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1861; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__wc)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1861; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__links)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 6); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1861; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 6); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nt)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 7); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1861; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 7); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nt_open)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 8); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1861; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 8); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "extract") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1861; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "extract") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -56969,7 +57886,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_12add_instance_1extract
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1861; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.HieroCachingRuleFactory.add_instance.extract", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -56980,7 +57897,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_12add_instance_1extract
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1861
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1913
* # 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): # <<<<<<<<<<<<<<
@@ -56989,8 +57906,8 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_12add_instance_1extract
*/
static PyObject *__pyx_pf_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_3_sa___pyx_scope_struct_20_add_instance *__pyx_cur_scope;
- struct __pyx_obj_3_sa___pyx_scope_struct_20_add_instance *__pyx_outer_scope;
+ struct __pyx_obj_3_sa___pyx_scope_struct_21_add_instance *__pyx_cur_scope;
+ struct __pyx_obj_3_sa___pyx_scope_struct_21_add_instance *__pyx_outer_scope;
PyObject *__pyx_v_link_i = NULL;
PyObject *__pyx_v_link_j = NULL;
PyObject *__pyx_v_new_e_i = NULL;
@@ -57023,36 +57940,36 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("extract", 0);
- __pyx_outer_scope = (struct __pyx_obj_3_sa___pyx_scope_struct_20_add_instance *) __Pyx_CyFunction_GetClosure(__pyx_self);
+ __pyx_outer_scope = (struct __pyx_obj_3_sa___pyx_scope_struct_21_add_instance *) __Pyx_CyFunction_GetClosure(__pyx_self);
__pyx_cur_scope = __pyx_outer_scope;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1863
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1915
* def extract(f_i, f_j, e_i, e_j, min_bound, wc, links, nt, nt_open):
* # Phrase extraction limits
* if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: # <<<<<<<<<<<<<<
* return
* # Unaligned word
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_f_len)) { __Pyx_RaiseClosureNameError("f_len"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1863; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_1 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_f_len, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_f_len)) { __Pyx_RaiseClosureNameError("f_len"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_1 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_f_len, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_RichCompare(__pyx_v_f_j, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_RichCompare(__pyx_v_f_j, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (!__pyx_t_3) {
- __pyx_t_2 = PyNumber_Subtract(__pyx_v_f_j, __pyx_v_f_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Subtract(__pyx_v_f_j, __pyx_v_f_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1863; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_6 = __pyx_t_5;
} else {
@@ -57060,7 +57977,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
if (__pyx_t_6) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1864
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1916
* # Phrase extraction limits
* if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size:
* return # <<<<<<<<<<<<<<
@@ -57074,41 +57991,41 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1866
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1918
* return
* # Unaligned word
* if not al[f_j]: # <<<<<<<<<<<<<<
* # Adjacent to non-terminal: extend (non-terminal now open)
* if nt and nt[-1][2] == f_j - 1:
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_al)) { __Pyx_RaiseClosureNameError("al"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_al)) { __Pyx_RaiseClosureNameError("al"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_3 = (!__pyx_t_6);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1868
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1920
* if not al[f_j]:
* # Adjacent to non-terminal: extend (non-terminal now open)
* if nt and nt[-1][2] == f_j - 1: # <<<<<<<<<<<<<<
* nt[-1][2] += 1
* extract(f_i, f_j + 1, e_i, e_j, min_bound, wc, links, nt, True)
*/
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_3) {
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Subtract(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Subtract(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_5 = __pyx_t_6;
} else {
@@ -57116,38 +58033,38 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1869
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1921
* # Adjacent to non-terminal: extend (non-terminal now open)
* if nt and nt[-1][2] == f_j - 1:
* nt[-1][2] += 1 # <<<<<<<<<<<<<<
* extract(f_i, f_j + 1, e_i, e_j, min_bound, wc, links, nt, True)
* nt[-1][2] -= 1
*/
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_7 = 2;
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, __pyx_t_7, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, __pyx_t_7, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__Pyx_SetItemInt(__pyx_t_1, __pyx_t_7, __pyx_t_2, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_t_1, __pyx_t_7, __pyx_t_2, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1870
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1922
* if nt and nt[-1][2] == f_j - 1:
* nt[-1][2] += 1
* extract(f_i, f_j + 1, e_i, e_j, min_bound, wc, links, nt, True) # <<<<<<<<<<<<<<
* nt[-1][2] -= 1
* # Unless non-terminal already open, always extend with word
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_1 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_1 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyTuple_New(9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_f_i);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_f_i);
@@ -57176,48 +58093,48 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1871
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1923
* nt[-1][2] += 1
* extract(f_i, f_j + 1, e_i, e_j, min_bound, wc, links, nt, True)
* nt[-1][2] -= 1 # <<<<<<<<<<<<<<
* # Unless non-terminal already open, always extend with word
* # Make sure adding a word doesn't exceed length
*/
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_7 = 2;
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, __pyx_t_7, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, __pyx_t_7, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__Pyx_SetItemInt(__pyx_t_2, __pyx_t_7, __pyx_t_1, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_t_2, __pyx_t_7, __pyx_t_1, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
goto __pyx_L5;
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1874
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1926
* # Unless non-terminal already open, always extend with word
* # Make sure adding a word doesn't exceed length
* if not nt_open and wc < self.max_length: # <<<<<<<<<<<<<<
* extract(f_i, f_j + 1, e_i, e_j, min_bound, wc + 1, links, nt, False)
* return
*/
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_nt_open); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_nt_open); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_3 = (!__pyx_t_5);
if (__pyx_t_3) {
- __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_6 = __pyx_t_5;
} else {
@@ -57225,21 +58142,21 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
if (__pyx_t_6) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1875
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1927
* # Make sure adding a word doesn't exceed length
* if not nt_open and wc < self.max_length:
* extract(f_i, f_j + 1, e_i, e_j, min_bound, wc + 1, links, nt, False) # <<<<<<<<<<<<<<
* return
* # Aligned word
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_1 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_1 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = PyTuple_New(9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_New(9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(__pyx_v_f_i);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_f_i);
@@ -57268,7 +58185,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -57276,7 +58193,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
__pyx_L6:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1876
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1928
* 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 # <<<<<<<<<<<<<<
@@ -57290,38 +58207,38 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1878
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1930
* return
* # Aligned word
* link_i = fe_span[f_j][0] # <<<<<<<<<<<<<<
* link_j = fe_span[f_j][1]
* new_e_i = min(link_i, e_i)
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_fe_span)) { __Pyx_RaiseClosureNameError("fe_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f_j); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_fe_span)) { __Pyx_RaiseClosureNameError("fe_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f_j); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_link_i = __pyx_t_8;
__pyx_t_8 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1879
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1931
* # Aligned word
* link_i = fe_span[f_j][0]
* link_j = fe_span[f_j][1] # <<<<<<<<<<<<<<
* new_e_i = min(link_i, e_i)
* new_e_j = max(link_j, e_j)
*/
- __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f_j); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f_j); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_8, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_8, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_v_link_j = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1880
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1932
* link_i = fe_span[f_j][0]
* link_j = fe_span[f_j][1]
* new_e_i = min(link_i, e_i) # <<<<<<<<<<<<<<
@@ -57332,8 +58249,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__pyx_t_4 = __pyx_v_e_i;
__Pyx_INCREF(__pyx_v_link_i);
__pyx_t_8 = __pyx_v_link_i;
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_8, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_8, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_6) {
__Pyx_INCREF(__pyx_t_4);
@@ -57348,7 +58265,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__pyx_v_new_e_i = __pyx_t_2;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1881
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1933
* link_j = fe_span[f_j][1]
* new_e_i = min(link_i, e_i)
* new_e_j = max(link_j, e_j) # <<<<<<<<<<<<<<
@@ -57359,8 +58276,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__pyx_t_2 = __pyx_v_e_j;
__Pyx_INCREF(__pyx_v_link_j);
__pyx_t_4 = __pyx_v_link_j;
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_6) {
__Pyx_INCREF(__pyx_t_2);
@@ -57375,7 +58292,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__pyx_v_new_e_j = __pyx_t_8;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1884
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1936
* # 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 # <<<<<<<<<<<<<<
@@ -57385,54 +58302,54 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__Pyx_INCREF(__pyx_v_min_bound);
__pyx_v_new_min_bound = __pyx_v_min_bound;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1886
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1938
* new_min_bound = min_bound
* # First aligned word creates span
* if e_j == -1: # <<<<<<<<<<<<<<
* for i from new_e_i <= i <= new_e_j:
* if ef_span[i][0] < f_i:
*/
- __pyx_t_8 = PyObject_RichCompare(__pyx_v_e_j, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_RichCompare(__pyx_v_e_j, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (__pyx_t_6) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1887
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1939
* # First aligned word creates span
* if e_j == -1:
* for i from new_e_i <= i <= new_e_j: # <<<<<<<<<<<<<<
* if ef_span[i][0] < f_i:
* return
*/
- __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_v_new_e_i); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_v_new_e_j); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_v_new_e_i); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_v_new_e_j); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
for (__pyx_t_11 = __pyx_t_9; __pyx_t_11 <= __pyx_t_10; __pyx_t_11++) {
- __pyx_t_8 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_v_i);
__pyx_v_i = __pyx_t_8;
__pyx_t_8 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1888
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1940
* if e_j == -1:
* for i from new_e_i <= i <= new_e_j:
* if ef_span[i][0] < f_i: # <<<<<<<<<<<<<<
* return
* new_min_bound = max(new_min_bound, ef_span[i][1])
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_ef_span)) { __Pyx_RaiseClosureNameError("ef_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_ef_span)) { __Pyx_RaiseClosureNameError("ef_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_v_f_i, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_v_f_i, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (__pyx_t_6) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1889
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1941
* for i from new_e_i <= i <= new_e_j:
* if ef_span[i][0] < f_i:
* return # <<<<<<<<<<<<<<
@@ -57446,22 +58363,22 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
__pyx_L10:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1890
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1942
* if ef_span[i][0] < f_i:
* return
* new_min_bound = max(new_min_bound, ef_span[i][1]) # <<<<<<<<<<<<<<
* # Other aligned words extend span
* else:
*/
- __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_INCREF(__pyx_v_new_min_bound);
__pyx_t_8 = __pyx_v_new_min_bound;
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_8, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_8, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_6) {
__Pyx_INCREF(__pyx_t_2);
@@ -57476,17 +58393,17 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__Pyx_DECREF(__pyx_v_new_min_bound);
__pyx_v_new_min_bound = __pyx_t_4;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1887
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1939
* # First aligned word creates span
* if e_j == -1:
* for i from new_e_i <= i <= new_e_j: # <<<<<<<<<<<<<<
* if ef_span[i][0] < f_i:
* return
*/
- __pyx_t_4 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_v_i);
__pyx_v_i = __pyx_t_4;
@@ -57495,42 +58412,42 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1893
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1945
* # Other aligned words extend span
* else:
* for i from new_e_i <= i < e_i: # <<<<<<<<<<<<<<
* if ef_span[i][0] < f_i:
* return
*/
- __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_v_new_e_i); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_v_e_i); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_v_new_e_i); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_v_e_i); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
for (__pyx_t_9 = __pyx_t_11; __pyx_t_9 < __pyx_t_10; __pyx_t_9++) {
- __pyx_t_4 = PyInt_FromLong(__pyx_t_9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_t_9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_v_i);
__pyx_v_i = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1894
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1946
* else:
* for i from new_e_i <= i < e_i:
* if ef_span[i][0] < f_i: # <<<<<<<<<<<<<<
* return
* new_min_bound = max(new_min_bound, ef_span[i][1])
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_ef_span)) { __Pyx_RaiseClosureNameError("ef_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_ef_span)) { __Pyx_RaiseClosureNameError("ef_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_v_f_i, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_v_f_i, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_6) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1895
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1947
* for i from new_e_i <= i < e_i:
* if ef_span[i][0] < f_i:
* return # <<<<<<<<<<<<<<
@@ -57544,22 +58461,22 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
__pyx_L13:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1896
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1948
* if ef_span[i][0] < f_i:
* return
* new_min_bound = max(new_min_bound, ef_span[i][1]) # <<<<<<<<<<<<<<
* for i from e_j < i <= new_e_j:
* if ef_span[i][0] < f_i:
*/
- __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_INCREF(__pyx_v_new_min_bound);
__pyx_t_4 = __pyx_v_new_min_bound;
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_6) {
__Pyx_INCREF(__pyx_t_2);
@@ -57574,58 +58491,58 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__Pyx_DECREF(__pyx_v_new_min_bound);
__pyx_v_new_min_bound = __pyx_t_8;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1893
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1945
* # Other aligned words extend span
* else:
* for i from new_e_i <= i < e_i: # <<<<<<<<<<<<<<
* if ef_span[i][0] < f_i:
* return
*/
- __pyx_t_8 = PyInt_FromLong(__pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyInt_FromLong(__pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_v_i);
__pyx_v_i = __pyx_t_8;
__pyx_t_8 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1897
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1949
* return
* new_min_bound = max(new_min_bound, ef_span[i][1])
* for i from e_j < i <= new_e_j: # <<<<<<<<<<<<<<
* if ef_span[i][0] < f_i:
* return
*/
- __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_v_e_j); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_v_new_e_j); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_v_e_j); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_v_new_e_j); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
for (__pyx_t_11 = __pyx_t_9+1; __pyx_t_11 <= __pyx_t_10; __pyx_t_11++) {
- __pyx_t_8 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_v_i);
__pyx_v_i = __pyx_t_8;
__pyx_t_8 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1898
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1950
* new_min_bound = max(new_min_bound, ef_span[i][1])
* for i from e_j < i <= new_e_j:
* if ef_span[i][0] < f_i: # <<<<<<<<<<<<<<
* return
* new_min_bound = max(new_min_bound, ef_span[i][1])
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_ef_span)) { __Pyx_RaiseClosureNameError("ef_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_ef_span)) { __Pyx_RaiseClosureNameError("ef_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_v_f_i, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_v_f_i, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (__pyx_t_6) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1899
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1951
* for i from e_j < i <= new_e_j:
* if ef_span[i][0] < f_i:
* return # <<<<<<<<<<<<<<
@@ -57639,22 +58556,22 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
__pyx_L16:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1900
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1952
* if ef_span[i][0] < f_i:
* return
* new_min_bound = max(new_min_bound, ef_span[i][1]) # <<<<<<<<<<<<<<
* # Extract, extend with word (unless non-terminal open)
* if not nt_open:
*/
- __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_INCREF(__pyx_v_new_min_bound);
__pyx_t_8 = __pyx_v_new_min_bound;
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_8, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_8, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_6) {
__Pyx_INCREF(__pyx_t_2);
@@ -57669,17 +58586,17 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__Pyx_DECREF(__pyx_v_new_min_bound);
__pyx_v_new_min_bound = __pyx_t_4;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1897
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1949
* return
* new_min_bound = max(new_min_bound, ef_span[i][1])
* for i from e_j < i <= new_e_j: # <<<<<<<<<<<<<<
* if ef_span[i][0] < f_i:
* return
*/
- __pyx_t_4 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_v_i);
__pyx_v_i = __pyx_t_4;
@@ -57687,18 +58604,18 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
__pyx_L7:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1902
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1954
* new_min_bound = max(new_min_bound, ef_span[i][1])
* # Extract, extend with word (unless non-terminal open)
* if not nt_open: # <<<<<<<<<<<<<<
* nt_collision = False
* for link in al[f_j]:
*/
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_nt_open); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_nt_open); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_3 = (!__pyx_t_6);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1903
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1955
* # Extract, extend with word (unless non-terminal open)
* if not nt_open:
* nt_collision = False # <<<<<<<<<<<<<<
@@ -57707,20 +58624,20 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
*/
__pyx_v_nt_collision = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1904
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1956
* if not nt_open:
* nt_collision = False
* for link in al[f_j]: # <<<<<<<<<<<<<<
* if e_nt_cover[link]:
* nt_collision = True
*/
- __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
__pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
__pyx_t_12 = NULL;
} else {
- __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_12 = Py_TYPE(__pyx_t_2)->tp_iternext;
}
@@ -57729,23 +58646,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_2)) {
if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_2)) {
if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_12(__pyx_t_2);
if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -57755,21 +58672,21 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__pyx_v_link = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1905
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1957
* nt_collision = False
* for link in al[f_j]:
* if e_nt_cover[link]: # <<<<<<<<<<<<<<
* nt_collision = True
* # Non-terminal collisions block word extraction and extension, but
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1905; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_e_nt_cover, __pyx_v_link); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_e_nt_cover, __pyx_v_link); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1906
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1958
* for link in al[f_j]:
* if e_nt_cover[link]:
* nt_collision = True # <<<<<<<<<<<<<<
@@ -57783,7 +58700,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1909
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1961
* # 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: # <<<<<<<<<<<<<<
@@ -57792,11 +58709,11 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
*/
__pyx_t_3 = (!__pyx_v_nt_collision);
if (__pyx_t_3) {
- __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_5 = __pyx_t_6;
} else {
@@ -57804,32 +58721,32 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1910
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1962
* # may be okay for continuing non-terminals
* if not nt_collision and wc < self.max_length:
* plus_links = [] # <<<<<<<<<<<<<<
* for link in al[f_j]:
* plus_links.append((f_j, link))
*/
- __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_v_plus_links = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1911
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1963
* if not nt_collision and wc < self.max_length:
* plus_links = []
* for link in al[f_j]: # <<<<<<<<<<<<<<
* plus_links.append((f_j, link))
* cover[link] += 1
*/
- __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
__pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
__pyx_t_12 = NULL;
} else {
- __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_12 = Py_TYPE(__pyx_t_2)->tp_iternext;
}
@@ -57838,23 +58755,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_2)) {
if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_2)) {
if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_12(__pyx_t_2);
if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -57864,14 +58781,14 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__pyx_v_link = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1912
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1964
* plus_links = []
* for link in al[f_j]:
* plus_links.append((f_j, link)) # <<<<<<<<<<<<<<
* cover[link] += 1
* links.append(plus_links)
*/
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_f_j);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_f_j);
@@ -57879,10 +58796,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__Pyx_INCREF(__pyx_v_link);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_link);
__Pyx_GIVEREF(__pyx_v_link);
- __pyx_t_13 = PyList_Append(__pyx_v_plus_links, ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyList_Append(__pyx_v_plus_links, ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1913
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1965
* for link in al[f_j]:
* plus_links.append((f_j, link))
* cover[link] += 1 # <<<<<<<<<<<<<<
@@ -57891,41 +58808,41 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
*/
__Pyx_INCREF(__pyx_v_link);
__pyx_t_4 = __pyx_v_link;
- if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_cover, __pyx_t_4); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_cover, __pyx_t_4); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- if (PyObject_SetItem(__pyx_cur_scope->__pyx_v_cover, __pyx_t_4, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (PyObject_SetItem(__pyx_cur_scope->__pyx_v_cover, __pyx_t_4, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1914
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1966
* plus_links.append((f_j, link))
* cover[link] += 1
* links.append(plus_links) # <<<<<<<<<<<<<<
* if links and f_j >= new_min_bound:
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links))
*/
- __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_links, ((PyObject *)__pyx_v_plus_links)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_links, ((PyObject *)__pyx_v_plus_links)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1915
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1967
* cover[link] += 1
* links.append(plus_links)
* if links and f_j >= new_min_bound: # <<<<<<<<<<<<<<
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links))
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False)
*/
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_links); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_links); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_5) {
- __pyx_t_2 = PyObject_RichCompare(__pyx_v_f_j, __pyx_v_new_min_bound, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_RichCompare(__pyx_v_f_j, __pyx_v_new_min_bound, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_6 = __pyx_t_3;
} else {
@@ -57933,35 +58850,35 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
if (__pyx_t_6) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1916
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1968
* links.append(plus_links)
* if links and f_j >= new_min_bound:
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) # <<<<<<<<<<<<<<
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False)
* links.pop()
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_rules)) { __Pyx_RaiseClosureNameError("rules"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_2 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_rules, __pyx_n_s__add); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_rules)) { __Pyx_RaiseClosureNameError("rules"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_2 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_rules, __pyx_n_s__add); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__form_rule); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__form_rule); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_f_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_f_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_f_words, __pyx_t_7, __pyx_t_14); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_f_words, __pyx_t_7, __pyx_t_14); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (unlikely(!__pyx_cur_scope->__pyx_v_e_words)) { __Pyx_RaiseClosureNameError("e_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_v_new_e_i); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_8 = PyNumber_Add(__pyx_v_new_e_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_e_words)) { __Pyx_RaiseClosureNameError("e_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_v_new_e_i); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyNumber_Add(__pyx_v_new_e_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_e_words, __pyx_t_14, __pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_e_words, __pyx_t_14, __pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_15 = PyTuple_New(6); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(6); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(__pyx_v_f_i);
PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_f_i);
@@ -57981,16 +58898,16 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__Pyx_GIVEREF(__pyx_v_links);
__pyx_t_1 = 0;
__pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
- __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_8);
__pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
@@ -57999,21 +58916,21 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
__pyx_L24:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1917
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1969
* if links and f_j >= new_min_bound:
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links))
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False) # <<<<<<<<<<<<<<
* links.pop()
* for link in al[f_j]:
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_8 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_8 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_15 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyTuple_New(9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_f_i);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_f_i);
@@ -58042,36 +58959,36 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__pyx_t_8 = 0;
__pyx_t_15 = 0;
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1918
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1970
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links))
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False)
* links.pop() # <<<<<<<<<<<<<<
* for link in al[f_j]:
* cover[link] -= 1
*/
- __pyx_t_2 = __Pyx_PyObject_Pop(__pyx_v_links); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Pop(__pyx_v_links); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1919
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1971
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False)
* links.pop()
* for link in al[f_j]: # <<<<<<<<<<<<<<
* cover[link] -= 1
* # Try to add a word to current non-terminal (if any), extract, extend
*/
- __pyx_t_2 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
__pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0;
__pyx_t_12 = NULL;
} else {
- __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_12 = Py_TYPE(__pyx_t_4)->tp_iternext;
}
@@ -58080,23 +58997,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_4)) {
if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_4)) {
if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_2 = __pyx_t_12(__pyx_t_4);
if (unlikely(!__pyx_t_2)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -58106,7 +59023,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__pyx_v_link = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1920
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1972
* links.pop()
* for link in al[f_j]:
* cover[link] -= 1 # <<<<<<<<<<<<<<
@@ -58115,14 +59032,14 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
*/
__Pyx_INCREF(__pyx_v_link);
__pyx_t_2 = __pyx_v_link;
- if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_15 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_cover, __pyx_t_2); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_15 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_cover, __pyx_t_2); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_8 = PyNumber_InPlaceSubtract(__pyx_t_15, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyNumber_InPlaceSubtract(__pyx_t_15, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- if (PyObject_SetItem(__pyx_cur_scope->__pyx_v_cover, __pyx_t_2, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (PyObject_SetItem(__pyx_cur_scope->__pyx_v_cover, __pyx_t_2, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
@@ -58134,26 +59051,26 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
__pyx_L17:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1922
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1974
* cover[link] -= 1
* # Try to add a word to current non-terminal (if any), extract, extend
* if nt and nt[-1][2] == f_j - 1: # <<<<<<<<<<<<<<
* # Add to non-terminal, checking for collisions
* old_last_nt = nt[-1][:]
*/
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_6) {
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Subtract(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Subtract(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_3 = __pyx_t_5;
} else {
@@ -58161,70 +59078,70 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1924
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1976
* if nt and nt[-1][2] == f_j - 1:
* # Add to non-terminal, checking for collisions
* old_last_nt = nt[-1][:] # <<<<<<<<<<<<<<
* nt[-1][2] = f_j
* if link_i < nt[-1][3]:
*/
- __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_4 = __Pyx_PySequence_GetSlice(__pyx_t_8, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PySequence_GetSlice(__pyx_t_8, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_v_old_last_nt = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1925
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1977
* # Add to non-terminal, checking for collisions
* old_last_nt = nt[-1][:]
* nt[-1][2] = f_j # <<<<<<<<<<<<<<
* if link_i < nt[-1][3]:
* if not span_check(cover, link_i, nt[-1][3] - 1):
*/
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (__Pyx_SetItemInt(__pyx_t_4, 2, __pyx_v_f_j, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_t_4, 2, __pyx_v_f_j, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1926
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1978
* old_last_nt = nt[-1][:]
* nt[-1][2] = f_j
* if link_i < nt[-1][3]: # <<<<<<<<<<<<<<
* if not span_check(cover, link_i, nt[-1][3] - 1):
* nt[-1] = old_last_nt
*/
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_link_i, __pyx_t_8, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_v_link_i, __pyx_t_8, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1927
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1979
* nt[-1][2] = f_j
* if link_i < nt[-1][3]:
* if not span_check(cover, link_i, nt[-1][3] - 1): # <<<<<<<<<<<<<<
* nt[-1] = old_last_nt
* return
*/
- __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_check); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_check); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyNumber_Subtract(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyNumber_Subtract(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_cover);
@@ -58235,25 +59152,25 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_8);
__pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_6 = (!__pyx_t_3);
if (__pyx_t_6) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1928
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1980
* if link_i < nt[-1][3]:
* if not span_check(cover, link_i, nt[-1][3] - 1):
* nt[-1] = old_last_nt # <<<<<<<<<<<<<<
* return
* span_inc(cover, link_i, nt[-1][3] - 1)
*/
- if (__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1929
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1981
* if not span_check(cover, link_i, nt[-1][3] - 1):
* nt[-1] = old_last_nt
* return # <<<<<<<<<<<<<<
@@ -58267,24 +59184,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
__pyx_L29:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1930
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1982
* nt[-1] = old_last_nt
* return
* span_inc(cover, link_i, nt[-1][3] - 1) # <<<<<<<<<<<<<<
* span_inc(e_nt_cover, link_i, nt[-1][3] - 1)
* nt[-1][3] = link_i
*/
- __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_inc); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_inc); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Subtract(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Subtract(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_cover);
@@ -58295,31 +59212,31 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1931
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1983
* return
* span_inc(cover, link_i, nt[-1][3] - 1)
* span_inc(e_nt_cover, link_i, nt[-1][3] - 1) # <<<<<<<<<<<<<<
* nt[-1][3] = link_i
* if link_j > nt[-1][4]:
*/
- __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_inc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_inc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Subtract(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Subtract(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_e_nt_cover);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_e_nt_cover);
@@ -58330,64 +59247,64 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1932
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1984
* span_inc(cover, link_i, nt[-1][3] - 1)
* span_inc(e_nt_cover, link_i, nt[-1][3] - 1)
* nt[-1][3] = link_i # <<<<<<<<<<<<<<
* if link_j > nt[-1][4]:
* if not span_check(cover, nt[-1][4] + 1, link_j):
*/
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (__Pyx_SetItemInt(__pyx_t_4, 3, __pyx_v_link_i, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_t_4, 3, __pyx_v_link_i, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
goto __pyx_L28;
}
__pyx_L28:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1933
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1985
* span_inc(e_nt_cover, link_i, nt[-1][3] - 1)
* nt[-1][3] = link_i
* if link_j > nt[-1][4]: # <<<<<<<<<<<<<<
* if not span_check(cover, nt[-1][4] + 1, link_j):
* nt[-1] = old_last_nt
*/
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_link_j, __pyx_t_8, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_v_link_j, __pyx_t_8, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_6) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1934
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1986
* nt[-1][3] = link_i
* if link_j > nt[-1][4]:
* if not span_check(cover, nt[-1][4] + 1, link_j): # <<<<<<<<<<<<<<
* nt[-1] = old_last_nt
* return
*/
- __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_check); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_check); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_cover);
@@ -58398,25 +59315,25 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_link_j);
__Pyx_GIVEREF(__pyx_v_link_j);
__pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_3 = (!__pyx_t_6);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1935
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1987
* if link_j > nt[-1][4]:
* if not span_check(cover, nt[-1][4] + 1, link_j):
* nt[-1] = old_last_nt # <<<<<<<<<<<<<<
* return
* span_inc(cover, nt[-1][4] + 1, link_j)
*/
- if (__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1936
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1988
* if not span_check(cover, nt[-1][4] + 1, link_j):
* nt[-1] = old_last_nt
* return # <<<<<<<<<<<<<<
@@ -58430,24 +59347,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
__pyx_L31:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1937
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1989
* nt[-1] = old_last_nt
* return
* span_inc(cover, nt[-1][4] + 1, link_j) # <<<<<<<<<<<<<<
* span_inc(e_nt_cover, nt[-1][4] + 1, link_j)
* nt[-1][4] = link_j
*/
- __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_inc); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_inc); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_cover);
@@ -58458,31 +59375,31 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_link_j);
__Pyx_GIVEREF(__pyx_v_link_j);
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1938
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1990
* return
* span_inc(cover, nt[-1][4] + 1, link_j)
* span_inc(e_nt_cover, nt[-1][4] + 1, link_j) # <<<<<<<<<<<<<<
* nt[-1][4] = link_j
* if links and f_j >= new_min_bound:
*/
- __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_inc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_inc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Add(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Add(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_e_nt_cover);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_e_nt_cover);
@@ -58493,38 +59410,38 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_link_j);
__Pyx_GIVEREF(__pyx_v_link_j);
__pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1939
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1991
* span_inc(cover, nt[-1][4] + 1, link_j)
* span_inc(e_nt_cover, nt[-1][4] + 1, link_j)
* nt[-1][4] = link_j # <<<<<<<<<<<<<<
* if links and f_j >= new_min_bound:
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links))
*/
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (__Pyx_SetItemInt(__pyx_t_4, 4, __pyx_v_link_j, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_t_4, 4, __pyx_v_link_j, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
goto __pyx_L30;
}
__pyx_L30:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1940
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1992
* span_inc(e_nt_cover, nt[-1][4] + 1, link_j)
* nt[-1][4] = link_j
* if links and f_j >= new_min_bound: # <<<<<<<<<<<<<<
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links))
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc, links, nt, False)
*/
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_links); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_links); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_3) {
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_f_j, __pyx_v_new_min_bound, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_v_f_j, __pyx_v_new_min_bound, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_5 = __pyx_t_6;
} else {
@@ -58532,35 +59449,35 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1941
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1993
* nt[-1][4] = link_j
* if links and f_j >= new_min_bound:
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) # <<<<<<<<<<<<<<
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc, links, nt, False)
* nt[-1] = old_last_nt
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_rules)) { __Pyx_RaiseClosureNameError("rules"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_4 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_rules, __pyx_n_s__add); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_rules)) { __Pyx_RaiseClosureNameError("rules"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_4 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_rules, __pyx_n_s__add); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__form_rule); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__form_rule); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_f_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_f_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_f_words, __pyx_t_7, __pyx_t_14); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_f_words, __pyx_t_7, __pyx_t_14); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- if (unlikely(!__pyx_cur_scope->__pyx_v_e_words)) { __Pyx_RaiseClosureNameError("e_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_v_new_e_i); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_15 = PyNumber_Add(__pyx_v_new_e_j, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_e_words)) { __Pyx_RaiseClosureNameError("e_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_v_new_e_i); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyNumber_Add(__pyx_v_new_e_j, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_15); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_15); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_15 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_e_words, __pyx_t_14, __pyx_t_7); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_e_words, __pyx_t_14, __pyx_t_7); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_f_i);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_f_i);
@@ -58580,16 +59497,16 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__Pyx_GIVEREF(__pyx_v_links);
__pyx_t_2 = 0;
__pyx_t_15 = 0;
- __pyx_t_15 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_15);
__Pyx_GIVEREF(__pyx_t_15);
__pyx_t_15 = 0;
- __pyx_t_15 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
@@ -58598,19 +59515,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
__pyx_L32:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1942
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1994
* if links and f_j >= new_min_bound:
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links))
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc, links, nt, False) # <<<<<<<<<<<<<<
* nt[-1] = old_last_nt
* if link_i < nt[-1][3]:
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_15 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_15 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PyTuple_New(9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_f_i);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_f_i);
@@ -58639,57 +59556,57 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_15 = 0;
__pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1943
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1995
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links))
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc, links, nt, False)
* nt[-1] = old_last_nt # <<<<<<<<<<<<<<
* if link_i < nt[-1][3]:
* span_dec(cover, link_i, nt[-1][3] - 1)
*/
- if (__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1944
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1996
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc, links, nt, False)
* nt[-1] = old_last_nt
* if link_i < nt[-1][3]: # <<<<<<<<<<<<<<
* span_dec(cover, link_i, nt[-1][3] - 1)
* span_dec(e_nt_cover, link_i, nt[-1][3] - 1)
*/
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_link_i, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_link_i, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1945
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1997
* nt[-1] = old_last_nt
* if link_i < nt[-1][3]:
* span_dec(cover, link_i, nt[-1][3] - 1) # <<<<<<<<<<<<<<
* span_dec(e_nt_cover, link_i, nt[-1][3] - 1)
* if link_j > nt[-1][4]:
*/
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_dec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_dec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_4, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_4, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Subtract(__pyx_t_15, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Subtract(__pyx_t_15, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover);
PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_cur_scope->__pyx_v_cover);
@@ -58700,31 +59617,31 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1946
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1998
* if link_i < nt[-1][3]:
* span_dec(cover, link_i, nt[-1][3] - 1)
* span_dec(e_nt_cover, link_i, nt[-1][3] - 1) # <<<<<<<<<<<<<<
* if link_j > nt[-1][4]:
* span_dec(cover, nt[-1][4] + 1, link_j)
*/
- __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_dec); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_dec); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_15, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_15, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_15 = PyNumber_Subtract(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyNumber_Subtract(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_e_nt_cover);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_e_nt_cover);
@@ -58735,7 +59652,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_15);
__Pyx_GIVEREF(__pyx_t_15);
__pyx_t_15 = 0;
- __pyx_t_15 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
@@ -58744,43 +59661,43 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
__pyx_L33:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1947
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1999
* span_dec(cover, link_i, nt[-1][3] - 1)
* span_dec(e_nt_cover, link_i, nt[-1][3] - 1)
* if link_j > nt[-1][4]: # <<<<<<<<<<<<<<
* span_dec(cover, nt[-1][4] + 1, link_j)
* span_dec(e_nt_cover, nt[-1][4] + 1, link_j)
*/
- __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_15, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_15, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_15 = PyObject_RichCompare(__pyx_v_link_j, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_15); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_RichCompare(__pyx_v_link_j, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_15); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1948
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2000
* span_dec(e_nt_cover, link_i, nt[-1][3] - 1)
* if link_j > nt[-1][4]:
* span_dec(cover, nt[-1][4] + 1, link_j) # <<<<<<<<<<<<<<
* span_dec(e_nt_cover, nt[-1][4] + 1, link_j)
* # Try to start a new non-terminal, extract, extend
*/
- __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_dec); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_dec); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_cover);
@@ -58791,31 +59708,31 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_link_j);
__Pyx_GIVEREF(__pyx_v_link_j);
__pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1949
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2001
* if link_j > nt[-1][4]:
* span_dec(cover, nt[-1][4] + 1, link_j)
* span_dec(e_nt_cover, nt[-1][4] + 1, link_j) # <<<<<<<<<<<<<<
* # Try to start a new non-terminal, extract, extend
* if (not nt or f_j - nt[-1][2] > 1) and wc < self.max_length and len(nt) < self.max_nonterminals:
*/
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_dec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_dec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_4, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_4, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Add(__pyx_t_15, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Add(__pyx_t_15, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_e_nt_cover);
PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_cur_scope->__pyx_v_e_nt_cover);
@@ -58826,7 +59743,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_v_link_j);
__Pyx_GIVEREF(__pyx_v_link_j);
__pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
@@ -58838,41 +59755,41 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
__pyx_L27:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1951
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2003
* span_dec(e_nt_cover, nt[-1][4] + 1, link_j)
* # Try to start a new non-terminal, extract, extend
* if (not nt or f_j - nt[-1][2] > 1) and wc < self.max_length and len(nt) < self.max_nonterminals: # <<<<<<<<<<<<<<
* # Check for collisions
* if not span_check(cover, link_i, link_j):
*/
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_3 = (!__pyx_t_5);
if (!__pyx_t_3) {
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_4, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_4, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Subtract(__pyx_v_f_j, __pyx_t_15); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Subtract(__pyx_v_f_j, __pyx_t_15); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_15 = PyObject_RichCompare(__pyx_t_4, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_15); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_RichCompare(__pyx_t_4, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_15); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__pyx_t_6 = __pyx_t_5;
} else {
__pyx_t_6 = __pyx_t_3;
}
if (__pyx_t_6) {
- __pyx_t_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_15, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_15, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_3) {
- __pyx_t_7 = PyObject_Length(__pyx_v_nt); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_Length(__pyx_v_nt); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_5 = (__pyx_t_7 < __pyx_cur_scope->__pyx_v_self->max_nonterminals);
__pyx_t_16 = __pyx_t_5;
} else {
@@ -58884,17 +59801,17 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1953
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2005
* if (not nt or f_j - nt[-1][2] > 1) and wc < self.max_length and len(nt) < self.max_nonterminals:
* # Check for collisions
* if not span_check(cover, link_i, link_j): # <<<<<<<<<<<<<<
* return
* span_inc(cover, link_i, link_j)
*/
- __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_check); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_check); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover);
PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_cur_scope->__pyx_v_cover);
@@ -58905,16 +59822,16 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__Pyx_INCREF(__pyx_v_link_j);
PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_v_link_j);
__Pyx_GIVEREF(__pyx_v_link_j);
- __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_6 = (!__pyx_t_3);
if (__pyx_t_6) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1954
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2006
* # Check for collisions
* if not span_check(cover, link_i, link_j):
* return # <<<<<<<<<<<<<<
@@ -58928,16 +59845,16 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
__pyx_L36:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1955
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2007
* if not span_check(cover, link_i, link_j):
* return
* span_inc(cover, link_i, link_j) # <<<<<<<<<<<<<<
* span_inc(e_nt_cover, link_i, link_j)
* nt.append([(nt[-1][0] + 1) if nt else 1, f_j, f_j, link_i, link_j])
*/
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_inc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_inc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover);
PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_cur_scope->__pyx_v_cover);
@@ -58948,23 +59865,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__Pyx_INCREF(__pyx_v_link_j);
PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_v_link_j);
__Pyx_GIVEREF(__pyx_v_link_j);
- __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1956
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2008
* return
* span_inc(cover, link_i, link_j)
* span_inc(e_nt_cover, link_i, link_j) # <<<<<<<<<<<<<<
* nt.append([(nt[-1][0] + 1) if nt else 1, f_j, f_j, link_i, link_j])
* # Require at least one word in phrase
*/
- __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_inc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_inc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_e_nt_cover);
PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_cur_scope->__pyx_v_e_nt_cover);
@@ -58975,27 +59892,27 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__Pyx_INCREF(__pyx_v_link_j);
PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_v_link_j);
__Pyx_GIVEREF(__pyx_v_link_j);
- __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1957
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2009
* span_inc(cover, link_i, link_j)
* span_inc(e_nt_cover, link_i, link_j)
* nt.append([(nt[-1][0] + 1) if nt else 1, f_j, f_j, link_i, link_j]) # <<<<<<<<<<<<<<
* # Require at least one word in phrase
* if links and f_j >= new_min_bound:
*/
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_6) {
- __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_15, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_15, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_15 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_1 = __pyx_t_15;
@@ -59004,7 +59921,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__Pyx_INCREF(__pyx_int_1);
__pyx_t_1 = __pyx_int_1;
}
- __pyx_t_15 = PyList_New(5); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyList_New(5); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
PyList_SET_ITEM(__pyx_t_15, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
@@ -59021,22 +59938,22 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
PyList_SET_ITEM(__pyx_t_15, 4, __pyx_v_link_j);
__Pyx_GIVEREF(__pyx_v_link_j);
__pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_nt, ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_nt, ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1959
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2011
* nt.append([(nt[-1][0] + 1) if nt else 1, f_j, f_j, link_i, link_j])
* # Require at least one word in phrase
* if links and f_j >= new_min_bound: # <<<<<<<<<<<<<<
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links))
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False)
*/
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_links); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_links); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_6) {
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_f_j, __pyx_v_new_min_bound, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_f_j, __pyx_v_new_min_bound, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_16 = __pyx_t_3;
} else {
@@ -59044,35 +59961,35 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
if (__pyx_t_16) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1960
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2012
* # Require at least one word in phrase
* if links and f_j >= new_min_bound:
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) # <<<<<<<<<<<<<<
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False)
* nt.pop()
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_rules)) { __Pyx_RaiseClosureNameError("rules"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_1 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_rules, __pyx_n_s__add); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_rules)) { __Pyx_RaiseClosureNameError("rules"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_1 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_rules, __pyx_n_s__add); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_15 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__form_rule); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__form_rule); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_f_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_f_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_f_words, __pyx_t_7, __pyx_t_14); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_f_words, __pyx_t_7, __pyx_t_14); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (unlikely(!__pyx_cur_scope->__pyx_v_e_words)) { __Pyx_RaiseClosureNameError("e_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_v_new_e_i); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_8 = PyNumber_Add(__pyx_v_new_e_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_e_words)) { __Pyx_RaiseClosureNameError("e_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_v_new_e_i); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyNumber_Add(__pyx_v_new_e_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_e_words, __pyx_t_14, __pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_e_words, __pyx_t_14, __pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_f_i);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_f_i);
@@ -59092,16 +60009,16 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__Pyx_GIVEREF(__pyx_v_links);
__pyx_t_4 = 0;
__pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_8);
__pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
@@ -59110,21 +60027,21 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
__pyx_L37:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1961
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2013
* if links and f_j >= new_min_bound:
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links))
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False) # <<<<<<<<<<<<<<
* nt.pop()
* span_dec(cover, link_i, link_j)
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_8 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_8 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_2 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_15 = PyTuple_New(9); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(9); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(__pyx_v_f_i);
PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_f_i);
@@ -59153,32 +60070,32 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__pyx_t_8 = 0;
__pyx_t_2 = 0;
__pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1962
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2014
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links))
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False)
* nt.pop() # <<<<<<<<<<<<<<
* span_dec(cover, link_i, link_j)
* span_dec(e_nt_cover, link_i, link_j)
*/
- __pyx_t_1 = __Pyx_PyObject_Pop(__pyx_v_nt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Pop(__pyx_v_nt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1963
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2015
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False)
* nt.pop()
* span_dec(cover, link_i, link_j) # <<<<<<<<<<<<<<
* span_dec(e_nt_cover, link_i, link_j)
*
*/
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_dec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_dec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover);
PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_cur_scope->__pyx_v_cover);
@@ -59189,22 +60106,22 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__Pyx_INCREF(__pyx_v_link_j);
PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_v_link_j);
__Pyx_GIVEREF(__pyx_v_link_j);
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1964
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2016
* nt.pop()
* span_dec(cover, link_i, link_j)
* span_dec(e_nt_cover, link_i, link_j) # <<<<<<<<<<<<<<
*
* # Try to extract phrases from every f index
*/
- __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_dec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_dec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_e_nt_cover);
PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_cur_scope->__pyx_v_e_nt_cover);
@@ -59215,7 +60132,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__Pyx_INCREF(__pyx_v_link_j);
PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_v_link_j);
__Pyx_GIVEREF(__pyx_v_link_j);
- __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
@@ -59249,21 +60166,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1829
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1879
* # Aggregate stats from a training instance
* # (Extract rules, update counts)
* def add_instance(self, f_words, e_words, alignment): # <<<<<<<<<<<<<<
*
- * # Rules extracted from this instance
+ * self.online = True
*/
static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_f_words, PyObject *__pyx_v_e_words, PyObject *__pyx_v_alignment) {
- struct __pyx_obj_3_sa___pyx_scope_struct_20_add_instance *__pyx_cur_scope;
+ struct __pyx_obj_3_sa___pyx_scope_struct_21_add_instance *__pyx_cur_scope;
PyObject *__pyx_v_e_len = NULL;
PyObject *__pyx_v_f = NULL;
PyObject *__pyx_v_e = NULL;
CYTHON_UNUSED PyObject *__pyx_v_f_nt_cover = NULL;
long __pyx_v_f_i;
+ CYTHON_UNUSED PyObject *__pyx_v_lex_i = NULL;
+ CYTHON_UNUSED PyObject *__pyx_v_lex_j = NULL;
PyObject *__pyx_v_rule = NULL;
PyObject *__pyx_v_f_ph = NULL;
PyObject *__pyx_v_e_ph = NULL;
@@ -59292,7 +60211,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("add_instance", 0);
- __pyx_cur_scope = (struct __pyx_obj_3_sa___pyx_scope_struct_20_add_instance *)__pyx_ptype_3_sa___pyx_scope_struct_20_add_instance->tp_new(__pyx_ptype_3_sa___pyx_scope_struct_20_add_instance, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_3_sa___pyx_scope_struct_21_add_instance *)__pyx_ptype_3_sa___pyx_scope_struct_21_add_instance->tp_new(__pyx_ptype_3_sa___pyx_scope_struct_21_add_instance, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__Pyx_RefNannyFinishContext();
return NULL;
@@ -59308,20 +60227,29 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_e_words);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e_words);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1836
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1881
+ * def add_instance(self, f_words, e_words, alignment):
+ *
+ * self.online = True # <<<<<<<<<<<<<<
+ *
+ * # Rules extracted from this instance
+ */
+ __pyx_cur_scope->__pyx_v_self->online = 1;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1888
* # span more than once.
* # (f, e, al, lex_f_i, lex_f_j)
* rules = set() # <<<<<<<<<<<<<<
*
* f_len = len(f_words)
*/
- __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__Pyx_GIVEREF(((PyObject *)__pyx_t_1));
__pyx_cur_scope->__pyx_v_rules = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1838
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1890
* rules = set()
*
* f_len = len(f_words) # <<<<<<<<<<<<<<
@@ -59330,15 +60258,15 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
*/
__pyx_t_1 = __pyx_cur_scope->__pyx_v_f_words;
__Pyx_INCREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_cur_scope->__pyx_v_f_len = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1839
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1891
*
* f_len = len(f_words)
* e_len = len(e_words) # <<<<<<<<<<<<<<
@@ -59347,35 +60275,35 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
*/
__pyx_t_1 = __pyx_cur_scope->__pyx_v_e_words;
__Pyx_INCREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_e_len = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1842
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1894
*
* # Pre-compute alignment info
* al = [[] for i in range(f_len)] # <<<<<<<<<<<<<<
* fe_span = [[e_len + 1, -1] for i in range(f_len)]
* ef_span = [[f_len + 1, -1] for i in range(e_len)]
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_f_len);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_f_len);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f_len);
- __pyx_t_4 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
__pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = 0;
__pyx_t_5 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
}
@@ -59384,23 +60312,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_5(__pyx_t_3);
if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -59409,9 +60337,9 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__Pyx_XDECREF(__pyx_v_i);
__pyx_v_i = __pyx_t_4;
__pyx_t_4 = 0;
- __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -59420,28 +60348,28 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__pyx_cur_scope->__pyx_v_al = ((PyObject *)__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1843
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1895
* # Pre-compute alignment info
* al = [[] for i in range(f_len)]
* fe_span = [[e_len + 1, -1] for i in range(f_len)] # <<<<<<<<<<<<<<
* ef_span = [[f_len + 1, -1] for i in range(e_len)]
* for (f, e) in alignment:
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_f_len);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_f_len);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f_len);
- __pyx_t_4 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
__pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = 0;
__pyx_t_5 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
}
@@ -59450,23 +60378,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_5(__pyx_t_3);
if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -59475,9 +60403,9 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__Pyx_XDECREF(__pyx_v_i);
__pyx_v_i = __pyx_t_4;
__pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Add(__pyx_v_e_len, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Add(__pyx_v_e_len, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
@@ -59485,7 +60413,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
PyList_SET_ITEM(__pyx_t_6, 1, __pyx_int_neg_1);
__Pyx_GIVEREF(__pyx_int_neg_1);
__pyx_t_4 = 0;
- if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -59494,28 +60422,28 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__pyx_cur_scope->__pyx_v_fe_span = ((PyObject *)__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1844
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1896
* al = [[] for i in range(f_len)]
* fe_span = [[e_len + 1, -1] for i in range(f_len)]
* ef_span = [[f_len + 1, -1] for i in range(e_len)] # <<<<<<<<<<<<<<
* for (f, e) in alignment:
* al[f].append(e)
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_e_len);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_e_len);
__Pyx_GIVEREF(__pyx_v_e_len);
- __pyx_t_6 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
if (PyList_CheckExact(__pyx_t_6) || PyTuple_CheckExact(__pyx_t_6)) {
__pyx_t_3 = __pyx_t_6; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = 0;
__pyx_t_5 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
}
@@ -59524,23 +60452,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_6 = __pyx_t_5(__pyx_t_3);
if (unlikely(!__pyx_t_6)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -59549,9 +60477,9 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__Pyx_XDECREF(__pyx_v_i);
__pyx_v_i = __pyx_t_6;
__pyx_t_6 = 0;
- __pyx_t_6 = PyNumber_Add(__pyx_cur_scope->__pyx_v_f_len, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyNumber_Add(__pyx_cur_scope->__pyx_v_f_len, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_6);
@@ -59559,7 +60487,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
PyList_SET_ITEM(__pyx_t_4, 1, __pyx_int_neg_1);
__Pyx_GIVEREF(__pyx_int_neg_1);
__pyx_t_6 = 0;
- if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -59568,7 +60496,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__pyx_cur_scope->__pyx_v_ef_span = ((PyObject *)__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1845
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1897
* 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: # <<<<<<<<<<<<<<
@@ -59579,7 +60507,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__pyx_t_1 = __pyx_v_alignment; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
__pyx_t_5 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_alignment); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_alignment); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -59587,23 +60515,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_3 = __pyx_t_5(__pyx_t_1);
if (unlikely(!__pyx_t_3)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -59619,7 +60547,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -59632,14 +60560,14 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(__pyx_t_6);
#else
- __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
@@ -59647,7 +60575,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__Pyx_GOTREF(__pyx_t_4);
index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L11_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L12_unpacking_done;
@@ -59655,7 +60583,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L12_unpacking_done:;
}
__Pyx_XDECREF(__pyx_v_f);
@@ -59665,21 +60593,21 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__pyx_v_e = __pyx_t_6;
__pyx_t_6 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1846
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1898
* ef_span = [[f_len + 1, -1] for i in range(e_len)]
* for (f, e) in alignment:
* al[f].append(e) # <<<<<<<<<<<<<<
* fe_span[f][0] = min(fe_span[f][0], e)
* fe_span[f][1] = max(fe_span[f][1], e)
*/
- __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_v_e); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_v_e); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1847
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1899
* for (f, e) in alignment:
* al[f].append(e)
* fe_span[f][0] = min(fe_span[f][0], e) # <<<<<<<<<<<<<<
@@ -59688,13 +60616,13 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
*/
__Pyx_INCREF(__pyx_v_e);
__pyx_t_6 = __pyx_v_e;
- __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (__pyx_t_9) {
__Pyx_INCREF(__pyx_t_6);
@@ -59705,13 +60633,13 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- if (__Pyx_SetItemInt(__pyx_t_6, 0, __pyx_t_3, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_t_6, 0, __pyx_t_3, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1848
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1900
* al[f].append(e)
* fe_span[f][0] = min(fe_span[f][0], e)
* fe_span[f][1] = max(fe_span[f][1], e) # <<<<<<<<<<<<<<
@@ -59720,13 +60648,13 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
*/
__Pyx_INCREF(__pyx_v_e);
__pyx_t_3 = __pyx_v_e;
- __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (__pyx_t_9) {
__Pyx_INCREF(__pyx_t_3);
@@ -59737,13 +60665,13 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- if (__Pyx_SetItemInt(__pyx_t_3, 1, __pyx_t_6, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_t_3, 1, __pyx_t_6, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1849
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1901
* 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) # <<<<<<<<<<<<<<
@@ -59752,13 +60680,13 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
*/
__Pyx_INCREF(__pyx_v_f);
__pyx_t_6 = __pyx_v_f;
- __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_e); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_e); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (__pyx_t_9) {
__Pyx_INCREF(__pyx_t_6);
@@ -59769,13 +60697,13 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_e); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_e); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- if (__Pyx_SetItemInt(__pyx_t_6, 0, __pyx_t_3, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_t_6, 0, __pyx_t_3, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1850
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1902
* 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) # <<<<<<<<<<<<<<
@@ -59784,13 +60712,13 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
*/
__Pyx_INCREF(__pyx_v_f);
__pyx_t_3 = __pyx_v_f;
- __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_e); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_e); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (__pyx_t_9) {
__Pyx_INCREF(__pyx_t_3);
@@ -59801,27 +60729,27 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_e); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_e); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- if (__Pyx_SetItemInt(__pyx_t_3, 1, __pyx_t_6, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_t_3, 1, __pyx_t_6, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1853
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1905
*
* # Target side word coverage
* cover = [0] * e_len # <<<<<<<<<<<<<<
* # Non-terminal coverage
* f_nt_cover = [0] * f_len
*/
- __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_int_0);
PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0);
__Pyx_GIVEREF(__pyx_int_0);
- { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_1, __pyx_v_e_len); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_1, __pyx_v_e_len); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_temp);
__Pyx_DECREF(__pyx_t_1);
__pyx_t_1 = __pyx_temp;
@@ -59830,19 +60758,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__pyx_cur_scope->__pyx_v_cover = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1855
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1907
* cover = [0] * e_len
* # Non-terminal coverage
* f_nt_cover = [0] * f_len # <<<<<<<<<<<<<<
* e_nt_cover = [0] * e_len
*
*/
- __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_int_0);
PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0);
__Pyx_GIVEREF(__pyx_int_0);
- { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_1, __pyx_cur_scope->__pyx_v_f_len); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_1, __pyx_cur_scope->__pyx_v_f_len); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_temp);
__Pyx_DECREF(__pyx_t_1);
__pyx_t_1 = __pyx_temp;
@@ -59850,19 +60778,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__pyx_v_f_nt_cover = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1856
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1908
* # Non-terminal coverage
* f_nt_cover = [0] * f_len
* e_nt_cover = [0] * e_len # <<<<<<<<<<<<<<
*
* # Extract all possible hierarchical phrases starting at a source index
*/
- __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_int_0);
PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0);
__Pyx_GIVEREF(__pyx_int_0);
- { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_1, __pyx_v_e_len); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_1, __pyx_v_e_len); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_temp);
__Pyx_DECREF(__pyx_t_1);
__pyx_t_1 = __pyx_temp;
@@ -59871,44 +60799,44 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__pyx_cur_scope->__pyx_v_e_nt_cover = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1861
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1913
* # f_ i and j are current, e_ i and j are previous
* # We care _considering_ f_j, so it is not yet in counts
* def extract(f_i, f_j, e_i, e_j, min_bound, wc, links, nt, nt_open): # <<<<<<<<<<<<<<
* # Phrase extraction limits
* if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size:
*/
- __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_12add_instance_1extract, 0, ((PyObject*)__pyx_cur_scope), __pyx_n_s___sa, ((PyObject *)__pyx_k_codeobj_135)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_12add_instance_1extract, 0, ((PyObject*)__pyx_cur_scope), __pyx_n_s___sa, ((PyObject *)__pyx_k_codeobj_135)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_cur_scope->__pyx_v_extract = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1967
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2019
*
* # Try to extract phrases from every f index
* for f_i from 0 <= f_i < f_len: # <<<<<<<<<<<<<<
* # Skip if phrases won't be tight on left side
* if not al[f_i]:
*/
- __pyx_t_10 = __Pyx_PyInt_AsLong(__pyx_cur_scope->__pyx_v_f_len); if (unlikely((__pyx_t_10 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyInt_AsLong(__pyx_cur_scope->__pyx_v_f_len); if (unlikely((__pyx_t_10 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
for (__pyx_v_f_i = 0; __pyx_v_f_i < __pyx_t_10; __pyx_v_f_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1969
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2021
* for f_i from 0 <= f_i < f_len:
* # Skip if phrases won't be tight on left side
* if not al[f_i]: # <<<<<<<<<<<<<<
* continue
* extract(f_i, f_i, f_len + 1, -1, f_i, 0, [], [], False)
*/
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_11 = (!__pyx_t_9);
if (__pyx_t_11) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1970
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2022
* # Skip if phrases won't be tight on left side
* if not al[f_i]:
* continue # <<<<<<<<<<<<<<
@@ -59920,28 +60848,28 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
}
__pyx_L15:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1971
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2023
* if not al[f_i]:
* continue
* extract(f_i, f_i, f_len + 1, -1, f_i, 0, [], [], False) # <<<<<<<<<<<<<<
*
- * # Update phrase counts
+ * # Update possible phrases (samples)
*/
- __pyx_t_1 = PyInt_FromLong(__pyx_v_f_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_v_f_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = PyInt_FromLong(__pyx_v_f_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyInt_FromLong(__pyx_v_f_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = PyNumber_Add(__pyx_cur_scope->__pyx_v_f_len, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Add(__pyx_cur_scope->__pyx_v_f_len, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyInt_FromLong(__pyx_v_f_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_v_f_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
- __pyx_t_13 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_13);
- __pyx_t_14 = PyTuple_New(9); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyTuple_New(9); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
@@ -59970,14 +60898,155 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__pyx_t_7 = 0;
__pyx_t_12 = 0;
__pyx_t_13 = 0;
- __pyx_t_13 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_13);
__Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
__pyx_L13_continue:;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1974
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2028
+ * # This could be more efficiently integrated with extraction
+ * # at the cost of readability
+ * for (f, lex_i, lex_j) in self.get_f_phrases(f_words): # <<<<<<<<<<<<<<
+ * self.samples_f[f] += 1
+ *
+ */
+ __pyx_t_13 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__get_f_phrases); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f_words);
+ PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_cur_scope->__pyx_v_f_words);
+ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f_words);
+ __pyx_t_12 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
+ if (PyList_CheckExact(__pyx_t_12) || PyTuple_CheckExact(__pyx_t_12)) {
+ __pyx_t_14 = __pyx_t_12; __Pyx_INCREF(__pyx_t_14); __pyx_t_2 = 0;
+ __pyx_t_5 = NULL;
+ } else {
+ __pyx_t_2 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_5 = Py_TYPE(__pyx_t_14)->tp_iternext;
+ }
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ for (;;) {
+ if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_14)) {
+ if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_14)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_12 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_12 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_14)) {
+ if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_14)) break;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #else
+ __pyx_t_12 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ } else {
+ __pyx_t_12 = __pyx_t_5(__pyx_t_14);
+ if (unlikely(!__pyx_t_12)) {
+ if (PyErr_Occurred()) {
+ if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ break;
+ }
+ __Pyx_GOTREF(__pyx_t_12);
+ }
+ if ((likely(PyTuple_CheckExact(__pyx_t_12))) || (PyList_CheckExact(__pyx_t_12))) {
+ PyObject* sequence = __pyx_t_12;
+ #if CYTHON_COMPILING_IN_CPYTHON
+ Py_ssize_t size = Py_SIZE(sequence);
+ #else
+ Py_ssize_t size = PySequence_Size(sequence);
+ #endif
+ if (unlikely(size != 3)) {
+ if (size > 3) __Pyx_RaiseTooManyValuesError(3);
+ else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ }
+ #if CYTHON_COMPILING_IN_CPYTHON
+ if (likely(PyTuple_CheckExact(sequence))) {
+ __pyx_t_13 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
+ __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
+ } else {
+ __pyx_t_13 = PyList_GET_ITEM(sequence, 0);
+ __pyx_t_7 = PyList_GET_ITEM(sequence, 1);
+ __pyx_t_4 = PyList_GET_ITEM(sequence, 2);
+ }
+ __Pyx_INCREF(__pyx_t_13);
+ __Pyx_INCREF(__pyx_t_7);
+ __Pyx_INCREF(__pyx_t_4);
+ #else
+ __pyx_t_13 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #endif
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ } else
+ {
+ Py_ssize_t index = -1;
+ __pyx_t_3 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
+ index = 0; __pyx_t_13 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_13)) goto __pyx_L18_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_13);
+ index = 1; __pyx_t_7 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_7)) goto __pyx_L18_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_7);
+ index = 2; __pyx_t_4 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L18_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_3), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = NULL;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ goto __pyx_L19_unpacking_done;
+ __pyx_L18_unpacking_failed:;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_8 = NULL;
+ if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_L19_unpacking_done:;
+ }
+ __Pyx_XDECREF(__pyx_v_f);
+ __pyx_v_f = __pyx_t_13;
+ __pyx_t_13 = 0;
+ __Pyx_XDECREF(__pyx_v_lex_i);
+ __pyx_v_lex_i = __pyx_t_7;
+ __pyx_t_7 = 0;
+ __Pyx_XDECREF(__pyx_v_lex_j);
+ __pyx_v_lex_j = __pyx_t_4;
+ __pyx_t_4 = 0;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2029
+ * # at the cost of readability
+ * for (f, lex_i, lex_j) in self.get_f_phrases(f_words):
+ * self.samples_f[f] += 1 # <<<<<<<<<<<<<<
+ *
+ * # Update phrase counts
+ */
+ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self->samples_f);
+ __pyx_t_12 = __pyx_cur_scope->__pyx_v_self->samples_f;
+ __Pyx_INCREF(__pyx_v_f);
+ __pyx_t_4 = __pyx_v_f;
+ __pyx_t_7 = PyObject_GetItem(__pyx_t_12, __pyx_t_4); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_13);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ if (PyObject_SetItem(__pyx_t_12, __pyx_t_4, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2032
*
* # Update phrase counts
* for rule in rules: # <<<<<<<<<<<<<<
@@ -59985,54 +61054,54 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
* self.phrases_f[f_ph] += 1
*/
if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_rules) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_rules)) {
- __pyx_t_13 = __pyx_cur_scope->__pyx_v_rules; __Pyx_INCREF(__pyx_t_13); __pyx_t_2 = 0;
+ __pyx_t_14 = __pyx_cur_scope->__pyx_v_rules; __Pyx_INCREF(__pyx_t_14); __pyx_t_2 = 0;
__pyx_t_5 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_rules); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_5 = Py_TYPE(__pyx_t_13)->tp_iternext;
+ __pyx_t_2 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_rules); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_5 = Py_TYPE(__pyx_t_14)->tp_iternext;
}
for (;;) {
- if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_13)) {
- if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_13)) break;
+ if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_14)) {
+ if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_14)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_14 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_2); __Pyx_INCREF(__pyx_t_14); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_14 = PySequence_ITEM(__pyx_t_13, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
- } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_13)) {
- if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_13)) break;
+ } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_14)) {
+ if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_14)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_2); __Pyx_INCREF(__pyx_t_14); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_14 = PySequence_ITEM(__pyx_t_13, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
- __pyx_t_14 = __pyx_t_5(__pyx_t_13);
- if (unlikely(!__pyx_t_14)) {
+ __pyx_t_12 = __pyx_t_5(__pyx_t_14);
+ if (unlikely(!__pyx_t_12)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
- __Pyx_GOTREF(__pyx_t_14);
+ __Pyx_GOTREF(__pyx_t_12);
}
__Pyx_XDECREF(__pyx_v_rule);
- __pyx_v_rule = __pyx_t_14;
- __pyx_t_14 = 0;
+ __pyx_v_rule = __pyx_t_12;
+ __pyx_t_12 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1975
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2033
* # Update phrase counts
* for rule in rules:
* (f_ph, e_ph, al) = rule[:3] # <<<<<<<<<<<<<<
* self.phrases_f[f_ph] += 1
* self.phrases_e[e_ph] += 1
*/
- __pyx_t_14 = __Pyx_PySequence_GetSlice(__pyx_v_rule, 0, 3); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
- if ((likely(PyTuple_CheckExact(__pyx_t_14))) || (PyList_CheckExact(__pyx_t_14))) {
- PyObject* sequence = __pyx_t_14;
+ __pyx_t_12 = __Pyx_PySequence_GetSlice(__pyx_v_rule, 0, 3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ if ((likely(PyTuple_CheckExact(__pyx_t_12))) || (PyList_CheckExact(__pyx_t_12))) {
+ PyObject* sequence = __pyx_t_12;
#if CYTHON_COMPILING_IN_CPYTHON
Py_ssize_t size = Py_SIZE(sequence);
#else
@@ -60041,64 +61110,64 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
- __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
+ __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1);
+ __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2);
} else {
- __pyx_t_12 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_7 = PyList_GET_ITEM(sequence, 1);
- __pyx_t_4 = PyList_GET_ITEM(sequence, 2);
+ __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
+ __pyx_t_13 = PyList_GET_ITEM(sequence, 1);
+ __pyx_t_7 = PyList_GET_ITEM(sequence, 2);
}
- __Pyx_INCREF(__pyx_t_12);
- __Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_13);
+ __Pyx_INCREF(__pyx_t_7);
#else
- __pyx_t_12 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_3 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
- index = 0; __pyx_t_12 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_12)) goto __pyx_L18_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_12);
- index = 1; __pyx_t_7 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_7)) goto __pyx_L18_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_7);
- index = 2; __pyx_t_4 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L18_unpacking_failed;
+ index = 0; __pyx_t_4 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L22_unpacking_failed;
__Pyx_GOTREF(__pyx_t_4);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_3), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ index = 1; __pyx_t_13 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_13)) goto __pyx_L22_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_13);
+ index = 2; __pyx_t_7 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_7)) goto __pyx_L22_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_7);
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_3), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- goto __pyx_L19_unpacking_done;
- __pyx_L18_unpacking_failed:;
+ goto __pyx_L23_unpacking_done;
+ __pyx_L22_unpacking_failed:;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_L19_unpacking_done:;
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_L23_unpacking_done:;
}
__Pyx_XDECREF(__pyx_v_f_ph);
- __pyx_v_f_ph = __pyx_t_12;
- __pyx_t_12 = 0;
+ __pyx_v_f_ph = __pyx_t_4;
+ __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_v_e_ph);
- __pyx_v_e_ph = __pyx_t_7;
- __pyx_t_7 = 0;
+ __pyx_v_e_ph = __pyx_t_13;
+ __pyx_t_13 = 0;
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_al);
__Pyx_DECREF(__pyx_cur_scope->__pyx_v_al);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_cur_scope->__pyx_v_al = __pyx_t_4;
- __pyx_t_4 = 0;
+ __Pyx_GIVEREF(__pyx_t_7);
+ __pyx_cur_scope->__pyx_v_al = __pyx_t_7;
+ __pyx_t_7 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1976
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2034
* for rule in rules:
* (f_ph, e_ph, al) = rule[:3]
* self.phrases_f[f_ph] += 1 # <<<<<<<<<<<<<<
@@ -60106,20 +61175,20 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
* self.phrases_fe[f_ph][e_ph] += 1
*/
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_self->phrases_f);
- __pyx_t_14 = __pyx_cur_scope->__pyx_v_self->phrases_f;
+ __pyx_t_12 = __pyx_cur_scope->__pyx_v_self->phrases_f;
__Pyx_INCREF(__pyx_v_f_ph);
- __pyx_t_4 = __pyx_v_f_ph;
- __pyx_t_7 = PyObject_GetItem(__pyx_t_14, __pyx_t_4); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_12 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_12);
+ __pyx_t_7 = __pyx_v_f_ph;
+ __pyx_t_13 = PyObject_GetItem(__pyx_t_12, __pyx_t_7); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_13, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ if (PyObject_SetItem(__pyx_t_12, __pyx_t_7, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyObject_SetItem(__pyx_t_14, __pyx_t_4, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1977
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2035
* (f_ph, e_ph, al) = rule[:3]
* self.phrases_f[f_ph] += 1
* self.phrases_e[e_ph] += 1 # <<<<<<<<<<<<<<
@@ -60127,75 +61196,75 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
* if not self.phrases_al[f_ph][e_ph]:
*/
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_self->phrases_e);
- __pyx_t_14 = __pyx_cur_scope->__pyx_v_self->phrases_e;
+ __pyx_t_12 = __pyx_cur_scope->__pyx_v_self->phrases_e;
__Pyx_INCREF(__pyx_v_e_ph);
- __pyx_t_4 = __pyx_v_e_ph;
- __pyx_t_12 = PyObject_GetItem(__pyx_t_14, __pyx_t_4); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_t_12, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- if (PyObject_SetItem(__pyx_t_14, __pyx_t_4, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_7 = __pyx_v_e_ph;
+ __pyx_t_4 = PyObject_GetItem(__pyx_t_12, __pyx_t_7); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_13);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ if (PyObject_SetItem(__pyx_t_12, __pyx_t_7, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1978
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2036
* self.phrases_f[f_ph] += 1
* self.phrases_e[e_ph] += 1
* self.phrases_fe[f_ph][e_ph] += 1 # <<<<<<<<<<<<<<
* if not self.phrases_al[f_ph][e_ph]:
* self.phrases_al[f_ph][e_ph] = al
*/
- __pyx_t_14 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->phrases_fe, __pyx_v_f_ph); if (!__pyx_t_14) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
- __Pyx_INCREF(__pyx_v_e_ph);
- __pyx_t_4 = __pyx_v_e_ph;
- __pyx_t_7 = PyObject_GetItem(__pyx_t_14, __pyx_t_4); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_12 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->phrases_fe, __pyx_v_f_ph); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
+ __Pyx_INCREF(__pyx_v_e_ph);
+ __pyx_t_7 = __pyx_v_e_ph;
+ __pyx_t_13 = PyObject_GetItem(__pyx_t_12, __pyx_t_7); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_13, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ if (PyObject_SetItem(__pyx_t_12, __pyx_t_7, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyObject_SetItem(__pyx_t_14, __pyx_t_4, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1979
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2037
* self.phrases_e[e_ph] += 1
* self.phrases_fe[f_ph][e_ph] += 1
* if not self.phrases_al[f_ph][e_ph]: # <<<<<<<<<<<<<<
* self.phrases_al[f_ph][e_ph] = al
*
*/
- __pyx_t_14 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->phrases_al, __pyx_v_f_ph); if (!__pyx_t_14) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
- __pyx_t_4 = PyObject_GetItem(__pyx_t_14, __pyx_v_e_ph); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_12 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->phrases_al, __pyx_v_f_ph); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ __pyx_t_7 = PyObject_GetItem(__pyx_t_12, __pyx_v_e_ph); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_9 = (!__pyx_t_11);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1980
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2038
* self.phrases_fe[f_ph][e_ph] += 1
* if not self.phrases_al[f_ph][e_ph]:
* self.phrases_al[f_ph][e_ph] = al # <<<<<<<<<<<<<<
*
* # Update Bilexical counts
*/
- __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->phrases_al, __pyx_v_f_ph); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- if (PyObject_SetItem(__pyx_t_4, __pyx_v_e_ph, __pyx_cur_scope->__pyx_v_al) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- goto __pyx_L20;
+ __pyx_t_7 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->phrases_al, __pyx_v_f_ph); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ if (PyObject_SetItem(__pyx_t_7, __pyx_v_e_ph, __pyx_cur_scope->__pyx_v_al) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ goto __pyx_L24;
}
- __pyx_L20:;
+ __pyx_L24:;
}
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1983
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2041
*
* # Update Bilexical counts
* for e_w in e_words: # <<<<<<<<<<<<<<
@@ -60203,44 +61272,44 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
* for f_w in f_words:
*/
if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_e_words) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_e_words)) {
- __pyx_t_13 = __pyx_cur_scope->__pyx_v_e_words; __Pyx_INCREF(__pyx_t_13); __pyx_t_2 = 0;
+ __pyx_t_14 = __pyx_cur_scope->__pyx_v_e_words; __Pyx_INCREF(__pyx_t_14); __pyx_t_2 = 0;
__pyx_t_5 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_e_words); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_5 = Py_TYPE(__pyx_t_13)->tp_iternext;
+ __pyx_t_2 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_e_words); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_5 = Py_TYPE(__pyx_t_14)->tp_iternext;
}
for (;;) {
- if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_13)) {
- if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_13)) break;
+ if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_14)) {
+ if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_14)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_13, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
- } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_13)) {
- if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_13)) break;
+ } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_14)) {
+ if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_14)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_13, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
- __pyx_t_4 = __pyx_t_5(__pyx_t_13);
- if (unlikely(!__pyx_t_4)) {
+ __pyx_t_7 = __pyx_t_5(__pyx_t_14);
+ if (unlikely(!__pyx_t_7)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
- __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GOTREF(__pyx_t_7);
}
__Pyx_XDECREF(__pyx_v_e_w);
- __pyx_v_e_w = __pyx_t_4;
- __pyx_t_4 = 0;
+ __pyx_v_e_w = __pyx_t_7;
+ __pyx_t_7 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1984
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2042
* # Update Bilexical counts
* for e_w in e_words:
* self.bilex_e[e_w] += 1 # <<<<<<<<<<<<<<
@@ -60248,22 +61317,22 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
* self.bilex_f[f_w] += 1
*/
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_self->bilex_e);
- __pyx_t_4 = __pyx_cur_scope->__pyx_v_self->bilex_e;
+ __pyx_t_7 = __pyx_cur_scope->__pyx_v_self->bilex_e;
__Pyx_INCREF(__pyx_v_e_w);
- __pyx_t_14 = __pyx_v_e_w;
- __pyx_t_12 = PyObject_GetItem(__pyx_t_4, __pyx_t_14); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_t_12, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_12 = __pyx_v_e_w;
+ __pyx_t_4 = PyObject_GetItem(__pyx_t_7, __pyx_t_12); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_13);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (PyObject_SetItem(__pyx_t_7, __pyx_t_12, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- if (PyObject_SetItem(__pyx_t_4, __pyx_t_14, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1985
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2043
* for e_w in e_words:
* self.bilex_e[e_w] += 1
* for f_w in f_words: # <<<<<<<<<<<<<<
@@ -60271,44 +61340,44 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
* for e_w in e_words:
*/
if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_f_words) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_f_words)) {
- __pyx_t_13 = __pyx_cur_scope->__pyx_v_f_words; __Pyx_INCREF(__pyx_t_13); __pyx_t_2 = 0;
+ __pyx_t_14 = __pyx_cur_scope->__pyx_v_f_words; __Pyx_INCREF(__pyx_t_14); __pyx_t_2 = 0;
__pyx_t_5 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_f_words); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_5 = Py_TYPE(__pyx_t_13)->tp_iternext;
+ __pyx_t_2 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_f_words); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_5 = Py_TYPE(__pyx_t_14)->tp_iternext;
}
for (;;) {
- if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_13)) {
- if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_13)) break;
+ if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_14)) {
+ if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_14)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_13, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
- } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_13)) {
- if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_13)) break;
+ } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_14)) {
+ if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_14)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_13, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
- __pyx_t_4 = __pyx_t_5(__pyx_t_13);
- if (unlikely(!__pyx_t_4)) {
+ __pyx_t_7 = __pyx_t_5(__pyx_t_14);
+ if (unlikely(!__pyx_t_7)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
- __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GOTREF(__pyx_t_7);
}
__Pyx_XDECREF(__pyx_v_f_w);
- __pyx_v_f_w = __pyx_t_4;
- __pyx_t_4 = 0;
+ __pyx_v_f_w = __pyx_t_7;
+ __pyx_t_7 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1986
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2044
* self.bilex_e[e_w] += 1
* for f_w in f_words:
* self.bilex_f[f_w] += 1 # <<<<<<<<<<<<<<
@@ -60316,20 +61385,20 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
* self.bilex_fe[f_w][e_w] += 1
*/
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_self->bilex_f);
- __pyx_t_4 = __pyx_cur_scope->__pyx_v_self->bilex_f;
+ __pyx_t_7 = __pyx_cur_scope->__pyx_v_self->bilex_f;
__Pyx_INCREF(__pyx_v_f_w);
- __pyx_t_14 = __pyx_v_f_w;
- __pyx_t_7 = PyObject_GetItem(__pyx_t_4, __pyx_t_14); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_12 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyObject_SetItem(__pyx_t_4, __pyx_t_14, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __pyx_t_12 = __pyx_v_f_w;
+ __pyx_t_13 = PyObject_GetItem(__pyx_t_7, __pyx_t_12); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_13, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ if (PyObject_SetItem(__pyx_t_7, __pyx_t_12, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1987
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2045
* for f_w in f_words:
* self.bilex_f[f_w] += 1
* for e_w in e_words: # <<<<<<<<<<<<<<
@@ -60337,67 +61406,67 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
*
*/
if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_e_words) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_e_words)) {
- __pyx_t_4 = __pyx_cur_scope->__pyx_v_e_words; __Pyx_INCREF(__pyx_t_4); __pyx_t_15 = 0;
+ __pyx_t_7 = __pyx_cur_scope->__pyx_v_e_words; __Pyx_INCREF(__pyx_t_7); __pyx_t_15 = 0;
__pyx_t_16 = NULL;
} else {
- __pyx_t_15 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_e_words); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_16 = Py_TYPE(__pyx_t_4)->tp_iternext;
+ __pyx_t_15 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_e_words); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_16 = Py_TYPE(__pyx_t_7)->tp_iternext;
}
for (;;) {
- if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_4)) {
- if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_4)) break;
+ if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_7)) {
+ if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_7)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_14 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_15); __Pyx_INCREF(__pyx_t_14); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_15); __Pyx_INCREF(__pyx_t_12); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_14 = PySequence_ITEM(__pyx_t_4, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PySequence_ITEM(__pyx_t_7, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
- } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_4)) {
- if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
+ } else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_7)) {
+ if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_15); __Pyx_INCREF(__pyx_t_14); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_15); __Pyx_INCREF(__pyx_t_12); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_14 = PySequence_ITEM(__pyx_t_4, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PySequence_ITEM(__pyx_t_7, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
- __pyx_t_14 = __pyx_t_16(__pyx_t_4);
- if (unlikely(!__pyx_t_14)) {
+ __pyx_t_12 = __pyx_t_16(__pyx_t_7);
+ if (unlikely(!__pyx_t_12)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
- __Pyx_GOTREF(__pyx_t_14);
+ __Pyx_GOTREF(__pyx_t_12);
}
__Pyx_XDECREF(__pyx_v_e_w);
- __pyx_v_e_w = __pyx_t_14;
- __pyx_t_14 = 0;
+ __pyx_v_e_w = __pyx_t_12;
+ __pyx_t_12 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1988
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2046
* self.bilex_f[f_w] += 1
* for e_w in e_words:
* self.bilex_fe[f_w][e_w] += 1 # <<<<<<<<<<<<<<
*
- *
+ * # Create a rule from source, target, non-terminals, and alignments
*/
- __pyx_t_14 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->bilex_fe, __pyx_v_f_w); if (!__pyx_t_14) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_12 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->bilex_fe, __pyx_v_f_w); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
__Pyx_INCREF(__pyx_v_e_w);
- __pyx_t_12 = __pyx_v_e_w;
- __pyx_t_7 = PyObject_GetItem(__pyx_t_14, __pyx_t_12); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __pyx_v_e_w;
+ __pyx_t_13 = PyObject_GetItem(__pyx_t_12, __pyx_t_4); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_13, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyObject_SetItem(__pyx_t_14, __pyx_t_12, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ if (PyObject_SetItem(__pyx_t_12, __pyx_t_4, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
@@ -60417,6 +61486,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__Pyx_XDECREF(__pyx_v_f);
__Pyx_XDECREF(__pyx_v_e);
__Pyx_XDECREF(__pyx_v_f_nt_cover);
+ __Pyx_XDECREF(__pyx_v_lex_i);
+ __Pyx_XDECREF(__pyx_v_lex_j);
__Pyx_XDECREF(__pyx_v_rule);
__Pyx_XDECREF(__pyx_v_f_ph);
__Pyx_XDECREF(__pyx_v_e_ph);
@@ -60465,31 +61536,31 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_28form_rule(PyObject *_
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e_i)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f_span)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e_span)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nt)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__al)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "form_rule") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "form_rule") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
goto __pyx_L5_argtuple_error;
@@ -60510,7 +61581,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_28form_rule(PyObject *_
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.HieroCachingRuleFactory.form_rule", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -60550,11 +61621,11 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9form_rule_lambda7(PyOb
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 = 1995; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("lambda7", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __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 = 1995; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda7") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
@@ -60567,7 +61638,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9form_rule_lambda7(PyOb
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("lambda7", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("lambda7", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.HieroCachingRuleFactory.form_rule.lambda7", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -60578,7 +61649,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9form_rule_lambda7(PyOb
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1995
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2052
*
* # Substitute in non-terminals
* nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3])) # <<<<<<<<<<<<<<
@@ -60597,11 +61668,11 @@ static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("lambda7", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_y, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_y, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __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);
@@ -60609,7 +61680,7 @@ static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_builtin_cmp, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_builtin_cmp, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__pyx_r = __pyx_t_2;
@@ -60659,11 +61730,11 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda8(PyO
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__y)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("lambda8", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2019; __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, "lambda8") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2019; __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;
@@ -60676,7 +61747,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda8(PyO
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("lambda8", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2019; __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("_sa.HieroCachingRuleFactory.form_rule.lambda8", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -60687,7 +61758,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda8(PyO
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2019
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2076
* # 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])) # <<<<<<<<<<<<<<
@@ -60706,11 +61777,11 @@ static PyObject *__pyx_lambda_funcdef_lambda8(CYTHON_UNUSED PyObject *__pyx_self
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("lambda8", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_y, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_y, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __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);
@@ -60718,7 +61789,7 @@ static PyObject *__pyx_lambda_funcdef_lambda8(CYTHON_UNUSED PyObject *__pyx_self
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_builtin_cmp, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_builtin_cmp, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__pyx_r = __pyx_t_2;
@@ -60738,9 +61809,9 @@ static PyObject *__pyx_lambda_funcdef_lambda8(CYTHON_UNUSED PyObject *__pyx_self
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator14(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2053
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2110
* f = Phrase(f_sym)
* e = Phrase(e_sym)
* a = tuple(self.alignment.link(i, j) for (i, j) in links) # <<<<<<<<<<<<<<
@@ -60749,24 +61820,24 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator14
*/
static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_9form_rule_2genexpr(PyObject *__pyx_self) {
- struct __pyx_obj_3_sa___pyx_scope_struct_22_genexpr *__pyx_cur_scope;
+ struct __pyx_obj_3_sa___pyx_scope_struct_23_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_3_sa___pyx_scope_struct_22_genexpr *)__pyx_ptype_3_sa___pyx_scope_struct_22_genexpr->tp_new(__pyx_ptype_3_sa___pyx_scope_struct_22_genexpr, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_3_sa___pyx_scope_struct_23_genexpr *)__pyx_ptype_3_sa___pyx_scope_struct_23_genexpr->tp_new(__pyx_ptype_3_sa___pyx_scope_struct_23_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_3_sa___pyx_scope_struct_21_form_rule *) __pyx_self;
+ __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_3_sa___pyx_scope_struct_22_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_3_sa_23HieroCachingRuleFactory_9form_rule_4generator14, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -60784,9 +61855,9 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_9form_rule_2genexpr(PyO
return __pyx_r;
}
-static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator14(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
- struct __pyx_obj_3_sa___pyx_scope_struct_22_genexpr *__pyx_cur_scope = ((struct __pyx_obj_3_sa___pyx_scope_struct_22_genexpr *)__pyx_generator->closure);
+ struct __pyx_obj_3_sa___pyx_scope_struct_23_genexpr *__pyx_cur_scope = ((struct __pyx_obj_3_sa___pyx_scope_struct_23_genexpr *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
@@ -60808,13 +61879,13 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator14
return NULL;
}
__pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_links)) { __Pyx_RaiseClosureNameError("links"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_links)) { __Pyx_RaiseClosureNameError("links"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
if (PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_links) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_links)) {
__pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_links; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
__pyx_t_3 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_links); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_links); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -60822,23 +61893,23 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator14
if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_3(__pyx_t_1);
if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -60854,7 +61925,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator14
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -60867,14 +61938,14 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator14
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
- __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
@@ -60882,7 +61953,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator14
__Pyx_GOTREF(__pyx_t_5);
index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L7_unpacking_done;
@@ -60890,7 +61961,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator14
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L7_unpacking_done:;
}
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i);
@@ -60903,10 +61974,10 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator14
__Pyx_GIVEREF(__pyx_t_6);
__pyx_cur_scope->__pyx_v_j = __pyx_t_6;
__pyx_t_6 = 0;
- if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_i); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_j); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = PyInt_FromLong(((struct __pyx_vtabstruct_3_sa_Alignment *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->alignment->__pyx_vtab)->link(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->alignment, __pyx_t_9, __pyx_t_10)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_i); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_j); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(((struct __pyx_vtabstruct_3_sa_Alignment *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->alignment->__pyx_vtab)->link(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->alignment, __pyx_t_9, __pyx_t_10)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
@@ -60925,7 +61996,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator14
__Pyx_XGOTREF(__pyx_t_1);
__pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
__pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyErr_SetNone(PyExc_StopIteration);
@@ -60945,7 +62016,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator14
return NULL;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1992
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2049
*
* # Create a rule from source, target, non-terminals, and alignments
* def form_rule(self, f_i, e_i, f_span, e_span, nt, al): # <<<<<<<<<<<<<<
@@ -60954,7 +62025,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator14
*/
static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __pyx_obj_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_3_sa___pyx_scope_struct_21_form_rule *__pyx_cur_scope;
+ struct __pyx_obj_3_sa___pyx_scope_struct_22_form_rule *__pyx_cur_scope;
PyObject *__pyx_v_nt_inv = NULL;
PyObject *__pyx_v_f_sym = NULL;
PyObject *__pyx_v_off = NULL;
@@ -60992,7 +62063,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("form_rule", 0);
- __pyx_cur_scope = (struct __pyx_obj_3_sa___pyx_scope_struct_21_form_rule *)__pyx_ptype_3_sa___pyx_scope_struct_21_form_rule->tp_new(__pyx_ptype_3_sa___pyx_scope_struct_21_form_rule, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_3_sa___pyx_scope_struct_22_form_rule *)__pyx_ptype_3_sa___pyx_scope_struct_22_form_rule->tp_new(__pyx_ptype_3_sa___pyx_scope_struct_22_form_rule, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__Pyx_RefNannyFinishContext();
return NULL;
@@ -61002,52 +62073,52 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
__Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1995
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2052
*
* # Substitute in non-terminals
* nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3])) # <<<<<<<<<<<<<<
* f_sym = list(f_span[:])
* off = f_i
*/
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_nt);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_nt);
__Pyx_GIVEREF(__pyx_v_nt);
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
- __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_9form_rule_lambda7, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_9form_rule_lambda7, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__cmp), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__cmp), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__pyx_v_nt_inv = __pyx_t_3;
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1996
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2053
* # Substitute in non-terminals
* nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3]))
* f_sym = list(f_span[:]) # <<<<<<<<<<<<<<
* off = f_i
* for next_nt in nt:
*/
- __pyx_t_3 = __Pyx_PySequence_GetSlice(__pyx_v_f_span, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PySequence_GetSlice(__pyx_v_f_span, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__pyx_v_f_sym = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1997
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2054
* nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3]))
* f_sym = list(f_span[:])
* off = f_i # <<<<<<<<<<<<<<
@@ -61057,7 +62128,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__Pyx_INCREF(__pyx_v_f_i);
__pyx_v_off = __pyx_v_f_i;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1998
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2055
* f_sym = list(f_span[:])
* off = f_i
* for next_nt in nt: # <<<<<<<<<<<<<<
@@ -61068,7 +62139,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__pyx_t_3 = __pyx_v_nt; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
__pyx_t_5 = NULL;
} else {
- __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_nt); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_nt); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
}
@@ -61076,23 +62147,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_2 = __pyx_t_5(__pyx_t_3);
if (unlikely(!__pyx_t_2)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -61102,29 +62173,29 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__pyx_v_next_nt = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1999
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2056
* off = f_i
* for next_nt in nt:
* nt_len = (next_nt[2] - next_nt[1]) + 1 # <<<<<<<<<<<<<<
* i = 0
* while i < nt_len:
*/
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF(__pyx_v_nt_len);
__pyx_v_nt_len = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2000
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2057
* for next_nt in nt:
* nt_len = (next_nt[2] - next_nt[1]) + 1
* i = 0 # <<<<<<<<<<<<<<
@@ -61135,7 +62206,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__Pyx_XDECREF(__pyx_v_i);
__pyx_v_i = __pyx_int_0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2001
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2058
* nt_len = (next_nt[2] - next_nt[1]) + 1
* i = 0
* while i < nt_len: # <<<<<<<<<<<<<<
@@ -61143,83 +62214,83 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
* i += 1
*/
while (1) {
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!__pyx_t_7) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2002
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2059
* i = 0
* while i < nt_len:
* f_sym.pop(next_nt[1] - off) # <<<<<<<<<<<<<<
* i += 1
* f_sym.insert(next_nt[1] - off, sym_setindex(self.category, next_nt[0]))
*/
- __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_f_sym), __pyx_n_s__pop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_f_sym), __pyx_n_s__pop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_2 = PyNumber_Subtract(__pyx_t_6, __pyx_v_off); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Subtract(__pyx_t_6, __pyx_v_off); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2003
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2060
* while i < nt_len:
* f_sym.pop(next_nt[1] - off)
* i += 1 # <<<<<<<<<<<<<<
* f_sym.insert(next_nt[1] - off, sym_setindex(self.category, next_nt[0]))
* off += (nt_len - 1)
*/
- __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_v_i);
__pyx_v_i = __pyx_t_2;
__pyx_t_2 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2004
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2061
* f_sym.pop(next_nt[1] - off)
* i += 1
* f_sym.insert(next_nt[1] - off, sym_setindex(self.category, next_nt[0])) # <<<<<<<<<<<<<<
* off += (nt_len - 1)
* e_sym = list(e_span[:])
*/
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = PyNumber_Subtract(__pyx_t_2, __pyx_v_off); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyNumber_Subtract(__pyx_t_2, __pyx_v_off); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_6); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_6); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_9)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_9)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_10 = PyList_Insert(__pyx_v_f_sym, __pyx_t_8, __pyx_t_6); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyList_Insert(__pyx_v_f_sym, __pyx_t_8, __pyx_t_6); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2005
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2062
* i += 1
* f_sym.insert(next_nt[1] - off, sym_setindex(self.category, next_nt[0]))
* off += (nt_len - 1) # <<<<<<<<<<<<<<
* e_sym = list(e_span[:])
* off = e_i
*/
- __pyx_t_6 = PyNumber_Subtract(__pyx_v_nt_len, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyNumber_Subtract(__pyx_v_nt_len, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_v_off);
@@ -61228,27 +62299,27 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2006
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2063
* f_sym.insert(next_nt[1] - off, sym_setindex(self.category, next_nt[0]))
* off += (nt_len - 1)
* e_sym = list(e_span[:]) # <<<<<<<<<<<<<<
* off = e_i
* for next_nt in nt_inv:
*/
- __pyx_t_3 = __Pyx_PySequence_GetSlice(__pyx_v_e_span, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PySequence_GetSlice(__pyx_v_e_span, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__pyx_v_e_sym = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2007
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2064
* off += (nt_len - 1)
* e_sym = list(e_span[:])
* off = e_i # <<<<<<<<<<<<<<
@@ -61259,7 +62330,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__Pyx_DECREF(__pyx_v_off);
__pyx_v_off = __pyx_v_e_i;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2008
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2065
* e_sym = list(e_span[:])
* off = e_i
* for next_nt in nt_inv: # <<<<<<<<<<<<<<
@@ -61270,7 +62341,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__pyx_t_3 = __pyx_v_nt_inv; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
__pyx_t_5 = NULL;
} else {
- __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_nt_inv); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_nt_inv); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
}
@@ -61278,23 +62349,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_2 = __pyx_t_5(__pyx_t_3);
if (unlikely(!__pyx_t_2)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -61304,29 +62375,29 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__pyx_v_next_nt = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2009
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2066
* off = e_i
* for next_nt in nt_inv:
* nt_len = (next_nt[4] - next_nt[3]) + 1 # <<<<<<<<<<<<<<
* i = 0
* while i < nt_len:
*/
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_v_nt_len);
__pyx_v_nt_len = __pyx_t_6;
__pyx_t_6 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2010
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2067
* for next_nt in nt_inv:
* nt_len = (next_nt[4] - next_nt[3]) + 1
* i = 0 # <<<<<<<<<<<<<<
@@ -61337,7 +62408,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__Pyx_XDECREF(__pyx_v_i);
__pyx_v_i = __pyx_int_0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2011
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2068
* nt_len = (next_nt[4] - next_nt[3]) + 1
* i = 0
* while i < nt_len: # <<<<<<<<<<<<<<
@@ -61345,83 +62416,83 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
* i += 1
*/
while (1) {
- __pyx_t_6 = PyObject_RichCompare(__pyx_v_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_RichCompare(__pyx_v_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (!__pyx_t_7) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2012
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2069
* i = 0
* while i < nt_len:
* e_sym.pop(next_nt[3] - off) # <<<<<<<<<<<<<<
* i += 1
* e_sym.insert(next_nt[3] - off, sym_setindex(self.category, next_nt[0]))
*/
- __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_e_sym), __pyx_n_s__pop); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_e_sym), __pyx_n_s__pop); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_v_off); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_v_off); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2013
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2070
* while i < nt_len:
* e_sym.pop(next_nt[3] - off)
* i += 1 # <<<<<<<<<<<<<<
* e_sym.insert(next_nt[3] - off, sym_setindex(self.category, next_nt[0]))
* off += (nt_len - 1)
*/
- __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_v_i);
__pyx_v_i = __pyx_t_2;
__pyx_t_2 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2014
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2071
* e_sym.pop(next_nt[3] - off)
* i += 1
* e_sym.insert(next_nt[3] - off, sym_setindex(self.category, next_nt[0])) # <<<<<<<<<<<<<<
* off += (nt_len - 1)
*
*/
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_v_off); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_v_off); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_9)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_9)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_10 = PyList_Insert(__pyx_v_e_sym, __pyx_t_8, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyList_Insert(__pyx_v_e_sym, __pyx_t_8, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2015
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2072
* i += 1
* e_sym.insert(next_nt[3] - off, sym_setindex(self.category, next_nt[0]))
* off += (nt_len - 1) # <<<<<<<<<<<<<<
*
* # Adjusting alignment links takes some doing
*/
- __pyx_t_1 = PyNumber_Subtract(__pyx_v_nt_len, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Subtract(__pyx_v_nt_len, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_v_off);
@@ -61430,20 +62501,20 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2018
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2075
*
* # Adjusting alignment links takes some doing
* links = [list(link) for sub in al for link in sub] # <<<<<<<<<<<<<<
* links_inv = sorted(links, cmp=lambda x, y: cmp(x[1], y[1]))
* links_len = len(links)
*/
- __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
if (PyList_CheckExact(__pyx_v_al) || PyTuple_CheckExact(__pyx_v_al)) {
__pyx_t_2 = __pyx_v_al; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
__pyx_t_5 = NULL;
} else {
- __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_al); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_al); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext;
}
@@ -61451,23 +62522,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_2)) {
if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_2)) {
if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_1 = __pyx_t_5(__pyx_t_2);
if (unlikely(!__pyx_t_1)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -61480,7 +62551,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__pyx_t_1 = __pyx_v_sub; __Pyx_INCREF(__pyx_t_1); __pyx_t_8 = 0;
__pyx_t_11 = NULL;
} else {
- __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_sub); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_sub); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_11 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -61488,23 +62559,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_6 = __pyx_t_11(__pyx_t_1);
if (unlikely(!__pyx_t_6)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -61513,15 +62584,15 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__Pyx_XDECREF(__pyx_v_link);
__pyx_v_link = __pyx_t_6;
__pyx_t_6 = 0;
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(__pyx_v_link);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_link);
__Pyx_GIVEREF(__pyx_v_link);
- __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
- if (unlikely(__Pyx_PyList_Append(__pyx_t_3, (PyObject*)__pyx_t_12))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_PyList_Append(__pyx_t_3, (PyObject*)__pyx_t_12))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -61532,32 +62603,32 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__pyx_cur_scope->__pyx_v_links = ((PyObject *)__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2019
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2076
* # Adjusting alignment links takes some doing
* links = [list(link) for sub in al for link in sub]
* links_inv = sorted(links, cmp=lambda x, y: cmp(x[1], y[1])) # <<<<<<<<<<<<<<
* links_len = len(links)
* nt_len = len(nt)
*/
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_links);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_links);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_links);
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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(((PyObject *)__pyx_t_2));
- __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda8, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda8, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__cmp), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__cmp), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__pyx_v_links_inv = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2020
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2077
* 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) # <<<<<<<<<<<<<<
@@ -61566,28 +62637,28 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
*/
__pyx_t_1 = __pyx_cur_scope->__pyx_v_links;
__Pyx_INCREF(__pyx_t_1);
- __pyx_t_4 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_links_len = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2021
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2078
* links_inv = sorted(links, cmp=lambda x, y: cmp(x[1], y[1]))
* links_len = len(links)
* nt_len = len(nt) # <<<<<<<<<<<<<<
* nt_i = 0
* off = f_i
*/
- __pyx_t_4 = PyObject_Length(__pyx_v_nt); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Length(__pyx_v_nt); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_v_nt_len);
__pyx_v_nt_len = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2022
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2079
* links_len = len(links)
* nt_len = len(nt)
* nt_i = 0 # <<<<<<<<<<<<<<
@@ -61597,7 +62668,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__Pyx_INCREF(__pyx_int_0);
__pyx_v_nt_i = __pyx_int_0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2023
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2080
* nt_len = len(nt)
* nt_i = 0
* off = f_i # <<<<<<<<<<<<<<
@@ -61608,7 +62679,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__Pyx_DECREF(__pyx_v_off);
__pyx_v_off = __pyx_v_f_i;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2024
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2081
* nt_i = 0
* off = f_i
* i = 0 # <<<<<<<<<<<<<<
@@ -61619,7 +62690,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__Pyx_XDECREF(__pyx_v_i);
__pyx_v_i = __pyx_int_0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2025
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2082
* off = f_i
* i = 0
* while i < links_len: # <<<<<<<<<<<<<<
@@ -61627,12 +62698,12 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
* off += (nt[nt_i][2] - nt[nt_i][1])
*/
while (1) {
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_v_links_len, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_v_links_len, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!__pyx_t_7) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2026
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2083
* i = 0
* while i < links_len:
* while nt_i < nt_len and links[i][0] > nt[nt_i][1]: # <<<<<<<<<<<<<<
@@ -61640,24 +62711,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
* nt_i += 1
*/
while (1) {
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_nt_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_nt_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_7) {
- __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_links, __pyx_v_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_links, __pyx_v_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_GetItem(__pyx_v_nt, __pyx_v_nt_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetItem(__pyx_v_nt, __pyx_v_nt_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_14 = __pyx_t_13;
} else {
@@ -61665,82 +62736,82 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
}
if (!__pyx_t_14) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2027
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2084
* while i < links_len:
* while nt_i < nt_len and links[i][0] > nt[nt_i][1]:
* off += (nt[nt_i][2] - nt[nt_i][1]) # <<<<<<<<<<<<<<
* nt_i += 1
* links[i][0] -= off
*/
- __pyx_t_1 = PyObject_GetItem(__pyx_v_nt, __pyx_v_nt_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetItem(__pyx_v_nt, __pyx_v_nt_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_GetItem(__pyx_v_nt, __pyx_v_nt_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetItem(__pyx_v_nt, __pyx_v_nt_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_v_off);
__pyx_v_off = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2028
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2085
* while nt_i < nt_len and links[i][0] > nt[nt_i][1]:
* off += (nt[nt_i][2] - nt[nt_i][1])
* nt_i += 1 # <<<<<<<<<<<<<<
* links[i][0] -= off
* i += 1
*/
- __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_nt_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_nt_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_v_nt_i);
__pyx_v_nt_i = __pyx_t_2;
__pyx_t_2 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2029
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2086
* off += (nt[nt_i][2] - nt[nt_i][1])
* nt_i += 1
* links[i][0] -= off # <<<<<<<<<<<<<<
* i += 1
* nt_i = 0
*/
- __pyx_t_2 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_links, __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_links, __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_t_4, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_t_4, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_v_off); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_v_off); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__Pyx_SetItemInt(__pyx_t_2, __pyx_t_4, __pyx_t_3, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_t_2, __pyx_t_4, __pyx_t_3, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2030
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2087
* nt_i += 1
* links[i][0] -= off
* i += 1 # <<<<<<<<<<<<<<
* nt_i = 0
* off = e_i
*/
- __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_v_i);
__pyx_v_i = __pyx_t_2;
__pyx_t_2 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2031
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2088
* links[i][0] -= off
* i += 1
* nt_i = 0 # <<<<<<<<<<<<<<
@@ -61751,7 +62822,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__Pyx_DECREF(__pyx_v_nt_i);
__pyx_v_nt_i = __pyx_int_0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2032
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2089
* i += 1
* nt_i = 0
* off = e_i # <<<<<<<<<<<<<<
@@ -61762,7 +62833,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__Pyx_DECREF(__pyx_v_off);
__pyx_v_off = __pyx_v_e_i;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2033
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2090
* nt_i = 0
* off = e_i
* i = 0 # <<<<<<<<<<<<<<
@@ -61773,7 +62844,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__Pyx_DECREF(__pyx_v_i);
__pyx_v_i = __pyx_int_0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2034
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2091
* off = e_i
* i = 0
* while i < links_len: # <<<<<<<<<<<<<<
@@ -61781,12 +62852,12 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
* off += (nt_inv[nt_i][4] - nt_inv[nt_i][3])
*/
while (1) {
- __pyx_t_2 = PyObject_RichCompare(__pyx_v_i, __pyx_v_links_len, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_RichCompare(__pyx_v_i, __pyx_v_links_len, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (!__pyx_t_14) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2035
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2092
* i = 0
* while i < links_len:
* while nt_i < nt_len and links_inv[i][1] > nt_inv[nt_i][3]: # <<<<<<<<<<<<<<
@@ -61794,24 +62865,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
* nt_i += 1
*/
while (1) {
- __pyx_t_2 = PyObject_RichCompare(__pyx_v_nt_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_RichCompare(__pyx_v_nt_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_14) {
- __pyx_t_2 = PyObject_GetItem(__pyx_v_links_inv, __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetItem(__pyx_v_links_inv, __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_GetItem(__pyx_v_nt_inv, __pyx_v_nt_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetItem(__pyx_v_nt_inv, __pyx_v_nt_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_13 = __pyx_t_7;
} else {
@@ -61819,82 +62890,82 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
}
if (!__pyx_t_13) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2036
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2093
* while i < links_len:
* while nt_i < nt_len and links_inv[i][1] > nt_inv[nt_i][3]:
* off += (nt_inv[nt_i][4] - nt_inv[nt_i][3]) # <<<<<<<<<<<<<<
* nt_i += 1
* links_inv[i][1] -= off
*/
- __pyx_t_2 = PyObject_GetItem(__pyx_v_nt_inv, __pyx_v_nt_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetItem(__pyx_v_nt_inv, __pyx_v_nt_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_GetItem(__pyx_v_nt_inv, __pyx_v_nt_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetItem(__pyx_v_nt_inv, __pyx_v_nt_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_v_off);
__pyx_v_off = __pyx_t_3;
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2037
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2094
* while nt_i < nt_len and links_inv[i][1] > nt_inv[nt_i][3]:
* off += (nt_inv[nt_i][4] - nt_inv[nt_i][3])
* nt_i += 1 # <<<<<<<<<<<<<<
* links_inv[i][1] -= off
* i += 1
*/
- __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_nt_i, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_nt_i, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_v_nt_i);
__pyx_v_nt_i = __pyx_t_3;
__pyx_t_3 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2038
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2095
* off += (nt_inv[nt_i][4] - nt_inv[nt_i][3])
* nt_i += 1
* links_inv[i][1] -= off # <<<<<<<<<<<<<<
* i += 1
*
*/
- __pyx_t_3 = PyObject_GetItem(__pyx_v_links_inv, __pyx_v_i); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_v_links_inv, __pyx_v_i); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = 1;
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, __pyx_t_4, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, __pyx_t_4, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_2, __pyx_v_off); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_2, __pyx_v_off); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__Pyx_SetItemInt(__pyx_t_3, __pyx_t_4, __pyx_t_1, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_t_3, __pyx_t_4, __pyx_t_1, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2039
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2096
* nt_i += 1
* links_inv[i][1] -= off
* i += 1 # <<<<<<<<<<<<<<
*
* # Find lexical span
*/
- __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_v_i);
__pyx_v_i = __pyx_t_3;
__pyx_t_3 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2042
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2099
*
* # Find lexical span
* lex_f_i = f_i # <<<<<<<<<<<<<<
@@ -61904,75 +62975,75 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__Pyx_INCREF(__pyx_v_f_i);
__pyx_v_lex_f_i = __pyx_v_f_i;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2043
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2100
* # Find lexical span
* lex_f_i = f_i
* lex_f_j = f_i + (len(f_span) - 1) # <<<<<<<<<<<<<<
* if nt:
* if nt[0][1] == lex_f_i:
*/
- __pyx_t_4 = PyObject_Length(__pyx_v_f_span); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_3 = PyInt_FromSsize_t((__pyx_t_4 - 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Length(__pyx_v_f_span); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromSsize_t((__pyx_t_4 - 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = PyNumber_Add(__pyx_v_f_i, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Add(__pyx_v_f_i, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_lex_f_j = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2044
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2101
* lex_f_i = f_i
* lex_f_j = f_i + (len(f_span) - 1)
* if nt: # <<<<<<<<<<<<<<
* if nt[0][1] == lex_f_i:
* lex_f_i += (nt[0][2] - nt[0][1]) + 1
*/
- __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_13) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2045
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2102
* lex_f_j = f_i + (len(f_span) - 1)
* if nt:
* if nt[0][1] == lex_f_i: # <<<<<<<<<<<<<<
* lex_f_i += (nt[0][2] - nt[0][1]) + 1
* if nt[-1][2] == lex_f_j:
*/
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_v_lex_f_i, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_v_lex_f_i, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_13) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2046
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2103
* if nt:
* if nt[0][1] == lex_f_i:
* lex_f_i += (nt[0][2] - nt[0][1]) + 1 # <<<<<<<<<<<<<<
* if nt[-1][2] == lex_f_j:
* lex_f_j -= (nt[-1][2] - nt[-1][1]) + 1
*/
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_lex_f_i, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_lex_f_i, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_v_lex_f_i);
@@ -61982,49 +63053,49 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
}
__pyx_L24:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2047
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2104
* if nt[0][1] == lex_f_i:
* lex_f_i += (nt[0][2] - nt[0][1]) + 1
* if nt[-1][2] == lex_f_j: # <<<<<<<<<<<<<<
* lex_f_j -= (nt[-1][2] - nt[-1][1]) + 1
*
*/
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_v_lex_f_j, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_v_lex_f_j, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_13) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2048
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2105
* lex_f_i += (nt[0][2] - nt[0][1]) + 1
* if nt[-1][2] == lex_f_j:
* lex_f_j -= (nt[-1][2] - nt[-1][1]) + 1 # <<<<<<<<<<<<<<
*
* # Create rule (f_phrase, e_phrase, links, f_link_min, f_link_max)
*/
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_v_lex_f_j, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_v_lex_f_j, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_v_lex_f_j);
@@ -62037,63 +63108,63 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
}
__pyx_L23:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2051
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2108
*
* # Create rule (f_phrase, e_phrase, links, f_link_min, f_link_max)
* f = Phrase(f_sym) # <<<<<<<<<<<<<<
* e = Phrase(e_sym)
* a = tuple(self.alignment.link(i, j) for (i, j) in links)
*/
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_f_sym));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_f_sym));
__Pyx_GIVEREF(((PyObject *)__pyx_v_f_sym));
- __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__pyx_v_f = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2052
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2109
* # Create rule (f_phrase, e_phrase, links, f_link_min, f_link_max)
* f = Phrase(f_sym)
* e = Phrase(e_sym) # <<<<<<<<<<<<<<
* a = tuple(self.alignment.link(i, j) for (i, j) in links)
* return (f, e, a, lex_f_i, lex_f_j)
*/
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_v_e_sym));
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_e_sym));
__Pyx_GIVEREF(((PyObject *)__pyx_v_e_sym));
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__pyx_v_e = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2053
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2110
* f = Phrase(f_sym)
* e = Phrase(e_sym)
* a = tuple(self.alignment.link(i, j) for (i, j) in links) # <<<<<<<<<<<<<<
* return (f, e, a, lex_f_i, lex_f_j)
*
*/
- __pyx_t_1 = __pyx_pf_3_sa_23HieroCachingRuleFactory_9form_rule_2genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_pf_3_sa_23HieroCachingRuleFactory_9form_rule_2genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__pyx_v_a = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2054
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2111
* 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) # <<<<<<<<<<<<<<
@@ -62101,7 +63172,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
* # Rule string from rule
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_f));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_f));
@@ -62186,16 +63257,16 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_30fmt_rule(PyObject *__
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__a)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fmt_rule") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fmt_rule") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
@@ -62210,7 +63281,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_30fmt_rule(PyObject *__
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.HieroCachingRuleFactory.fmt_rule", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -62220,9 +63291,9 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_30fmt_rule(PyObject *__
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator15(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2058
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2115
* # 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) # <<<<<<<<<<<<<<
@@ -62231,24 +63302,24 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator15(
*/
static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8fmt_rule_genexpr(PyObject *__pyx_self) {
- struct __pyx_obj_3_sa___pyx_scope_struct_24_genexpr *__pyx_cur_scope;
+ struct __pyx_obj_3_sa___pyx_scope_struct_25_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_3_sa___pyx_scope_struct_24_genexpr *)__pyx_ptype_3_sa___pyx_scope_struct_24_genexpr->tp_new(__pyx_ptype_3_sa___pyx_scope_struct_24_genexpr, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_3_sa___pyx_scope_struct_25_genexpr *)__pyx_ptype_3_sa___pyx_scope_struct_25_genexpr->tp_new(__pyx_ptype_3_sa___pyx_scope_struct_25_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_3_sa___pyx_scope_struct_23_fmt_rule *) __pyx_self;
+ __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_3_sa___pyx_scope_struct_24_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_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator15, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -62266,9 +63337,9 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8fmt_rule_genexpr(PyObj
return __pyx_r;
}
-static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator15(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
- struct __pyx_obj_3_sa___pyx_scope_struct_24_genexpr *__pyx_cur_scope = ((struct __pyx_obj_3_sa___pyx_scope_struct_24_genexpr *)__pyx_generator->closure);
+ struct __pyx_obj_3_sa___pyx_scope_struct_25_genexpr *__pyx_cur_scope = ((struct __pyx_obj_3_sa___pyx_scope_struct_25_genexpr *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
@@ -62287,13 +63358,13 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator15(
return NULL;
}
__pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_a)) { __Pyx_RaiseClosureNameError("a"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_a)) { __Pyx_RaiseClosureNameError("a"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
if (PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_a) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_a)) {
__pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_a; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
__pyx_t_3 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -62301,23 +63372,23 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator15(
if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_3(__pyx_t_1);
if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -62328,24 +63399,24 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator15(
__Pyx_GIVEREF(__pyx_t_4);
__pyx_cur_scope->__pyx_v_packed = __pyx_t_4;
__pyx_t_4 = 0;
- __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_137), __pyx_n_s__format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_137), __pyx_n_s__format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->alignment), __pyx_n_s__unlink); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->alignment), __pyx_n_s__unlink); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_packed);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_cur_scope->__pyx_v_packed);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_packed);
- __pyx_t_7 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
- __pyx_t_6 = PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_6));
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
@@ -62366,7 +63437,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator15(
__Pyx_XGOTREF(__pyx_t_1);
__pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
__pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyErr_SetNone(PyExc_StopIteration);
@@ -62386,7 +63457,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator15(
return NULL;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2057
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2114
*
* # Rule string from rule
* def fmt_rule(self, f, e, a): # <<<<<<<<<<<<<<
@@ -62395,7 +63466,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator15(
*/
static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_29fmt_rule(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_f, PyObject *__pyx_v_e, PyObject *__pyx_v_a) {
- struct __pyx_obj_3_sa___pyx_scope_struct_23_fmt_rule *__pyx_cur_scope;
+ struct __pyx_obj_3_sa___pyx_scope_struct_24_fmt_rule *__pyx_cur_scope;
PyObject *__pyx_v_a_str = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
@@ -62406,7 +63477,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_29fmt_rule(struct __pyx
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("fmt_rule", 0);
- __pyx_cur_scope = (struct __pyx_obj_3_sa___pyx_scope_struct_23_fmt_rule *)__pyx_ptype_3_sa___pyx_scope_struct_23_fmt_rule->tp_new(__pyx_ptype_3_sa___pyx_scope_struct_23_fmt_rule, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_3_sa___pyx_scope_struct_24_fmt_rule *)__pyx_ptype_3_sa___pyx_scope_struct_24_fmt_rule->tp_new(__pyx_ptype_3_sa___pyx_scope_struct_24_fmt_rule, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__Pyx_RefNannyFinishContext();
return NULL;
@@ -62419,30 +63490,30 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_29fmt_rule(struct __pyx
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_a);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_a);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2058
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2115
* # Rule string from rule
* def fmt_rule(self, f, e, a):
* a_str = ' '.join('{0}-{1}'.format(*self.alignment.unlink(packed)) for packed in a) # <<<<<<<<<<<<<<
* return '[X] ||| {0} ||| {1} ||| {2}'.format(f, e, a_str)
*
*/
- __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_67), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_67), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __pyx_pf_3_sa_23HieroCachingRuleFactory_8fmt_rule_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_pf_3_sa_23HieroCachingRuleFactory_8fmt_rule_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__pyx_v_a_str = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2059
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2116
* 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) # <<<<<<<<<<<<<<
@@ -62450,9 +63521,9 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_29fmt_rule(struct __pyx
* # Debugging
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_138), __pyx_n_s__format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_138), __pyx_n_s__format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_f);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_f);
@@ -62463,7 +63534,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_29fmt_rule(struct __pyx
__Pyx_INCREF(__pyx_v_a_str);
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_a_str);
__Pyx_GIVEREF(__pyx_v_a_str);
- __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
@@ -62498,7 +63569,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_32dump_online_stats(PyO
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2062
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2119
*
* # Debugging
* def dump_online_stats(self): # <<<<<<<<<<<<<<
@@ -62510,7 +63581,6 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
PyObject *__pyx_v_w = NULL;
PyObject *__pyx_v_w2 = NULL;
PyObject *__pyx_v_ph = NULL;
- PyObject *__pyx_v_ph2 = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
@@ -62524,82 +63594,80 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
Py_ssize_t __pyx_t_9;
PyObject *(*__pyx_t_10)(PyObject *);
PyObject *__pyx_t_11 = NULL;
- PyObject *__pyx_t_12 = NULL;
- PyObject *__pyx_t_13 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("dump_online_stats", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2063
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2120
* # Debugging
* def dump_online_stats(self):
* logger.info('------------------------------') # <<<<<<<<<<<<<<
* logger.info(' Online Stats ')
* logger.info('------------------------------')
*/
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_140), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_140), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2064
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2121
* def dump_online_stats(self):
* logger.info('------------------------------')
* logger.info(' Online Stats ') # <<<<<<<<<<<<<<
* logger.info('------------------------------')
* logger.info('f')
*/
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_142), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_142), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2065
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2122
* logger.info('------------------------------')
* logger.info(' Online Stats ')
* logger.info('------------------------------') # <<<<<<<<<<<<<<
* logger.info('f')
* for w in self.bilex_f:
*/
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_143), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_143), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2066
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2123
* logger.info(' Online Stats ')
* logger.info('------------------------------')
* logger.info('f') # <<<<<<<<<<<<<<
* for w in self.bilex_f:
* logger.info(sym_tostring(w) + ' : ' + str(self.bilex_f[w]))
*/
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_144), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_144), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2067
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2124
* logger.info('------------------------------')
* logger.info('f')
* for w in self.bilex_f: # <<<<<<<<<<<<<<
@@ -62610,7 +63678,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
__pyx_t_1 = __pyx_v_self->bilex_f; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
__pyx_t_4 = NULL;
} else {
- __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->bilex_f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->bilex_f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -62618,23 +63686,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_2 = __pyx_t_4(__pyx_t_1);
if (unlikely(!__pyx_t_2)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -62644,44 +63712,44 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
__pyx_v_w = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2068
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2125
* logger.info('f')
* for w in self.bilex_f:
* logger.info(sym_tostring(w) + ' : ' + str(self.bilex_f[w])) # <<<<<<<<<<<<<<
* logger.info('e')
* for w in self.bilex_e:
*/
- __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__info); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__info); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_w); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_6)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_w); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_6)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
- __pyx_t_7 = PyNumber_Add(((PyObject *)__pyx_t_2), ((PyObject *)__pyx_kp_s_145)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyNumber_Add(((PyObject *)__pyx_t_2), ((PyObject *)__pyx_kp_s_145)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_GetItem(__pyx_v_self->bilex_f, __pyx_v_w); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetItem(__pyx_v_self->bilex_f, __pyx_v_w); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
- __pyx_t_8 = PyNumber_Add(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyNumber_Add(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_8);
__pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
@@ -62689,24 +63757,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2069
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2126
* for w in self.bilex_f:
* logger.info(sym_tostring(w) + ' : ' + str(self.bilex_f[w]))
* logger.info('e') # <<<<<<<<<<<<<<
* for w in self.bilex_e:
* logger.info(sym_tostring(w) + ' : ' + str(self.bilex_e[w]))
*/
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_8 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_k_tuple_146), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_k_tuple_146), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2070
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2127
* logger.info(sym_tostring(w) + ' : ' + str(self.bilex_f[w]))
* logger.info('e')
* for w in self.bilex_e: # <<<<<<<<<<<<<<
@@ -62717,7 +63785,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
__pyx_t_1 = __pyx_v_self->bilex_e; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
__pyx_t_4 = NULL;
} else {
- __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->bilex_e); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->bilex_e); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -62725,23 +63793,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_8 = __pyx_t_4(__pyx_t_1);
if (unlikely(!__pyx_t_8)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -62751,44 +63819,44 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
__pyx_v_w = __pyx_t_8;
__pyx_t_8 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2071
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2128
* logger.info('e')
* for w in self.bilex_e:
* logger.info(sym_tostring(w) + ' : ' + str(self.bilex_e[w])) # <<<<<<<<<<<<<<
* logger.info('fe')
* for w in self.bilex_fe:
*/
- __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_2 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_w); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_8 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_6)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_w); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_6)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_8));
- __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_t_8), ((PyObject *)__pyx_kp_s_145)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_t_8), ((PyObject *)__pyx_kp_s_145)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
- __pyx_t_8 = PyObject_GetItem(__pyx_v_self->bilex_e, __pyx_v_w); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_GetItem(__pyx_v_self->bilex_e, __pyx_v_w); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_8);
__pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
- __pyx_t_7 = PyNumber_Add(__pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyNumber_Add(__pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7);
__Pyx_GIVEREF(__pyx_t_7);
__pyx_t_7 = 0;
- __pyx_t_7 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
@@ -62796,24 +63864,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2072
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2129
* for w in self.bilex_e:
* logger.info(sym_tostring(w) + ' : ' + str(self.bilex_e[w]))
* logger.info('fe') # <<<<<<<<<<<<<<
* for w in self.bilex_fe:
* for w2 in self.bilex_fe[w]:
*/
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_k_tuple_147), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_k_tuple_147), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2073
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2130
* logger.info(sym_tostring(w) + ' : ' + str(self.bilex_e[w]))
* logger.info('fe')
* for w in self.bilex_fe: # <<<<<<<<<<<<<<
@@ -62824,7 +63892,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
__pyx_t_1 = __pyx_v_self->bilex_fe; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
__pyx_t_4 = NULL;
} else {
- __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->bilex_fe); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->bilex_fe); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -62832,23 +63900,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_7); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_7); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_7); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_7); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_7 = __pyx_t_4(__pyx_t_1);
if (unlikely(!__pyx_t_7)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -62858,20 +63926,20 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
__pyx_v_w = __pyx_t_7;
__pyx_t_7 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2074
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2131
* logger.info('fe')
* for w in self.bilex_fe:
* for w2 in self.bilex_fe[w]: # <<<<<<<<<<<<<<
* logger.info(sym_tostring(w) + ' : ' + sym_tostring(w2) + ' : ' + str(self.bilex_fe[w][w2]))
* logger.info('F')
*/
- __pyx_t_7 = PyObject_GetItem(__pyx_v_self->bilex_fe, __pyx_v_w); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_GetItem(__pyx_v_self->bilex_fe, __pyx_v_w); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
if (PyList_CheckExact(__pyx_t_7) || PyTuple_CheckExact(__pyx_t_7)) {
__pyx_t_8 = __pyx_t_7; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0;
__pyx_t_10 = NULL;
} else {
- __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext;
}
@@ -62880,23 +63948,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
if (!__pyx_t_10 && PyList_CheckExact(__pyx_t_8)) {
if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_8)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_7 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_10 && PyTuple_CheckExact(__pyx_t_8)) {
if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_7 = __pyx_t_10(__pyx_t_8);
if (unlikely(!__pyx_t_7)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -62906,57 +63974,57 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
__pyx_v_w2 = __pyx_t_7;
__pyx_t_7 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2075
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2132
* for w in self.bilex_fe:
* for w2 in self.bilex_fe[w]:
* logger.info(sym_tostring(w) + ' : ' + sym_tostring(w2) + ' : ' + str(self.bilex_fe[w][w2])) # <<<<<<<<<<<<<<
* logger.info('F')
* for ph in self.phrases_f:
*/
- __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_2 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_w); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_7 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_w); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_7));
- __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_t_7), ((PyObject *)__pyx_kp_s_145)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_t_7), ((PyObject *)__pyx_kp_s_145)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
- __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_w2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_7 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_w2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_7));
- __pyx_t_11 = PyNumber_Add(__pyx_t_5, ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyNumber_Add(__pyx_t_5, ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
- __pyx_t_7 = PyNumber_Add(__pyx_t_11, ((PyObject *)__pyx_kp_s_145)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyNumber_Add(__pyx_t_11, ((PyObject *)__pyx_kp_s_145)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = PyObject_GetItem(__pyx_v_self->bilex_fe, __pyx_v_w); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_GetItem(__pyx_v_self->bilex_fe, __pyx_v_w); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_5 = PyObject_GetItem(__pyx_t_11, __pyx_v_w2); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_GetItem(__pyx_t_11, __pyx_v_w2); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
__pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
- __pyx_t_11 = PyNumber_Add(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyNumber_Add(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_11);
__Pyx_GIVEREF(__pyx_t_11);
__pyx_t_11 = 0;
- __pyx_t_11 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
@@ -62966,24 +64034,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2076
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2133
* for w2 in self.bilex_fe[w]:
* logger.info(sym_tostring(w) + ' : ' + sym_tostring(w2) + ' : ' + str(self.bilex_fe[w][w2]))
* logger.info('F') # <<<<<<<<<<<<<<
* for ph in self.phrases_f:
* logger.info(str(ph) + ' ||| ' + str(self.phrases_f[ph]))
*/
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_8 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_k_tuple_148), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_k_tuple_148), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2077
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2134
* logger.info(sym_tostring(w) + ' : ' + sym_tostring(w2) + ' : ' + str(self.bilex_fe[w][w2]))
* logger.info('F')
* for ph in self.phrases_f: # <<<<<<<<<<<<<<
@@ -62994,7 +64062,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
__pyx_t_1 = __pyx_v_self->phrases_f; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
__pyx_t_4 = NULL;
} else {
- __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->phrases_f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->phrases_f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -63002,23 +64070,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_8 = __pyx_t_4(__pyx_t_1);
if (unlikely(!__pyx_t_8)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -63028,49 +64096,49 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
__pyx_v_ph = __pyx_t_8;
__pyx_t_8 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2078
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2135
* logger.info('F')
* for ph in self.phrases_f:
* logger.info(str(ph) + ' ||| ' + str(self.phrases_f[ph])) # <<<<<<<<<<<<<<
* logger.info('E')
* for ph in self.phrases_e:
*/
- __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_11 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__info); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__info); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(__pyx_v_ph);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_ph);
__Pyx_GIVEREF(__pyx_v_ph);
- __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
- __pyx_t_8 = PyNumber_Add(__pyx_t_5, ((PyObject *)__pyx_kp_s_18)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyNumber_Add(__pyx_t_5, ((PyObject *)__pyx_kp_s_18)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_GetItem(__pyx_v_self->phrases_f, __pyx_v_ph); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_GetItem(__pyx_v_self->phrases_f, __pyx_v_ph); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
__pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Add(__pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
@@ -63078,24 +64146,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2079
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2136
* for ph in self.phrases_f:
* logger.info(str(ph) + ' ||| ' + str(self.phrases_f[ph]))
* logger.info('E') # <<<<<<<<<<<<<<
* for ph in self.phrases_e:
* logger.info(str(ph) + ' ||| ' + str(self.phrases_e[ph]))
*/
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_149), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_149), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2080
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2137
* logger.info(str(ph) + ' ||| ' + str(self.phrases_f[ph]))
* logger.info('E')
* for ph in self.phrases_e: # <<<<<<<<<<<<<<
@@ -63106,7 +64174,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
__pyx_t_1 = __pyx_v_self->phrases_e; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
__pyx_t_4 = NULL;
} else {
- __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->phrases_e); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->phrases_e); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -63114,23 +64182,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_2 = __pyx_t_4(__pyx_t_1);
if (unlikely(!__pyx_t_2)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -63140,49 +64208,49 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
__pyx_v_ph = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2081
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2138
* logger.info('E')
* for ph in self.phrases_e:
* logger.info(str(ph) + ' ||| ' + str(self.phrases_e[ph])) # <<<<<<<<<<<<<<
* logger.info('FE')
- * for ph in self.phrases_fe:
+ * self.dump_online_rules()
*/
- __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__info); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__info); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_ph);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_ph);
__Pyx_GIVEREF(__pyx_v_ph);
- __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Add(__pyx_t_11, ((PyObject *)__pyx_kp_s_18)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_t_11, ((PyObject *)__pyx_kp_s_18)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = PyObject_GetItem(__pyx_v_self->phrases_e, __pyx_v_ph); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_GetItem(__pyx_v_self->phrases_e, __pyx_v_ph); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_11);
__Pyx_GIVEREF(__pyx_t_11);
__pyx_t_11 = 0;
- __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
- __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_t_11); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_t_11); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_8);
__pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
@@ -63190,198 +64258,273 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2082
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2139
* for ph in self.phrases_e:
* logger.info(str(ph) + ' ||| ' + str(self.phrases_e[ph]))
* logger.info('FE') # <<<<<<<<<<<<<<
- * for ph in self.phrases_fe:
- * for ph2 in self.phrases_fe[ph]:
+ * self.dump_online_rules()
+ *
*/
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_8 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_k_tuple_150), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_k_tuple_150), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2083
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2140
* logger.info(str(ph) + ' ||| ' + str(self.phrases_e[ph]))
* logger.info('FE')
+ * self.dump_online_rules() # <<<<<<<<<<<<<<
+ *
+ * def dump_online_rules(self):
+ */
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__dump_online_rules); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_XDECREF(__pyx_t_11);
+ __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.dump_online_stats", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_w);
+ __Pyx_XDECREF(__pyx_v_w2);
+ __Pyx_XDECREF(__pyx_v_ph);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_34dump_online_rules(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_34dump_online_rules(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("dump_online_rules (wrapper)", 0);
+ __pyx_r = __pyx_pf_3_sa_23HieroCachingRuleFactory_33dump_online_rules(((struct __pyx_obj_3_sa_HieroCachingRuleFactory *)__pyx_v_self));
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2142
+ * self.dump_online_rules()
+ *
+ * def dump_online_rules(self): # <<<<<<<<<<<<<<
+ * for ph in self.phrases_fe:
+ * for ph2 in self.phrases_fe[ph]:
+ */
+
+static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_33dump_online_rules(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self) {
+ PyObject *__pyx_v_ph = NULL;
+ PyObject *__pyx_v_ph2 = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ Py_ssize_t __pyx_t_2;
+ PyObject *(*__pyx_t_3)(PyObject *);
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ Py_ssize_t __pyx_t_6;
+ PyObject *(*__pyx_t_7)(PyObject *);
+ PyObject *__pyx_t_8 = NULL;
+ PyObject *__pyx_t_9 = NULL;
+ PyObject *__pyx_t_10 = NULL;
+ PyObject *__pyx_t_11 = NULL;
+ PyObject *__pyx_t_12 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("dump_online_rules", 0);
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2143
+ *
+ * def dump_online_rules(self):
* for ph in self.phrases_fe: # <<<<<<<<<<<<<<
* for ph2 in self.phrases_fe[ph]:
* logger.info(self.fmt_rule(str(ph), str(ph2), self.phrases_al[ph][ph2]) + ' ||| ' + str(self.phrases_fe[ph][ph2]))
*/
if (PyList_CheckExact(__pyx_v_self->phrases_fe) || PyTuple_CheckExact(__pyx_v_self->phrases_fe)) {
- __pyx_t_1 = __pyx_v_self->phrases_fe; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
- __pyx_t_4 = NULL;
+ __pyx_t_1 = __pyx_v_self->phrases_fe; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
+ __pyx_t_3 = NULL;
} else {
- __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->phrases_fe); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->phrases_fe); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
+ __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
for (;;) {
- if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) {
- if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
+ if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
+ if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
- } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) {
- if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
+ } else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
+ if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
- __pyx_t_8 = __pyx_t_4(__pyx_t_1);
- if (unlikely(!__pyx_t_8)) {
+ __pyx_t_4 = __pyx_t_3(__pyx_t_1);
+ if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
- __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_GOTREF(__pyx_t_4);
}
__Pyx_XDECREF(__pyx_v_ph);
- __pyx_v_ph = __pyx_t_8;
- __pyx_t_8 = 0;
+ __pyx_v_ph = __pyx_t_4;
+ __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2084
- * logger.info('FE')
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2144
+ * def dump_online_rules(self):
* for ph in self.phrases_fe:
* for ph2 in self.phrases_fe[ph]: # <<<<<<<<<<<<<<
* logger.info(self.fmt_rule(str(ph), str(ph2), self.phrases_al[ph][ph2]) + ' ||| ' + str(self.phrases_fe[ph][ph2]))
*
*/
- __pyx_t_8 = PyObject_GetItem(__pyx_v_self->phrases_fe, __pyx_v_ph); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- if (PyList_CheckExact(__pyx_t_8) || PyTuple_CheckExact(__pyx_t_8)) {
- __pyx_t_11 = __pyx_t_8; __Pyx_INCREF(__pyx_t_11); __pyx_t_9 = 0;
- __pyx_t_10 = NULL;
+ __pyx_t_4 = PyObject_GetItem(__pyx_v_self->phrases_fe, __pyx_v_ph); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
+ __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
+ __pyx_t_7 = NULL;
} else {
- __pyx_t_9 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_10 = Py_TYPE(__pyx_t_11)->tp_iternext;
+ __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext;
}
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
for (;;) {
- if (!__pyx_t_10 && PyList_CheckExact(__pyx_t_11)) {
- if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_11)) break;
+ if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_5)) {
+ if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_8 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_8 = PySequence_ITEM(__pyx_t_11, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
- } else if (!__pyx_t_10 && PyTuple_CheckExact(__pyx_t_11)) {
- if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
+ } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_5)) {
+ if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_8 = PySequence_ITEM(__pyx_t_11, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
- __pyx_t_8 = __pyx_t_10(__pyx_t_11);
- if (unlikely(!__pyx_t_8)) {
+ __pyx_t_4 = __pyx_t_7(__pyx_t_5);
+ if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
- __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_GOTREF(__pyx_t_4);
}
__Pyx_XDECREF(__pyx_v_ph2);
- __pyx_v_ph2 = __pyx_t_8;
- __pyx_t_8 = 0;
+ __pyx_v_ph2 = __pyx_t_4;
+ __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2085
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2145
* for ph in self.phrases_fe:
* for ph2 in self.phrases_fe[ph]:
* logger.info(self.fmt_rule(str(ph), str(ph2), self.phrases_al[ph][ph2]) + ' ||| ' + str(self.phrases_fe[ph][ph2])) # <<<<<<<<<<<<<<
*
- * # Spans are _inclusive_ on both ends [i, j]
+ * # Lookup online stats for phrase pair (f, e). Return None if no match.
*/
- __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_5 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__info); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__fmt_rule); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_8 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__info); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__fmt_rule); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
__Pyx_INCREF(__pyx_v_ph);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_ph);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_ph);
__Pyx_GIVEREF(__pyx_v_ph);
- __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
__Pyx_INCREF(__pyx_v_ph2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_ph2);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_ph2);
__Pyx_GIVEREF(__pyx_v_ph2);
- __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
+ __pyx_t_9 = PyObject_GetItem(__pyx_v_self->phrases_al, __pyx_v_ph); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_12 = PyObject_GetItem(__pyx_t_9, __pyx_v_ph2); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_GetItem(__pyx_v_self->phrases_al, __pyx_v_ph); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_13 = PyObject_GetItem(__pyx_t_2, __pyx_v_ph2); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_12);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10);
+ __Pyx_GIVEREF(__pyx_t_10);
+ PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_11);
+ PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_12);
__Pyx_GIVEREF(__pyx_t_12);
- PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_13);
- __Pyx_GIVEREF(__pyx_t_13);
- __pyx_t_7 = 0;
+ __pyx_t_10 = 0;
+ __pyx_t_11 = 0;
__pyx_t_12 = 0;
- __pyx_t_13 = 0;
- __pyx_t_13 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Add(__pyx_t_13, ((PyObject *)__pyx_kp_s_18)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_13 = PyObject_GetItem(__pyx_v_self->phrases_fe, __pyx_v_ph); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_8 = PyObject_GetItem(__pyx_t_13, __pyx_v_ph2); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_8);
- __pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
- __pyx_t_13 = PyNumber_Add(__pyx_t_2, __pyx_t_8); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_12 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
+ __pyx_t_9 = PyNumber_Add(__pyx_t_12, ((PyObject *)__pyx_kp_s_18)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __pyx_t_12 = PyObject_GetItem(__pyx_v_self->phrases_fe, __pyx_v_ph); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ __pyx_t_4 = PyObject_GetItem(__pyx_t_12, __pyx_v_ph2); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
+ __pyx_t_12 = PyNumber_Add(__pyx_t_9, __pyx_t_4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_12);
+ __Pyx_GIVEREF(__pyx_t_12);
+ __pyx_t_12 = 0;
+ __pyx_t_12 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_13);
- __Pyx_GIVEREF(__pyx_t_13);
- __pyx_t_13 = 0;
- __pyx_t_13 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
}
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -63389,18 +64532,16 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_XDECREF(__pyx_t_12);
- __Pyx_XDECREF(__pyx_t_13);
- __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.dump_online_stats", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.dump_online_rules", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
- __Pyx_XDECREF(__pyx_v_w);
- __Pyx_XDECREF(__pyx_v_w2);
__Pyx_XDECREF(__pyx_v_ph);
__Pyx_XDECREF(__pyx_v_ph2);
__Pyx_XGIVEREF(__pyx_r);
@@ -63409,9 +64550,1087 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_13span_check(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_3_sa_13span_check = {__Pyx_NAMESTR("span_check"), (PyCFunction)__pyx_pw_3_sa_13span_check, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_3_sa_13span_check(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_36online_ctx_lookup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_36online_ctx_lookup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_f = 0;
+ PyObject *__pyx_v_e = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("online_ctx_lookup (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__f,&__pyx_n_s__e,0};
+ PyObject* values[2] = {0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ 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 (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("online_ctx_lookup", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "online_ctx_lookup") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ }
+ __pyx_v_f = values[0];
+ __pyx_v_e = values[1];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("online_ctx_lookup", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.online_ctx_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_3_sa_23HieroCachingRuleFactory_35online_ctx_lookup(((struct __pyx_obj_3_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_f, __pyx_v_e);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2149
+ * # 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): # <<<<<<<<<<<<<<
+ * if self.online:
+ * fcount = self.phrases_f.get(f, 0)
+ */
+
+static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_35online_ctx_lookup(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_f, PyObject *__pyx_v_e) {
+ PyObject *__pyx_v_fcount = NULL;
+ PyObject *__pyx_v_fsample_count = NULL;
+ PyObject *__pyx_v_d = NULL;
+ PyObject *__pyx_v_paircount = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("online_ctx_lookup", 0);
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2150
+ * # IMPORTANT: use get() to avoid adding items to defaultdict
+ * def online_ctx_lookup(self, f, e):
+ * if self.online: # <<<<<<<<<<<<<<
+ * fcount = self.phrases_f.get(f, 0)
+ * fsample_count = self.samples_f.get(f, 0)
+ */
+ if (__pyx_v_self->online) {
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2151
+ * def online_ctx_lookup(self, f, e):
+ * if self.online:
+ * fcount = self.phrases_f.get(f, 0) # <<<<<<<<<<<<<<
+ * fsample_count = self.samples_f.get(f, 0)
+ * d = self.phrases_fe.get(f, None)
+ */
+ __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->phrases_f, __pyx_n_s__get); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_v_f);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_f);
+ __Pyx_GIVEREF(__pyx_v_f);
+ __Pyx_INCREF(__pyx_int_0);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0);
+ __Pyx_GIVEREF(__pyx_int_0);
+ __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+ __pyx_v_fcount = __pyx_t_3;
+ __pyx_t_3 = 0;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2152
+ * if self.online:
+ * fcount = self.phrases_f.get(f, 0)
+ * fsample_count = self.samples_f.get(f, 0) # <<<<<<<<<<<<<<
+ * d = self.phrases_fe.get(f, None)
+ * paircount = d.get(e, 0) if d else 0
+ */
+ __pyx_t_3 = PyObject_GetAttr(__pyx_v_self->samples_f, __pyx_n_s__get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_v_f);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_f);
+ __Pyx_GIVEREF(__pyx_v_f);
+ __Pyx_INCREF(__pyx_int_0);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0);
+ __Pyx_GIVEREF(__pyx_int_0);
+ __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+ __pyx_v_fsample_count = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2153
+ * fcount = self.phrases_f.get(f, 0)
+ * fsample_count = self.samples_f.get(f, 0)
+ * d = self.phrases_fe.get(f, None) # <<<<<<<<<<<<<<
+ * paircount = d.get(e, 0) if d else 0
+ * return OnlineFeatureContext(fcount, fsample_count, paircount, self.bilex_f, self.bilex_e, self.bilex_fe)
+ */
+ __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->phrases_fe, __pyx_n_s__get); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_v_f);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_f);
+ __Pyx_GIVEREF(__pyx_v_f);
+ __Pyx_INCREF(Py_None);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
+ __Pyx_GIVEREF(Py_None);
+ __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+ __pyx_v_d = __pyx_t_3;
+ __pyx_t_3 = 0;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2154
+ * fsample_count = self.samples_f.get(f, 0)
+ * d = self.phrases_fe.get(f, None)
+ * paircount = d.get(e, 0) if d else 0 # <<<<<<<<<<<<<<
+ * return OnlineFeatureContext(fcount, fsample_count, paircount, self.bilex_f, self.bilex_e, self.bilex_fe)
+ * return None
+ */
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_d); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_4) {
+ __pyx_t_2 = PyObject_GetAttr(__pyx_v_d, __pyx_n_s__get); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_v_e);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_e);
+ __Pyx_GIVEREF(__pyx_v_e);
+ __Pyx_INCREF(__pyx_int_0);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_0);
+ __Pyx_GIVEREF(__pyx_int_0);
+ __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+ __pyx_t_3 = __pyx_t_5;
+ __pyx_t_5 = 0;
+ } else {
+ __Pyx_INCREF(__pyx_int_0);
+ __pyx_t_3 = __pyx_int_0;
+ }
+ __pyx_v_paircount = __pyx_t_3;
+ __pyx_t_3 = 0;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2155
+ * d = self.phrases_fe.get(f, None)
+ * paircount = d.get(e, 0) if d else 0
+ * return OnlineFeatureContext(fcount, fsample_count, paircount, self.bilex_f, self.bilex_e, self.bilex_fe) # <<<<<<<<<<<<<<
+ * return None
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s_151); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_5 = PyTuple_New(6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_INCREF(__pyx_v_fcount);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_fcount);
+ __Pyx_GIVEREF(__pyx_v_fcount);
+ __Pyx_INCREF(__pyx_v_fsample_count);
+ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_fsample_count);
+ __Pyx_GIVEREF(__pyx_v_fsample_count);
+ __Pyx_INCREF(__pyx_v_paircount);
+ PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_paircount);
+ __Pyx_GIVEREF(__pyx_v_paircount);
+ __Pyx_INCREF(__pyx_v_self->bilex_f);
+ PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_self->bilex_f);
+ __Pyx_GIVEREF(__pyx_v_self->bilex_f);
+ __Pyx_INCREF(__pyx_v_self->bilex_e);
+ PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_v_self->bilex_e);
+ __Pyx_GIVEREF(__pyx_v_self->bilex_e);
+ __Pyx_INCREF(__pyx_v_self->bilex_fe);
+ PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_v_self->bilex_fe);
+ __Pyx_GIVEREF(__pyx_v_self->bilex_fe);
+ __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2156
+ * paircount = d.get(e, 0) if d else 0
+ * return OnlineFeatureContext(fcount, fsample_count, paircount, self.bilex_f, self.bilex_e, self.bilex_fe)
+ * return None # <<<<<<<<<<<<<<
+ *
+ * # Find all phrases that we might try to extract
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(Py_None);
+ __pyx_r = Py_None;
+ goto __pyx_L0;
+
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.online_ctx_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_fcount);
+ __Pyx_XDECREF(__pyx_v_fsample_count);
+ __Pyx_XDECREF(__pyx_v_d);
+ __Pyx_XDECREF(__pyx_v_paircount);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_38get_f_phrases(PyObject *__pyx_v_self, PyObject *__pyx_v_f_words); /*proto*/
+static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_38get_f_phrases(PyObject *__pyx_v_self, PyObject *__pyx_v_f_words) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("get_f_phrases (wrapper)", 0);
+ __pyx_r = __pyx_pf_3_sa_23HieroCachingRuleFactory_37get_f_phrases(((struct __pyx_obj_3_sa_HieroCachingRuleFactory *)__pyx_v_self), ((PyObject *)__pyx_v_f_words));
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_13get_f_phrases_1extract(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_3_sa_23HieroCachingRuleFactory_13get_f_phrases_1extract = {__Pyx_NAMESTR("extract"), (PyCFunction)__pyx_pw_3_sa_23HieroCachingRuleFactory_13get_f_phrases_1extract, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
+static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_13get_f_phrases_1extract(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_f_i = 0;
+ PyObject *__pyx_v_f_j = 0;
+ PyObject *__pyx_v_lex_i = 0;
+ PyObject *__pyx_v_lex_j = 0;
+ PyObject *__pyx_v_wc = 0;
+ PyObject *__pyx_v_ntc = 0;
+ PyObject *__pyx_v_syms = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("extract (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__f_i,&__pyx_n_s__f_j,&__pyx_n_s__lex_i,&__pyx_n_s__lex_j,&__pyx_n_s__wc,&__pyx_n_s__ntc,&__pyx_n_s__syms,0};
+ PyObject* values[7] = {0,0,0,0,0,0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
+ case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
+ case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ 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 (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f_i)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f_j)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 2:
+ if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lex_i)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 3:
+ if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lex_j)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 4:
+ if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__wc)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 5:
+ if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ntc)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ case 6:
+ if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__syms)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 6); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "extract") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
+ values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
+ }
+ __pyx_v_f_i = values[0];
+ __pyx_v_f_j = values[1];
+ __pyx_v_lex_i = values[2];
+ __pyx_v_lex_j = values[3];
+ __pyx_v_wc = values[4];
+ __pyx_v_ntc = values[5];
+ __pyx_v_syms = values[6];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.get_f_phrases.extract", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(__pyx_self, __pyx_v_f_i, __pyx_v_f_j, __pyx_v_lex_i, __pyx_v_lex_j, __pyx_v_wc, __pyx_v_ntc, __pyx_v_syms);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2166
+ * phrases = set() # (fphrase, lex_i, lex_j)
+ *
+ * def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms): # <<<<<<<<<<<<<<
+ * # Phrase extraction limits
+ * if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size:
+ */
+
+static PyObject *__pyx_pf_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_3_sa___pyx_scope_struct_26_get_f_phrases *__pyx_cur_scope;
+ struct __pyx_obj_3_sa___pyx_scope_struct_26_get_f_phrases *__pyx_outer_scope;
+ struct __pyx_obj_3_sa_Phrase *__pyx_v_f = NULL;
+ PyObject *__pyx_v_new_lex_i = NULL;
+ PyObject *__pyx_v_new_lex_j = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_t_5;
+ int __pyx_t_6;
+ PyObject *__pyx_t_7 = NULL;
+ int __pyx_t_8;
+ int __pyx_t_9;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("extract", 0);
+ __pyx_outer_scope = (struct __pyx_obj_3_sa___pyx_scope_struct_26_get_f_phrases *) __Pyx_CyFunction_GetClosure(__pyx_self);
+ __pyx_cur_scope = __pyx_outer_scope;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2168
+ * def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms):
+ * # Phrase extraction limits
+ * if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: # <<<<<<<<<<<<<<
+ * return
+ * # Extend with word
+ */
+ if (unlikely(!__pyx_cur_scope->__pyx_v_f_len)) { __Pyx_RaiseClosureNameError("f_len"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_1 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_f_len, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyObject_RichCompare(__pyx_v_f_j, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ if (!__pyx_t_3) {
+ __pyx_t_2 = PyNumber_Subtract(__pyx_v_f_j, __pyx_v_f_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_6 = __pyx_t_5;
+ } else {
+ __pyx_t_6 = __pyx_t_3;
+ }
+ if (__pyx_t_6) {
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2169
+ * # Phrase extraction limits
+ * if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size:
+ * return # <<<<<<<<<<<<<<
+ * # Extend with word
+ * if wc + ntc < self.max_length:
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2171
+ * return
+ * # Extend with word
+ * if wc + ntc < self.max_length: # <<<<<<<<<<<<<<
+ * syms.append(f_words[f_j])
+ * f = Phrase(syms)
+ */
+ __pyx_t_4 = PyNumber_Add(__pyx_v_wc, __pyx_v_ntc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (__pyx_t_6) {
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2172
+ * # Extend with word
+ * if wc + ntc < self.max_length:
+ * syms.append(f_words[f_j]) # <<<<<<<<<<<<<<
+ * f = Phrase(syms)
+ * new_lex_i = min(lex_i, f_j)
+ */
+ if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_f_words, __pyx_v_f_j); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_syms, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2173
+ * if wc + ntc < self.max_length:
+ * syms.append(f_words[f_j])
+ * f = Phrase(syms) # <<<<<<<<<<<<<<
+ * new_lex_i = min(lex_i, f_j)
+ * new_lex_j = max(lex_j, f_j)
+ */
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_v_syms);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_syms);
+ __Pyx_GIVEREF(__pyx_v_syms);
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+ __pyx_v_f = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2174
+ * syms.append(f_words[f_j])
+ * f = Phrase(syms)
+ * new_lex_i = min(lex_i, f_j) # <<<<<<<<<<<<<<
+ * new_lex_j = max(lex_j, f_j)
+ * phrases.add((f, new_lex_i, new_lex_j))
+ */
+ __Pyx_INCREF(__pyx_v_f_j);
+ __pyx_t_1 = __pyx_v_f_j;
+ __Pyx_INCREF(__pyx_v_lex_i);
+ __pyx_t_2 = __pyx_v_lex_i;
+ __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ if (__pyx_t_6) {
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_t_4 = __pyx_t_1;
+ } else {
+ __Pyx_INCREF(__pyx_t_2);
+ __pyx_t_4 = __pyx_t_2;
+ }
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_INCREF(__pyx_t_4);
+ __pyx_v_new_lex_i = __pyx_t_4;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2175
+ * f = Phrase(syms)
+ * new_lex_i = min(lex_i, f_j)
+ * new_lex_j = max(lex_j, f_j) # <<<<<<<<<<<<<<
+ * phrases.add((f, new_lex_i, new_lex_j))
+ * extract(f_i, f_j + 1, new_lex_i, new_lex_j, wc + 1, ntc, syms)
+ */
+ __Pyx_INCREF(__pyx_v_f_j);
+ __pyx_t_4 = __pyx_v_f_j;
+ __Pyx_INCREF(__pyx_v_lex_j);
+ __pyx_t_1 = __pyx_v_lex_j;
+ __pyx_t_7 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ if (__pyx_t_6) {
+ __Pyx_INCREF(__pyx_t_4);
+ __pyx_t_2 = __pyx_t_4;
+ } else {
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_t_2 = __pyx_t_1;
+ }
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_INCREF(__pyx_t_2);
+ __pyx_v_new_lex_j = __pyx_t_2;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2176
+ * new_lex_i = min(lex_i, f_j)
+ * new_lex_j = max(lex_j, f_j)
+ * phrases.add((f, new_lex_i, new_lex_j)) # <<<<<<<<<<<<<<
+ * extract(f_i, f_j + 1, new_lex_i, new_lex_j, wc + 1, ntc, syms)
+ * syms.pop()
+ */
+ if (unlikely(!__pyx_cur_scope->__pyx_v_phrases)) { __Pyx_RaiseClosureNameError("phrases"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_2 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_phrases, __pyx_n_s__add); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_INCREF(((PyObject *)__pyx_v_f));
+ PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_f));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_f));
+ __Pyx_INCREF(__pyx_v_new_lex_i);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_new_lex_i);
+ __Pyx_GIVEREF(__pyx_v_new_lex_i);
+ __Pyx_INCREF(__pyx_v_new_lex_j);
+ PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_new_lex_j);
+ __Pyx_GIVEREF(__pyx_v_new_lex_j);
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_4));
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
+ __pyx_t_4 = 0;
+ __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2177
+ * new_lex_j = max(lex_j, f_j)
+ * phrases.add((f, new_lex_i, new_lex_j))
+ * extract(f_i, f_j + 1, new_lex_i, new_lex_j, wc + 1, ntc, syms) # <<<<<<<<<<<<<<
+ * syms.pop()
+ * # Extend with existing non-terminal
+ */
+ if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_4 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_1 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyTuple_New(7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_v_f_i);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_f_i);
+ __Pyx_GIVEREF(__pyx_v_f_i);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_v_new_lex_i);
+ PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_new_lex_i);
+ __Pyx_GIVEREF(__pyx_v_new_lex_i);
+ __Pyx_INCREF(__pyx_v_new_lex_j);
+ PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_new_lex_j);
+ __Pyx_GIVEREF(__pyx_v_new_lex_j);
+ PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_v_ntc);
+ PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_v_ntc);
+ __Pyx_GIVEREF(__pyx_v_ntc);
+ __Pyx_INCREF(__pyx_v_syms);
+ PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_v_syms);
+ __Pyx_GIVEREF(__pyx_v_syms);
+ __pyx_t_4 = 0;
+ __pyx_t_1 = 0;
+ __pyx_t_1 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2178
+ * phrases.add((f, new_lex_i, new_lex_j))
+ * extract(f_i, f_j + 1, new_lex_i, new_lex_j, wc + 1, ntc, syms)
+ * syms.pop() # <<<<<<<<<<<<<<
+ * # Extend with existing non-terminal
+ * if syms and sym_isvar(syms[-1]):
+ */
+ __pyx_t_1 = __Pyx_PyObject_Pop(__pyx_v_syms); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ goto __pyx_L4;
+ }
+ __pyx_L4:;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2180
+ * syms.pop()
+ * # Extend with existing non-terminal
+ * if syms and sym_isvar(syms[-1]): # <<<<<<<<<<<<<<
+ * # Don't re-extract the same phrase
+ * extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc, syms)
+ */
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_syms); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_6) {
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_syms, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_3 = __pyx_f_3_sa_sym_isvar(__pyx_t_8);
+ } else {
+ __pyx_t_3 = __pyx_t_6;
+ }
+ if (__pyx_t_3) {
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2182
+ * if syms and sym_isvar(syms[-1]):
+ * # Don't re-extract the same phrase
+ * extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc, syms) # <<<<<<<<<<<<<<
+ * # Extend with new non-terminal
+ * if wc + ntc < self.max_length:
+ */
+ if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_1 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyTuple_New(7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_v_f_i);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_f_i);
+ __Pyx_GIVEREF(__pyx_v_f_i);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_v_lex_i);
+ PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_lex_i);
+ __Pyx_GIVEREF(__pyx_v_lex_i);
+ __Pyx_INCREF(__pyx_v_lex_j);
+ PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_lex_j);
+ __Pyx_GIVEREF(__pyx_v_lex_j);
+ __Pyx_INCREF(__pyx_v_wc);
+ PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_wc);
+ __Pyx_GIVEREF(__pyx_v_wc);
+ __Pyx_INCREF(__pyx_v_ntc);
+ PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_v_ntc);
+ __Pyx_GIVEREF(__pyx_v_ntc);
+ __Pyx_INCREF(__pyx_v_syms);
+ PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_v_syms);
+ __Pyx_GIVEREF(__pyx_v_syms);
+ __pyx_t_1 = 0;
+ __pyx_t_1 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2184
+ * extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc, syms)
+ * # Extend with new non-terminal
+ * if wc + ntc < self.max_length: # <<<<<<<<<<<<<<
+ * if not syms or (ntc < self.max_nonterminals and not sym_isvar(syms[-1])):
+ * syms.append(sym_setindex(self.category, ntc + 1))
+ */
+ __pyx_t_1 = PyNumber_Add(__pyx_v_wc, __pyx_v_ntc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (__pyx_t_3) {
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2185
+ * # Extend with new non-terminal
+ * if wc + ntc < self.max_length:
+ * if not syms or (ntc < self.max_nonterminals and not sym_isvar(syms[-1])): # <<<<<<<<<<<<<<
+ * syms.append(sym_setindex(self.category, ntc + 1))
+ * f = Phrase(syms)
+ */
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_syms); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = (!__pyx_t_3);
+ if (!__pyx_t_6) {
+ __pyx_t_4 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_nonterminals); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_2 = PyObject_RichCompare(__pyx_v_ntc, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ if (__pyx_t_3) {
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_syms, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_5 = (!__pyx_f_3_sa_sym_isvar(__pyx_t_8));
+ __pyx_t_9 = __pyx_t_5;
+ } else {
+ __pyx_t_9 = __pyx_t_3;
+ }
+ __pyx_t_3 = __pyx_t_9;
+ } else {
+ __pyx_t_3 = __pyx_t_6;
+ }
+ if (__pyx_t_3) {
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2186
+ * if wc + ntc < self.max_length:
+ * if not syms or (ntc < self.max_nonterminals and not sym_isvar(syms[-1])):
+ * syms.append(sym_setindex(self.category, ntc + 1)) # <<<<<<<<<<<<<<
+ * f = Phrase(syms)
+ * if wc > 0:
+ */
+ __pyx_t_2 = PyNumber_Add(__pyx_v_ntc, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_8)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = __Pyx_PyObject_Append(__pyx_v_syms, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2187
+ * if not syms or (ntc < self.max_nonterminals and not sym_isvar(syms[-1])):
+ * syms.append(sym_setindex(self.category, ntc + 1))
+ * f = Phrase(syms) # <<<<<<<<<<<<<<
+ * if wc > 0:
+ * phrases.add((f, lex_i, lex_j))
+ */
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_v_syms);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_syms);
+ __Pyx_GIVEREF(__pyx_v_syms);
+ __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+ __Pyx_XDECREF(((PyObject *)__pyx_v_f));
+ __pyx_v_f = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2188
+ * syms.append(sym_setindex(self.category, ntc + 1))
+ * f = Phrase(syms)
+ * if wc > 0: # <<<<<<<<<<<<<<
+ * phrases.add((f, lex_i, lex_j))
+ * extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc + 1, syms)
+ */
+ __pyx_t_2 = PyObject_RichCompare(__pyx_v_wc, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ if (__pyx_t_3) {
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2189
+ * f = Phrase(syms)
+ * if wc > 0:
+ * phrases.add((f, lex_i, lex_j)) # <<<<<<<<<<<<<<
+ * extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc + 1, syms)
+ * syms.pop()
+ */
+ if (unlikely(!__pyx_cur_scope->__pyx_v_phrases)) { __Pyx_RaiseClosureNameError("phrases"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_2 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_phrases, __pyx_n_s__add); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_INCREF(((PyObject *)__pyx_v_f));
+ PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_f));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_f));
+ __Pyx_INCREF(__pyx_v_lex_i);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_lex_i);
+ __Pyx_GIVEREF(__pyx_v_lex_i);
+ __Pyx_INCREF(__pyx_v_lex_j);
+ PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_lex_j);
+ __Pyx_GIVEREF(__pyx_v_lex_j);
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_4));
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
+ __pyx_t_4 = 0;
+ __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ goto __pyx_L8;
+ }
+ __pyx_L8:;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2190
+ * if wc > 0:
+ * phrases.add((f, lex_i, lex_j))
+ * extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc + 1, syms) # <<<<<<<<<<<<<<
+ * syms.pop()
+ *
+ */
+ if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_4 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_1 = PyNumber_Add(__pyx_v_ntc, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyTuple_New(7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_v_f_i);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_f_i);
+ __Pyx_GIVEREF(__pyx_v_f_i);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_v_lex_i);
+ PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_lex_i);
+ __Pyx_GIVEREF(__pyx_v_lex_i);
+ __Pyx_INCREF(__pyx_v_lex_j);
+ PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_lex_j);
+ __Pyx_GIVEREF(__pyx_v_lex_j);
+ __Pyx_INCREF(__pyx_v_wc);
+ PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_wc);
+ __Pyx_GIVEREF(__pyx_v_wc);
+ PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_v_syms);
+ PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_v_syms);
+ __Pyx_GIVEREF(__pyx_v_syms);
+ __pyx_t_4 = 0;
+ __pyx_t_1 = 0;
+ __pyx_t_1 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2191
+ * phrases.add((f, lex_i, lex_j))
+ * extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc + 1, syms)
+ * syms.pop() # <<<<<<<<<<<<<<
+ *
+ * # Try to extract phrases from every f index
+ */
+ __pyx_t_1 = __Pyx_PyObject_Pop(__pyx_v_syms); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ goto __pyx_L7;
+ }
+ __pyx_L7:;
+ goto __pyx_L6;
+ }
+ __pyx_L6:;
+
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.get_f_phrases.extract", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_f);
+ __Pyx_XDECREF(__pyx_v_new_lex_i);
+ __Pyx_XDECREF(__pyx_v_new_lex_j);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2161
+ * # (Used for EGivenFCoherent)
+ * # Return set of (fphrase, lex_i, lex_j)
+ * def get_f_phrases(self, f_words): # <<<<<<<<<<<<<<
+ *
+ * f_len = len(f_words)
+ */
+
+static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_37get_f_phrases(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_f_words) {
+ struct __pyx_obj_3_sa___pyx_scope_struct_26_get_f_phrases *__pyx_cur_scope;
+ long __pyx_v_f_i;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ Py_ssize_t __pyx_t_2;
+ long __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("get_f_phrases", 0);
+ __pyx_cur_scope = (struct __pyx_obj_3_sa___pyx_scope_struct_26_get_f_phrases *)__pyx_ptype_3_sa___pyx_scope_struct_26_get_f_phrases->tp_new(__pyx_ptype_3_sa___pyx_scope_struct_26_get_f_phrases, __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_f_words = __pyx_v_f_words;
+ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f_words);
+ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f_words);
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2163
+ * def get_f_phrases(self, f_words):
+ *
+ * f_len = len(f_words) # <<<<<<<<<<<<<<
+ * phrases = set() # (fphrase, lex_i, lex_j)
+ *
+ */
+ __pyx_t_1 = __pyx_cur_scope->__pyx_v_f_words;
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_cur_scope->__pyx_v_f_len = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2164
+ *
+ * f_len = len(f_words)
+ * phrases = set() # (fphrase, lex_i, lex_j) # <<<<<<<<<<<<<<
+ *
+ * def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms):
+ */
+ __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
+ __pyx_cur_scope->__pyx_v_phrases = ((PyObject *)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2166
+ * phrases = set() # (fphrase, lex_i, lex_j)
+ *
+ * def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms): # <<<<<<<<<<<<<<
+ * # Phrase extraction limits
+ * if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size:
+ */
+ __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_13get_f_phrases_1extract, 0, ((PyObject*)__pyx_cur_scope), __pyx_n_s___sa, ((PyObject *)__pyx_k_codeobj_153)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_cur_scope->__pyx_v_extract = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2194
+ *
+ * # Try to extract phrases from every f index
+ * for f_i from 0 <= f_i < f_len: # <<<<<<<<<<<<<<
+ * extract(f_i, f_i, f_len, -1, 0, 0, [])
+ *
+ */
+ __pyx_t_3 = __Pyx_PyInt_AsLong(__pyx_cur_scope->__pyx_v_f_len); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ for (__pyx_v_f_i = 0; __pyx_v_f_i < __pyx_t_3; __pyx_v_f_i++) {
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2195
+ * # Try to extract phrases from every f index
+ * for f_i from 0 <= f_i < f_len:
+ * extract(f_i, f_i, f_len, -1, 0, 0, []) # <<<<<<<<<<<<<<
+ *
+ * return phrases
+ */
+ __pyx_t_1 = PyInt_FromLong(__pyx_v_f_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_4 = PyInt_FromLong(__pyx_v_f_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = PyTuple_New(7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_f_len);
+ PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_cur_scope->__pyx_v_f_len);
+ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f_len);
+ __Pyx_INCREF(__pyx_int_neg_1);
+ PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_int_neg_1);
+ __Pyx_GIVEREF(__pyx_int_neg_1);
+ __Pyx_INCREF(__pyx_int_0);
+ PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_int_0);
+ __Pyx_GIVEREF(__pyx_int_0);
+ __Pyx_INCREF(__pyx_int_0);
+ PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_int_0);
+ __Pyx_GIVEREF(__pyx_int_0);
+ PyTuple_SET_ITEM(__pyx_t_6, 6, ((PyObject *)__pyx_t_5));
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
+ __pyx_t_1 = 0;
+ __pyx_t_4 = 0;
+ __pyx_t_5 = 0;
+ __pyx_t_5 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ }
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2197
+ * extract(f_i, f_i, f_len, -1, 0, 0, [])
+ *
+ * return phrases # <<<<<<<<<<<<<<
+ *
+ * # Spans are _inclusive_ on both ends [i, j]
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_phrases);
+ __pyx_r = __pyx_cur_scope->__pyx_v_phrases;
+ goto __pyx_L0;
+
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("_sa.HieroCachingRuleFactory.get_f_phrases", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3_sa_15span_check(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_3_sa_15span_check = {__Pyx_NAMESTR("span_check"), (PyCFunction)__pyx_pw_3_sa_15span_check, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
+static PyObject *__pyx_pw_3_sa_15span_check(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_vec = 0;
PyObject *__pyx_v_i = 0;
PyObject *__pyx_v_j = 0;
@@ -63439,16 +65658,16 @@ static PyObject *__pyx_pw_3_sa_13span_check(PyObject *__pyx_self, PyObject *__py
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__j)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "span_check") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "span_check") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
@@ -63463,18 +65682,18 @@ static PyObject *__pyx_pw_3_sa_13span_check(PyObject *__pyx_self, PyObject *__py
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.span_check", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_3_sa_12span_check(__pyx_self, __pyx_v_vec, __pyx_v_i, __pyx_v_j);
+ __pyx_r = __pyx_pf_3_sa_14span_check(__pyx_self, __pyx_v_vec, __pyx_v_i, __pyx_v_j);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2088
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2200
*
* # Spans are _inclusive_ on both ends [i, j]
* def span_check(vec, i, j): # <<<<<<<<<<<<<<
@@ -63482,7 +65701,7 @@ static PyObject *__pyx_pw_3_sa_13span_check(PyObject *__pyx_self, PyObject *__py
* while k <= j:
*/
-static PyObject *__pyx_pf_3_sa_12span_check(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vec, PyObject *__pyx_v_i, PyObject *__pyx_v_j) {
+static PyObject *__pyx_pf_3_sa_14span_check(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vec, PyObject *__pyx_v_i, PyObject *__pyx_v_j) {
PyObject *__pyx_v_k = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
@@ -63493,7 +65712,7 @@ static PyObject *__pyx_pf_3_sa_12span_check(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("span_check", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2089
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2201
* # Spans are _inclusive_ on both ends [i, j]
* def span_check(vec, i, j):
* k = i # <<<<<<<<<<<<<<
@@ -63503,7 +65722,7 @@ static PyObject *__pyx_pf_3_sa_12span_check(CYTHON_UNUSED PyObject *__pyx_self,
__Pyx_INCREF(__pyx_v_i);
__pyx_v_k = __pyx_v_i;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2090
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2202
* def span_check(vec, i, j):
* k = i
* while k <= j: # <<<<<<<<<<<<<<
@@ -63511,25 +65730,25 @@ static PyObject *__pyx_pf_3_sa_12span_check(CYTHON_UNUSED PyObject *__pyx_self,
* return False
*/
while (1) {
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!__pyx_t_2) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2091
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2203
* k = i
* while k <= j:
* if vec[k]: # <<<<<<<<<<<<<<
* return False
* k += 1
*/
- __pyx_t_1 = PyObject_GetItem(__pyx_v_vec, __pyx_v_k); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetItem(__pyx_v_vec, __pyx_v_k); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2092
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2204
* while k <= j:
* if vec[k]:
* return False # <<<<<<<<<<<<<<
@@ -63537,7 +65756,7 @@ static PyObject *__pyx_pf_3_sa_12span_check(CYTHON_UNUSED PyObject *__pyx_self,
* return True
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -63546,21 +65765,21 @@ static PyObject *__pyx_pf_3_sa_12span_check(CYTHON_UNUSED PyObject *__pyx_self,
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2093
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2205
* if vec[k]:
* return False
* k += 1 # <<<<<<<<<<<<<<
* return True
*
*/
- __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_k, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_k, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_v_k);
__pyx_v_k = __pyx_t_1;
__pyx_t_1 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2094
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2206
* return False
* k += 1
* return True # <<<<<<<<<<<<<<
@@ -63568,7 +65787,7 @@ static PyObject *__pyx_pf_3_sa_12span_check(CYTHON_UNUSED PyObject *__pyx_self,
* def span_inc(vec, i, j):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -63588,9 +65807,9 @@ static PyObject *__pyx_pf_3_sa_12span_check(CYTHON_UNUSED PyObject *__pyx_self,
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_15span_inc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_3_sa_15span_inc = {__Pyx_NAMESTR("span_inc"), (PyCFunction)__pyx_pw_3_sa_15span_inc, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_3_sa_15span_inc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_3_sa_17span_inc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_3_sa_17span_inc = {__Pyx_NAMESTR("span_inc"), (PyCFunction)__pyx_pw_3_sa_17span_inc, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
+static PyObject *__pyx_pw_3_sa_17span_inc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_vec = 0;
PyObject *__pyx_v_i = 0;
PyObject *__pyx_v_j = 0;
@@ -63618,16 +65837,16 @@ static PyObject *__pyx_pw_3_sa_15span_inc(PyObject *__pyx_self, PyObject *__pyx_
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("span_inc", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("span_inc", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__j)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("span_inc", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("span_inc", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "span_inc") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "span_inc") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
@@ -63642,18 +65861,18 @@ static PyObject *__pyx_pw_3_sa_15span_inc(PyObject *__pyx_self, PyObject *__pyx_
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("span_inc", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("span_inc", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.span_inc", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_3_sa_14span_inc(__pyx_self, __pyx_v_vec, __pyx_v_i, __pyx_v_j);
+ __pyx_r = __pyx_pf_3_sa_16span_inc(__pyx_self, __pyx_v_vec, __pyx_v_i, __pyx_v_j);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2096
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2208
* return True
*
* def span_inc(vec, i, j): # <<<<<<<<<<<<<<
@@ -63661,7 +65880,7 @@ static PyObject *__pyx_pw_3_sa_15span_inc(PyObject *__pyx_self, PyObject *__pyx_
* while k <= j:
*/
-static PyObject *__pyx_pf_3_sa_14span_inc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vec, PyObject *__pyx_v_i, PyObject *__pyx_v_j) {
+static PyObject *__pyx_pf_3_sa_16span_inc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vec, PyObject *__pyx_v_i, PyObject *__pyx_v_j) {
PyObject *__pyx_v_k = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
@@ -63674,7 +65893,7 @@ static PyObject *__pyx_pf_3_sa_14span_inc(CYTHON_UNUSED PyObject *__pyx_self, Py
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("span_inc", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2097
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2209
*
* def span_inc(vec, i, j):
* k = i # <<<<<<<<<<<<<<
@@ -63684,7 +65903,7 @@ static PyObject *__pyx_pf_3_sa_14span_inc(CYTHON_UNUSED PyObject *__pyx_self, Py
__Pyx_INCREF(__pyx_v_i);
__pyx_v_k = __pyx_v_i;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2098
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2210
* def span_inc(vec, i, j):
* k = i
* while k <= j: # <<<<<<<<<<<<<<
@@ -63692,12 +65911,12 @@ static PyObject *__pyx_pf_3_sa_14span_inc(CYTHON_UNUSED PyObject *__pyx_self, Py
* k += 1
*/
while (1) {
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!__pyx_t_2) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2099
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2211
* k = i
* while k <= j:
* vec[k] += 1 # <<<<<<<<<<<<<<
@@ -63706,23 +65925,23 @@ static PyObject *__pyx_pf_3_sa_14span_inc(CYTHON_UNUSED PyObject *__pyx_self, Py
*/
__Pyx_INCREF(__pyx_v_k);
__pyx_t_1 = __pyx_v_k;
- __pyx_t_3 = PyObject_GetItem(__pyx_v_vec, __pyx_t_1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_v_vec, __pyx_t_1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyObject_SetItem(__pyx_v_vec, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_v_vec, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2100
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2212
* while k <= j:
* vec[k] += 1
* k += 1 # <<<<<<<<<<<<<<
*
* def span_dec(vec, i, j):
*/
- __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_k, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_k, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_v_k);
__pyx_v_k = __pyx_t_1;
@@ -63745,9 +65964,9 @@ static PyObject *__pyx_pf_3_sa_14span_inc(CYTHON_UNUSED PyObject *__pyx_self, Py
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_17span_dec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_3_sa_17span_dec = {__Pyx_NAMESTR("span_dec"), (PyCFunction)__pyx_pw_3_sa_17span_dec, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_3_sa_17span_dec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_3_sa_19span_dec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_3_sa_19span_dec = {__Pyx_NAMESTR("span_dec"), (PyCFunction)__pyx_pw_3_sa_19span_dec, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
+static PyObject *__pyx_pw_3_sa_19span_dec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_vec = 0;
PyObject *__pyx_v_i = 0;
PyObject *__pyx_v_j = 0;
@@ -63775,16 +65994,16 @@ static PyObject *__pyx_pw_3_sa_17span_dec(PyObject *__pyx_self, PyObject *__pyx_
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("span_dec", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("span_dec", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__j)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("span_dec", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("span_dec", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "span_dec") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "span_dec") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
@@ -63799,18 +66018,18 @@ static PyObject *__pyx_pw_3_sa_17span_dec(PyObject *__pyx_self, PyObject *__pyx_
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("span_dec", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("span_dec", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.span_dec", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_3_sa_16span_dec(__pyx_self, __pyx_v_vec, __pyx_v_i, __pyx_v_j);
+ __pyx_r = __pyx_pf_3_sa_18span_dec(__pyx_self, __pyx_v_vec, __pyx_v_i, __pyx_v_j);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2102
+/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2214
* k += 1
*
* def span_dec(vec, i, j): # <<<<<<<<<<<<<<
@@ -63818,7 +66037,7 @@ static PyObject *__pyx_pw_3_sa_17span_dec(PyObject *__pyx_self, PyObject *__pyx_
* while k <= j:
*/
-static PyObject *__pyx_pf_3_sa_16span_dec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vec, PyObject *__pyx_v_i, PyObject *__pyx_v_j) {
+static PyObject *__pyx_pf_3_sa_18span_dec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vec, PyObject *__pyx_v_i, PyObject *__pyx_v_j) {
PyObject *__pyx_v_k = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
@@ -63831,7 +66050,7 @@ static PyObject *__pyx_pf_3_sa_16span_dec(CYTHON_UNUSED PyObject *__pyx_self, Py
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("span_dec", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2103
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2215
*
* def span_dec(vec, i, j):
* k = i # <<<<<<<<<<<<<<
@@ -63841,7 +66060,7 @@ static PyObject *__pyx_pf_3_sa_16span_dec(CYTHON_UNUSED PyObject *__pyx_self, Py
__Pyx_INCREF(__pyx_v_i);
__pyx_v_k = __pyx_v_i;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2104
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2216
* def span_dec(vec, i, j):
* k = i
* while k <= j: # <<<<<<<<<<<<<<
@@ -63849,12 +66068,12 @@ static PyObject *__pyx_pf_3_sa_16span_dec(CYTHON_UNUSED PyObject *__pyx_self, Py
* k += 1
*/
while (1) {
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!__pyx_t_2) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2105
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2217
* k = i
* while k <= j:
* vec[k] -= 1 # <<<<<<<<<<<<<<
@@ -63862,21 +66081,21 @@ static PyObject *__pyx_pf_3_sa_16span_dec(CYTHON_UNUSED PyObject *__pyx_self, Py
*/
__Pyx_INCREF(__pyx_v_k);
__pyx_t_1 = __pyx_v_k;
- __pyx_t_3 = PyObject_GetItem(__pyx_v_vec, __pyx_t_1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_v_vec, __pyx_t_1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyObject_SetItem(__pyx_v_vec, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_v_vec, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2106
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2218
* while k <= j:
* vec[k] -= 1
* k += 1 # <<<<<<<<<<<<<<
*/
- __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_k, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_k, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_v_k);
__pyx_v_k = __pyx_t_1;
@@ -64136,14 +66355,14 @@ static PyObject *__pyx_pw_3_sa_13FeatureVector_5__iter__(PyObject *__pyx_v_self)
*/
static PyObject *__pyx_pf_3_sa_13FeatureVector_4__iter__(struct __pyx_obj_3_sa_FeatureVector *__pyx_v_self) {
- struct __pyx_obj_3_sa___pyx_scope_struct_25___iter__ *__pyx_cur_scope;
+ struct __pyx_obj_3_sa___pyx_scope_struct_27___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_3_sa___pyx_scope_struct_25___iter__ *)__pyx_ptype_3_sa___pyx_scope_struct_25___iter__->tp_new(__pyx_ptype_3_sa___pyx_scope_struct_25___iter__, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_3_sa___pyx_scope_struct_27___iter__ *)__pyx_ptype_3_sa___pyx_scope_struct_27___iter__->tp_new(__pyx_ptype_3_sa___pyx_scope_struct_27___iter__, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__Pyx_RefNannyFinishContext();
return NULL;
@@ -64173,7 +66392,7 @@ static PyObject *__pyx_pf_3_sa_13FeatureVector_4__iter__(struct __pyx_obj_3_sa_F
static PyObject *__pyx_gb_3_sa_13FeatureVector_6generator5(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
- struct __pyx_obj_3_sa___pyx_scope_struct_25___iter__ *__pyx_cur_scope = ((struct __pyx_obj_3_sa___pyx_scope_struct_25___iter__ *)__pyx_generator->closure);
+ struct __pyx_obj_3_sa___pyx_scope_struct_27___iter__ *__pyx_cur_scope = ((struct __pyx_obj_3_sa___pyx_scope_struct_27___iter__ *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
int __pyx_t_1;
unsigned int __pyx_t_2;
@@ -64266,7 +66485,7 @@ static PyObject *__pyx_pw_3_sa_13FeatureVector_8__str__(PyObject *__pyx_v_self)
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_gb_3_sa_13FeatureVector_7__str___2generator16(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_3_sa_13FeatureVector_7__str___2generator17(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
/* "/home/m/workspace/cdec/python/src/sa/features.pxi":21
*
@@ -64277,24 +66496,24 @@ static PyObject *__pyx_gb_3_sa_13FeatureVector_7__str___2generator16(__pyx_Gener
*/
static PyObject *__pyx_pf_3_sa_13FeatureVector_7__str___genexpr(PyObject *__pyx_self) {
- struct __pyx_obj_3_sa___pyx_scope_struct_27_genexpr *__pyx_cur_scope;
+ struct __pyx_obj_3_sa___pyx_scope_struct_29_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_3_sa___pyx_scope_struct_27_genexpr *)__pyx_ptype_3_sa___pyx_scope_struct_27_genexpr->tp_new(__pyx_ptype_3_sa___pyx_scope_struct_27_genexpr, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_3_sa___pyx_scope_struct_29_genexpr *)__pyx_ptype_3_sa___pyx_scope_struct_29_genexpr->tp_new(__pyx_ptype_3_sa___pyx_scope_struct_29_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_3_sa___pyx_scope_struct_26___str__ *) __pyx_self;
+ __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_3_sa___pyx_scope_struct_28___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_3_sa_13FeatureVector_7__str___2generator16, (PyObject *) __pyx_cur_scope); 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_3_sa_13FeatureVector_7__str___2generator17, (PyObject *) __pyx_cur_scope); 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;
@@ -64312,9 +66531,9 @@ static PyObject *__pyx_pf_3_sa_13FeatureVector_7__str___genexpr(PyObject *__pyx_
return __pyx_r;
}
-static PyObject *__pyx_gb_3_sa_13FeatureVector_7__str___2generator16(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_3_sa_13FeatureVector_7__str___2generator17(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
- struct __pyx_obj_3_sa___pyx_scope_struct_27_genexpr *__pyx_cur_scope = ((struct __pyx_obj_3_sa___pyx_scope_struct_27_genexpr *)__pyx_generator->closure);
+ struct __pyx_obj_3_sa___pyx_scope_struct_29_genexpr *__pyx_cur_scope = ((struct __pyx_obj_3_sa___pyx_scope_struct_29_genexpr *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
@@ -64371,7 +66590,7 @@ static PyObject *__pyx_gb_3_sa_13FeatureVector_7__str___2generator16(__pyx_Gener
__Pyx_GIVEREF(__pyx_t_4);
__pyx_cur_scope->__pyx_v_feat = __pyx_t_4;
__pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_151), __pyx_cur_scope->__pyx_v_feat); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_154), __pyx_cur_scope->__pyx_v_feat); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
__pyx_r = ((PyObject *)__pyx_t_4);
__pyx_t_4 = 0;
@@ -64416,7 +66635,7 @@ static PyObject *__pyx_gb_3_sa_13FeatureVector_7__str___2generator16(__pyx_Gener
*/
static PyObject *__pyx_pf_3_sa_13FeatureVector_7__str__(struct __pyx_obj_3_sa_FeatureVector *__pyx_v_self) {
- struct __pyx_obj_3_sa___pyx_scope_struct_26___str__ *__pyx_cur_scope;
+ struct __pyx_obj_3_sa___pyx_scope_struct_28___str__ *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
@@ -64426,7 +66645,7 @@ static PyObject *__pyx_pf_3_sa_13FeatureVector_7__str__(struct __pyx_obj_3_sa_Fe
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__str__", 0);
- __pyx_cur_scope = (struct __pyx_obj_3_sa___pyx_scope_struct_26___str__ *)__pyx_ptype_3_sa___pyx_scope_struct_26___str__->tp_new(__pyx_ptype_3_sa___pyx_scope_struct_26___str__, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_3_sa___pyx_scope_struct_28___str__ *)__pyx_ptype_3_sa___pyx_scope_struct_28___str__->tp_new(__pyx_ptype_3_sa___pyx_scope_struct_28___str__, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__Pyx_RefNannyFinishContext();
return NULL;
@@ -69717,6 +71936,7 @@ static PyObject *__pyx_tp_new_3_sa_HieroCachingRuleFactory(PyTypeObject *t, PyOb
p->fid2symid = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None);
p->findexes = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None);
p->findexes1 = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None);
+ p->samples_f = Py_None; Py_INCREF(Py_None);
p->phrases_f = Py_None; Py_INCREF(Py_None);
p->phrases_e = Py_None; Py_INCREF(Py_None);
p->phrases_fe = Py_None; Py_INCREF(Py_None);
@@ -69748,6 +71968,7 @@ static void __pyx_tp_dealloc_3_sa_HieroCachingRuleFactory(PyObject *o) {
Py_CLEAR(p->fid2symid);
Py_CLEAR(p->findexes);
Py_CLEAR(p->findexes1);
+ Py_CLEAR(p->samples_f);
Py_CLEAR(p->phrases_f);
Py_CLEAR(p->phrases_e);
Py_CLEAR(p->phrases_fe);
@@ -69809,6 +72030,9 @@ static int __pyx_tp_traverse_3_sa_HieroCachingRuleFactory(PyObject *o, visitproc
if (p->findexes1) {
e = (*v)(((PyObject*)p->findexes1), a); if (e) return e;
}
+ if (p->samples_f) {
+ e = (*v)(p->samples_f, a); if (e) return e;
+ }
if (p->phrases_f) {
e = (*v)(p->phrases_f, a); if (e) return e;
}
@@ -69884,6 +72108,9 @@ static int __pyx_tp_clear_3_sa_HieroCachingRuleFactory(PyObject *o) {
tmp = ((PyObject*)p->findexes1);
p->findexes1 = ((struct __pyx_obj_3_sa_IntList *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->samples_f);
+ p->samples_f = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
tmp = ((PyObject*)p->phrases_f);
p->phrases_f = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
@@ -69924,6 +72151,9 @@ static PyMethodDef __pyx_methods_3_sa_HieroCachingRuleFactory[] = {
{__Pyx_NAMESTR("form_rule"), (PyCFunction)__pyx_pw_3_sa_23HieroCachingRuleFactory_28form_rule, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
{__Pyx_NAMESTR("fmt_rule"), (PyCFunction)__pyx_pw_3_sa_23HieroCachingRuleFactory_30fmt_rule, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
{__Pyx_NAMESTR("dump_online_stats"), (PyCFunction)__pyx_pw_3_sa_23HieroCachingRuleFactory_32dump_online_stats, METH_NOARGS, __Pyx_DOCSTR(0)},
+ {__Pyx_NAMESTR("dump_online_rules"), (PyCFunction)__pyx_pw_3_sa_23HieroCachingRuleFactory_34dump_online_rules, METH_NOARGS, __Pyx_DOCSTR(0)},
+ {__Pyx_NAMESTR("online_ctx_lookup"), (PyCFunction)__pyx_pw_3_sa_23HieroCachingRuleFactory_36online_ctx_lookup, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
+ {__Pyx_NAMESTR("get_f_phrases"), (PyCFunction)__pyx_pw_3_sa_23HieroCachingRuleFactory_38get_f_phrases, METH_O, __Pyx_DOCSTR(0)},
{0, 0, 0, 0}
};
@@ -74168,15 +76398,19 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_19_input(PyTypeObject *t,
p->__pyx_v_extract_stop = 0;
p->__pyx_v_extracts = 0;
p->__pyx_v_f = 0;
+ p->__pyx_v_f_syms = 0;
p->__pyx_v_fcount = 0;
p->__pyx_v_fphrases = 0;
p->__pyx_v_frontier = 0;
p->__pyx_v_frontier_nodes = 0;
p->__pyx_v_fwords = 0;
+ p->__pyx_v_genexpr = 0;
p->__pyx_v_hiero_phrase = 0;
p->__pyx_v_input_match = 0;
p->__pyx_v_is_shadow_path = 0;
p->__pyx_v_key = 0;
+ p->__pyx_v_lex_i = 0;
+ p->__pyx_v_lex_j = 0;
p->__pyx_v_loc = 0;
p->__pyx_v_locs = 0;
p->__pyx_v_max_locs = 0;
@@ -74194,6 +76428,7 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_19_input(PyTypeObject *t,
p->__pyx_v_sa_range = 0;
p->__pyx_v_sample = 0;
p->__pyx_v_scores = 0;
+ p->__pyx_v_seen_phrases = 0;
p->__pyx_v_self = 0;
p->__pyx_v_spanlen = 0;
p->__pyx_v_stop_time = 0;
@@ -74223,15 +76458,19 @@ static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_19_input(PyObject *o) {
Py_CLEAR(p->__pyx_v_extract_stop);
Py_CLEAR(p->__pyx_v_extracts);
Py_CLEAR(p->__pyx_v_f);
+ Py_CLEAR(p->__pyx_v_f_syms);
Py_CLEAR(p->__pyx_v_fcount);
Py_CLEAR(p->__pyx_v_fphrases);
Py_CLEAR(p->__pyx_v_frontier);
Py_CLEAR(p->__pyx_v_frontier_nodes);
Py_CLEAR(p->__pyx_v_fwords);
+ Py_CLEAR(p->__pyx_v_genexpr);
Py_CLEAR(p->__pyx_v_hiero_phrase);
Py_CLEAR(p->__pyx_v_input_match);
Py_CLEAR(p->__pyx_v_is_shadow_path);
Py_CLEAR(p->__pyx_v_key);
+ Py_CLEAR(p->__pyx_v_lex_i);
+ Py_CLEAR(p->__pyx_v_lex_j);
Py_CLEAR(p->__pyx_v_loc);
Py_CLEAR(p->__pyx_v_locs);
Py_CLEAR(p->__pyx_v_max_locs);
@@ -74249,6 +76488,7 @@ static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_19_input(PyObject *o) {
Py_CLEAR(p->__pyx_v_sa_range);
Py_CLEAR(p->__pyx_v_sample);
Py_CLEAR(p->__pyx_v_scores);
+ Py_CLEAR(p->__pyx_v_seen_phrases);
Py_CLEAR(p->__pyx_v_self);
Py_CLEAR(p->__pyx_v_spanlen);
Py_CLEAR(p->__pyx_v_stop_time);
@@ -74303,6 +76543,9 @@ static int __pyx_tp_traverse_3_sa___pyx_scope_struct_19_input(PyObject *o, visit
if (p->__pyx_v_f) {
e = (*v)(p->__pyx_v_f, a); if (e) return e;
}
+ if (p->__pyx_v_f_syms) {
+ e = (*v)(p->__pyx_v_f_syms, a); if (e) return e;
+ }
if (p->__pyx_v_fcount) {
e = (*v)(p->__pyx_v_fcount, a); if (e) return e;
}
@@ -74318,6 +76561,9 @@ static int __pyx_tp_traverse_3_sa___pyx_scope_struct_19_input(PyObject *o, visit
if (p->__pyx_v_fwords) {
e = (*v)(p->__pyx_v_fwords, a); if (e) return e;
}
+ if (p->__pyx_v_genexpr) {
+ e = (*v)(p->__pyx_v_genexpr, a); if (e) return e;
+ }
if (p->__pyx_v_hiero_phrase) {
e = (*v)(((PyObject*)p->__pyx_v_hiero_phrase), a); if (e) return e;
}
@@ -74330,6 +76576,12 @@ static int __pyx_tp_traverse_3_sa___pyx_scope_struct_19_input(PyObject *o, visit
if (p->__pyx_v_key) {
e = (*v)(p->__pyx_v_key, a); if (e) return e;
}
+ if (p->__pyx_v_lex_i) {
+ e = (*v)(p->__pyx_v_lex_i, a); if (e) return e;
+ }
+ if (p->__pyx_v_lex_j) {
+ e = (*v)(p->__pyx_v_lex_j, a); if (e) return e;
+ }
if (p->__pyx_v_loc) {
e = (*v)(p->__pyx_v_loc, a); if (e) return e;
}
@@ -74381,6 +76633,9 @@ static int __pyx_tp_traverse_3_sa___pyx_scope_struct_19_input(PyObject *o, visit
if (p->__pyx_v_scores) {
e = (*v)(((PyObject*)p->__pyx_v_scores), a); if (e) return e;
}
+ if (p->__pyx_v_seen_phrases) {
+ e = (*v)(p->__pyx_v_seen_phrases, a); if (e) return e;
+ }
if (p->__pyx_v_self) {
e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
}
@@ -74459,6 +76714,9 @@ static int __pyx_tp_clear_3_sa___pyx_scope_struct_19_input(PyObject *o) {
tmp = ((PyObject*)p->__pyx_v_f);
p->__pyx_v_f = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_v_f_syms);
+ p->__pyx_v_f_syms = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
tmp = ((PyObject*)p->__pyx_v_fcount);
p->__pyx_v_fcount = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
@@ -74474,6 +76732,9 @@ static int __pyx_tp_clear_3_sa___pyx_scope_struct_19_input(PyObject *o) {
tmp = ((PyObject*)p->__pyx_v_fwords);
p->__pyx_v_fwords = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_v_genexpr);
+ p->__pyx_v_genexpr = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
tmp = ((PyObject*)p->__pyx_v_hiero_phrase);
p->__pyx_v_hiero_phrase = ((struct __pyx_obj_3_sa_Phrase *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
@@ -74486,6 +76747,12 @@ static int __pyx_tp_clear_3_sa___pyx_scope_struct_19_input(PyObject *o) {
tmp = ((PyObject*)p->__pyx_v_key);
p->__pyx_v_key = ((PyObject*)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_v_lex_i);
+ p->__pyx_v_lex_i = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_v_lex_j);
+ p->__pyx_v_lex_j = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
tmp = ((PyObject*)p->__pyx_v_loc);
p->__pyx_v_loc = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
@@ -74537,6 +76804,9 @@ static int __pyx_tp_clear_3_sa___pyx_scope_struct_19_input(PyObject *o) {
tmp = ((PyObject*)p->__pyx_v_scores);
p->__pyx_v_scores = ((struct __pyx_obj_3_sa_FeatureVector *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_v_seen_phrases);
+ p->__pyx_v_seen_phrases = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
tmp = ((PyObject*)p->__pyx_v_self);
p->__pyx_v_self = ((struct __pyx_obj_3_sa_HieroCachingRuleFactory *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
@@ -74734,11 +77004,218 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_19_input = {
#endif
};
-static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_20_add_instance(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- struct __pyx_obj_3_sa___pyx_scope_struct_20_add_instance *p;
+static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_20_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_obj_3_sa___pyx_scope_struct_20_genexpr *p;
+ PyObject *o = (*t->tp_alloc)(t, 0);
+ if (!o) return 0;
+ p = ((struct __pyx_obj_3_sa___pyx_scope_struct_20_genexpr *)o);
+ p->__pyx_outer_scope = 0;
+ p->__pyx_v_word = 0;
+ p->__pyx_t_0 = 0;
+ return o;
+}
+
+static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_20_genexpr(PyObject *o) {
+ struct __pyx_obj_3_sa___pyx_scope_struct_20_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_20_genexpr *)o;
+ Py_CLEAR(p->__pyx_outer_scope);
+ Py_CLEAR(p->__pyx_v_word);
+ Py_CLEAR(p->__pyx_t_0);
+ (*Py_TYPE(o)->tp_free)(o);
+}
+
+static int __pyx_tp_traverse_3_sa___pyx_scope_struct_20_genexpr(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_obj_3_sa___pyx_scope_struct_20_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_20_genexpr *)o;
+ if (p->__pyx_outer_scope) {
+ e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
+ }
+ if (p->__pyx_v_word) {
+ e = (*v)(p->__pyx_v_word, a); if (e) return e;
+ }
+ if (p->__pyx_t_0) {
+ e = (*v)(p->__pyx_t_0, a); if (e) return e;
+ }
+ return 0;
+}
+
+static int __pyx_tp_clear_3_sa___pyx_scope_struct_20_genexpr(PyObject *o) {
+ struct __pyx_obj_3_sa___pyx_scope_struct_20_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_20_genexpr *)o;
+ PyObject* tmp;
+ tmp = ((PyObject*)p->__pyx_outer_scope);
+ p->__pyx_outer_scope = ((struct __pyx_obj_3_sa___pyx_scope_struct_19_input *)Py_None); Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_v_word);
+ p->__pyx_v_word = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_t_0);
+ p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ return 0;
+}
+
+static PyMethodDef __pyx_methods_3_sa___pyx_scope_struct_20_genexpr[] = {
+ {0, 0, 0, 0}
+};
+
+static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_20_genexpr = {
+ 0, /*nb_add*/
+ 0, /*nb_subtract*/
+ 0, /*nb_multiply*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*nb_divide*/
+ #endif
+ 0, /*nb_remainder*/
+ 0, /*nb_divmod*/
+ 0, /*nb_power*/
+ 0, /*nb_negative*/
+ 0, /*nb_positive*/
+ 0, /*nb_absolute*/
+ 0, /*nb_nonzero*/
+ 0, /*nb_invert*/
+ 0, /*nb_lshift*/
+ 0, /*nb_rshift*/
+ 0, /*nb_and*/
+ 0, /*nb_xor*/
+ 0, /*nb_or*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*nb_coerce*/
+ #endif
+ 0, /*nb_int*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*nb_long*/
+ #else
+ 0, /*reserved*/
+ #endif
+ 0, /*nb_float*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*nb_oct*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*nb_hex*/
+ #endif
+ 0, /*nb_inplace_add*/
+ 0, /*nb_inplace_subtract*/
+ 0, /*nb_inplace_multiply*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*nb_inplace_divide*/
+ #endif
+ 0, /*nb_inplace_remainder*/
+ 0, /*nb_inplace_power*/
+ 0, /*nb_inplace_lshift*/
+ 0, /*nb_inplace_rshift*/
+ 0, /*nb_inplace_and*/
+ 0, /*nb_inplace_xor*/
+ 0, /*nb_inplace_or*/
+ 0, /*nb_floor_divide*/
+ 0, /*nb_true_divide*/
+ 0, /*nb_inplace_floor_divide*/
+ 0, /*nb_inplace_true_divide*/
+ #if PY_VERSION_HEX >= 0x02050000
+ 0, /*nb_index*/
+ #endif
+};
+
+static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_20_genexpr = {
+ 0, /*sq_length*/
+ 0, /*sq_concat*/
+ 0, /*sq_repeat*/
+ 0, /*sq_item*/
+ 0, /*sq_slice*/
+ 0, /*sq_ass_item*/
+ 0, /*sq_ass_slice*/
+ 0, /*sq_contains*/
+ 0, /*sq_inplace_concat*/
+ 0, /*sq_inplace_repeat*/
+};
+
+static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_20_genexpr = {
+ 0, /*mp_length*/
+ 0, /*mp_subscript*/
+ 0, /*mp_ass_subscript*/
+};
+
+static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_20_genexpr = {
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getreadbuffer*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getwritebuffer*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getsegcount*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getcharbuffer*/
+ #endif
+ #if PY_VERSION_HEX >= 0x02060000
+ 0, /*bf_getbuffer*/
+ #endif
+ #if PY_VERSION_HEX >= 0x02060000
+ 0, /*bf_releasebuffer*/
+ #endif
+};
+
+static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_20_genexpr = {
+ PyVarObject_HEAD_INIT(0, 0)
+ __Pyx_NAMESTR("_sa.__pyx_scope_struct_20_genexpr"), /*tp_name*/
+ sizeof(struct __pyx_obj_3_sa___pyx_scope_struct_20_genexpr), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_3_sa___pyx_scope_struct_20_genexpr, /*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*/
+ &__pyx_tp_as_number___pyx_scope_struct_20_genexpr, /*tp_as_number*/
+ &__pyx_tp_as_sequence___pyx_scope_struct_20_genexpr, /*tp_as_sequence*/
+ &__pyx_tp_as_mapping___pyx_scope_struct_20_genexpr, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ &__pyx_tp_as_buffer___pyx_scope_struct_20_genexpr, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ 0, /*tp_doc*/
+ __pyx_tp_traverse_3_sa___pyx_scope_struct_20_genexpr, /*tp_traverse*/
+ __pyx_tp_clear_3_sa___pyx_scope_struct_20_genexpr, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_3_sa___pyx_scope_struct_20_genexpr, /*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_3_sa___pyx_scope_struct_20_genexpr, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ #if PY_VERSION_HEX >= 0x02060000
+ 0, /*tp_version_tag*/
+ #endif
+};
+
+static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_21_add_instance(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_obj_3_sa___pyx_scope_struct_21_add_instance *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
- p = ((struct __pyx_obj_3_sa___pyx_scope_struct_20_add_instance *)o);
+ p = ((struct __pyx_obj_3_sa___pyx_scope_struct_21_add_instance *)o);
p->__pyx_v_al = 0;
p->__pyx_v_cover = 0;
p->__pyx_v_e_nt_cover = 0;
@@ -74753,8 +77230,8 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_20_add_instance(PyTypeObje
return o;
}
-static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_20_add_instance(PyObject *o) {
- struct __pyx_obj_3_sa___pyx_scope_struct_20_add_instance *p = (struct __pyx_obj_3_sa___pyx_scope_struct_20_add_instance *)o;
+static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_21_add_instance(PyObject *o) {
+ struct __pyx_obj_3_sa___pyx_scope_struct_21_add_instance *p = (struct __pyx_obj_3_sa___pyx_scope_struct_21_add_instance *)o;
Py_CLEAR(p->__pyx_v_al);
Py_CLEAR(p->__pyx_v_cover);
Py_CLEAR(p->__pyx_v_e_nt_cover);
@@ -74769,9 +77246,9 @@ static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_20_add_instance(PyObject *o
(*Py_TYPE(o)->tp_free)(o);
}
-static int __pyx_tp_traverse_3_sa___pyx_scope_struct_20_add_instance(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_3_sa___pyx_scope_struct_21_add_instance(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_3_sa___pyx_scope_struct_20_add_instance *p = (struct __pyx_obj_3_sa___pyx_scope_struct_20_add_instance *)o;
+ struct __pyx_obj_3_sa___pyx_scope_struct_21_add_instance *p = (struct __pyx_obj_3_sa___pyx_scope_struct_21_add_instance *)o;
if (p->__pyx_v_al) {
e = (*v)(p->__pyx_v_al, a); if (e) return e;
}
@@ -74808,8 +77285,8 @@ static int __pyx_tp_traverse_3_sa___pyx_scope_struct_20_add_instance(PyObject *o
return 0;
}
-static int __pyx_tp_clear_3_sa___pyx_scope_struct_20_add_instance(PyObject *o) {
- struct __pyx_obj_3_sa___pyx_scope_struct_20_add_instance *p = (struct __pyx_obj_3_sa___pyx_scope_struct_20_add_instance *)o;
+static int __pyx_tp_clear_3_sa___pyx_scope_struct_21_add_instance(PyObject *o) {
+ struct __pyx_obj_3_sa___pyx_scope_struct_21_add_instance *p = (struct __pyx_obj_3_sa___pyx_scope_struct_21_add_instance *)o;
PyObject* tmp;
tmp = ((PyObject*)p->__pyx_v_al);
p->__pyx_v_al = Py_None; Py_INCREF(Py_None);
@@ -74847,11 +77324,11 @@ static int __pyx_tp_clear_3_sa___pyx_scope_struct_20_add_instance(PyObject *o) {
return 0;
}
-static PyMethodDef __pyx_methods_3_sa___pyx_scope_struct_20_add_instance[] = {
+static PyMethodDef __pyx_methods_3_sa___pyx_scope_struct_21_add_instance[] = {
{0, 0, 0, 0}
};
-static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_20_add_instance = {
+static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_21_add_instance = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
@@ -74909,7 +77386,7 @@ static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_20_add_instance = {
#endif
};
-static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_20_add_instance = {
+static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_21_add_instance = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
@@ -74922,13 +77399,13 @@ static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_20_add_instance
0, /*sq_inplace_repeat*/
};
-static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_20_add_instance = {
+static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_21_add_instance = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};
-static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_20_add_instance = {
+static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_21_add_instance = {
#if PY_MAJOR_VERSION < 3
0, /*bf_getreadbuffer*/
#endif
@@ -74949,12 +77426,12 @@ static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_20_add_instance = {
#endif
};
-static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_20_add_instance = {
+static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_21_add_instance = {
PyVarObject_HEAD_INIT(0, 0)
- __Pyx_NAMESTR("_sa.__pyx_scope_struct_20_add_instance"), /*tp_name*/
- sizeof(struct __pyx_obj_3_sa___pyx_scope_struct_20_add_instance), /*tp_basicsize*/
+ __Pyx_NAMESTR("_sa.__pyx_scope_struct_21_add_instance"), /*tp_name*/
+ sizeof(struct __pyx_obj_3_sa___pyx_scope_struct_21_add_instance), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_3_sa___pyx_scope_struct_20_add_instance, /*tp_dealloc*/
+ __pyx_tp_dealloc_3_sa___pyx_scope_struct_21_add_instance, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
@@ -74964,24 +77441,24 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_20_add_instance = {
0, /*reserved*/
#endif
0, /*tp_repr*/
- &__pyx_tp_as_number___pyx_scope_struct_20_add_instance, /*tp_as_number*/
- &__pyx_tp_as_sequence___pyx_scope_struct_20_add_instance, /*tp_as_sequence*/
- &__pyx_tp_as_mapping___pyx_scope_struct_20_add_instance, /*tp_as_mapping*/
+ &__pyx_tp_as_number___pyx_scope_struct_21_add_instance, /*tp_as_number*/
+ &__pyx_tp_as_sequence___pyx_scope_struct_21_add_instance, /*tp_as_sequence*/
+ &__pyx_tp_as_mapping___pyx_scope_struct_21_add_instance, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
- &__pyx_tp_as_buffer___pyx_scope_struct_20_add_instance, /*tp_as_buffer*/
+ &__pyx_tp_as_buffer___pyx_scope_struct_21_add_instance, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_3_sa___pyx_scope_struct_20_add_instance, /*tp_traverse*/
- __pyx_tp_clear_3_sa___pyx_scope_struct_20_add_instance, /*tp_clear*/
+ __pyx_tp_traverse_3_sa___pyx_scope_struct_21_add_instance, /*tp_traverse*/
+ __pyx_tp_clear_3_sa___pyx_scope_struct_21_add_instance, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
- __pyx_methods_3_sa___pyx_scope_struct_20_add_instance, /*tp_methods*/
+ __pyx_methods_3_sa___pyx_scope_struct_21_add_instance, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
@@ -74991,7 +77468,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_20_add_instance = {
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_3_sa___pyx_scope_struct_20_add_instance, /*tp_new*/
+ __pyx_tp_new_3_sa___pyx_scope_struct_21_add_instance, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -75005,26 +77482,26 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_20_add_instance = {
#endif
};
-static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_21_form_rule(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- struct __pyx_obj_3_sa___pyx_scope_struct_21_form_rule *p;
+static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_22_form_rule(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_obj_3_sa___pyx_scope_struct_22_form_rule *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
- p = ((struct __pyx_obj_3_sa___pyx_scope_struct_21_form_rule *)o);
+ p = ((struct __pyx_obj_3_sa___pyx_scope_struct_22_form_rule *)o);
p->__pyx_v_links = 0;
p->__pyx_v_self = 0;
return o;
}
-static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_21_form_rule(PyObject *o) {
- struct __pyx_obj_3_sa___pyx_scope_struct_21_form_rule *p = (struct __pyx_obj_3_sa___pyx_scope_struct_21_form_rule *)o;
+static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_22_form_rule(PyObject *o) {
+ struct __pyx_obj_3_sa___pyx_scope_struct_22_form_rule *p = (struct __pyx_obj_3_sa___pyx_scope_struct_22_form_rule *)o;
Py_CLEAR(p->__pyx_v_links);
Py_CLEAR(p->__pyx_v_self);
(*Py_TYPE(o)->tp_free)(o);
}
-static int __pyx_tp_traverse_3_sa___pyx_scope_struct_21_form_rule(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_3_sa___pyx_scope_struct_22_form_rule(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_3_sa___pyx_scope_struct_21_form_rule *p = (struct __pyx_obj_3_sa___pyx_scope_struct_21_form_rule *)o;
+ struct __pyx_obj_3_sa___pyx_scope_struct_22_form_rule *p = (struct __pyx_obj_3_sa___pyx_scope_struct_22_form_rule *)o;
if (p->__pyx_v_links) {
e = (*v)(p->__pyx_v_links, a); if (e) return e;
}
@@ -75034,8 +77511,8 @@ static int __pyx_tp_traverse_3_sa___pyx_scope_struct_21_form_rule(PyObject *o, v
return 0;
}
-static int __pyx_tp_clear_3_sa___pyx_scope_struct_21_form_rule(PyObject *o) {
- struct __pyx_obj_3_sa___pyx_scope_struct_21_form_rule *p = (struct __pyx_obj_3_sa___pyx_scope_struct_21_form_rule *)o;
+static int __pyx_tp_clear_3_sa___pyx_scope_struct_22_form_rule(PyObject *o) {
+ struct __pyx_obj_3_sa___pyx_scope_struct_22_form_rule *p = (struct __pyx_obj_3_sa___pyx_scope_struct_22_form_rule *)o;
PyObject* tmp;
tmp = ((PyObject*)p->__pyx_v_links);
p->__pyx_v_links = Py_None; Py_INCREF(Py_None);
@@ -75046,11 +77523,11 @@ static int __pyx_tp_clear_3_sa___pyx_scope_struct_21_form_rule(PyObject *o) {
return 0;
}
-static PyMethodDef __pyx_methods_3_sa___pyx_scope_struct_21_form_rule[] = {
+static PyMethodDef __pyx_methods_3_sa___pyx_scope_struct_22_form_rule[] = {
{0, 0, 0, 0}
};
-static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_21_form_rule = {
+static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_22_form_rule = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
@@ -75108,7 +77585,7 @@ static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_21_form_rule = {
#endif
};
-static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_21_form_rule = {
+static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_22_form_rule = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
@@ -75121,13 +77598,13 @@ static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_21_form_rule =
0, /*sq_inplace_repeat*/
};
-static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_21_form_rule = {
+static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_22_form_rule = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};
-static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_21_form_rule = {
+static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_22_form_rule = {
#if PY_MAJOR_VERSION < 3
0, /*bf_getreadbuffer*/
#endif
@@ -75148,12 +77625,12 @@ static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_21_form_rule = {
#endif
};
-static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_21_form_rule = {
+static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_22_form_rule = {
PyVarObject_HEAD_INIT(0, 0)
- __Pyx_NAMESTR("_sa.__pyx_scope_struct_21_form_rule"), /*tp_name*/
- sizeof(struct __pyx_obj_3_sa___pyx_scope_struct_21_form_rule), /*tp_basicsize*/
+ __Pyx_NAMESTR("_sa.__pyx_scope_struct_22_form_rule"), /*tp_name*/
+ sizeof(struct __pyx_obj_3_sa___pyx_scope_struct_22_form_rule), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_3_sa___pyx_scope_struct_21_form_rule, /*tp_dealloc*/
+ __pyx_tp_dealloc_3_sa___pyx_scope_struct_22_form_rule, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
@@ -75163,24 +77640,24 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_21_form_rule = {
0, /*reserved*/
#endif
0, /*tp_repr*/
- &__pyx_tp_as_number___pyx_scope_struct_21_form_rule, /*tp_as_number*/
- &__pyx_tp_as_sequence___pyx_scope_struct_21_form_rule, /*tp_as_sequence*/
- &__pyx_tp_as_mapping___pyx_scope_struct_21_form_rule, /*tp_as_mapping*/
+ &__pyx_tp_as_number___pyx_scope_struct_22_form_rule, /*tp_as_number*/
+ &__pyx_tp_as_sequence___pyx_scope_struct_22_form_rule, /*tp_as_sequence*/
+ &__pyx_tp_as_mapping___pyx_scope_struct_22_form_rule, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
- &__pyx_tp_as_buffer___pyx_scope_struct_21_form_rule, /*tp_as_buffer*/
+ &__pyx_tp_as_buffer___pyx_scope_struct_22_form_rule, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_3_sa___pyx_scope_struct_21_form_rule, /*tp_traverse*/
- __pyx_tp_clear_3_sa___pyx_scope_struct_21_form_rule, /*tp_clear*/
+ __pyx_tp_traverse_3_sa___pyx_scope_struct_22_form_rule, /*tp_traverse*/
+ __pyx_tp_clear_3_sa___pyx_scope_struct_22_form_rule, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
- __pyx_methods_3_sa___pyx_scope_struct_21_form_rule, /*tp_methods*/
+ __pyx_methods_3_sa___pyx_scope_struct_22_form_rule, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
@@ -75190,7 +77667,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_21_form_rule = {
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_3_sa___pyx_scope_struct_21_form_rule, /*tp_new*/
+ __pyx_tp_new_3_sa___pyx_scope_struct_22_form_rule, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -75204,11 +77681,11 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_21_form_rule = {
#endif
};
-static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_22_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- struct __pyx_obj_3_sa___pyx_scope_struct_22_genexpr *p;
+static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_23_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_obj_3_sa___pyx_scope_struct_23_genexpr *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
- p = ((struct __pyx_obj_3_sa___pyx_scope_struct_22_genexpr *)o);
+ p = ((struct __pyx_obj_3_sa___pyx_scope_struct_23_genexpr *)o);
p->__pyx_outer_scope = 0;
p->__pyx_v_i = 0;
p->__pyx_v_j = 0;
@@ -75216,8 +77693,8 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_22_genexpr(PyTypeObject *t
return o;
}
-static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_22_genexpr(PyObject *o) {
- struct __pyx_obj_3_sa___pyx_scope_struct_22_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_22_genexpr *)o;
+static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_23_genexpr(PyObject *o) {
+ struct __pyx_obj_3_sa___pyx_scope_struct_23_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_23_genexpr *)o;
Py_CLEAR(p->__pyx_outer_scope);
Py_CLEAR(p->__pyx_v_i);
Py_CLEAR(p->__pyx_v_j);
@@ -75225,9 +77702,9 @@ static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_22_genexpr(PyObject *o) {
(*Py_TYPE(o)->tp_free)(o);
}
-static int __pyx_tp_traverse_3_sa___pyx_scope_struct_22_genexpr(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_3_sa___pyx_scope_struct_23_genexpr(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_3_sa___pyx_scope_struct_22_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_22_genexpr *)o;
+ struct __pyx_obj_3_sa___pyx_scope_struct_23_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_23_genexpr *)o;
if (p->__pyx_outer_scope) {
e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
}
@@ -75243,11 +77720,11 @@ static int __pyx_tp_traverse_3_sa___pyx_scope_struct_22_genexpr(PyObject *o, vis
return 0;
}
-static int __pyx_tp_clear_3_sa___pyx_scope_struct_22_genexpr(PyObject *o) {
- struct __pyx_obj_3_sa___pyx_scope_struct_22_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_22_genexpr *)o;
+static int __pyx_tp_clear_3_sa___pyx_scope_struct_23_genexpr(PyObject *o) {
+ struct __pyx_obj_3_sa___pyx_scope_struct_23_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_23_genexpr *)o;
PyObject* tmp;
tmp = ((PyObject*)p->__pyx_outer_scope);
- p->__pyx_outer_scope = ((struct __pyx_obj_3_sa___pyx_scope_struct_21_form_rule *)Py_None); Py_INCREF(Py_None);
+ p->__pyx_outer_scope = ((struct __pyx_obj_3_sa___pyx_scope_struct_22_form_rule *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
tmp = ((PyObject*)p->__pyx_v_i);
p->__pyx_v_i = Py_None; Py_INCREF(Py_None);
@@ -75261,11 +77738,11 @@ static int __pyx_tp_clear_3_sa___pyx_scope_struct_22_genexpr(PyObject *o) {
return 0;
}
-static PyMethodDef __pyx_methods_3_sa___pyx_scope_struct_22_genexpr[] = {
+static PyMethodDef __pyx_methods_3_sa___pyx_scope_struct_23_genexpr[] = {
{0, 0, 0, 0}
};
-static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_22_genexpr = {
+static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_23_genexpr = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
@@ -75323,7 +77800,7 @@ static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_22_genexpr = {
#endif
};
-static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_22_genexpr = {
+static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_23_genexpr = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
@@ -75336,13 +77813,13 @@ static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_22_genexpr = {
0, /*sq_inplace_repeat*/
};
-static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_22_genexpr = {
+static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_23_genexpr = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};
-static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_22_genexpr = {
+static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_23_genexpr = {
#if PY_MAJOR_VERSION < 3
0, /*bf_getreadbuffer*/
#endif
@@ -75363,12 +77840,12 @@ static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_22_genexpr = {
#endif
};
-static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_22_genexpr = {
+static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_23_genexpr = {
PyVarObject_HEAD_INIT(0, 0)
- __Pyx_NAMESTR("_sa.__pyx_scope_struct_22_genexpr"), /*tp_name*/
- sizeof(struct __pyx_obj_3_sa___pyx_scope_struct_22_genexpr), /*tp_basicsize*/
+ __Pyx_NAMESTR("_sa.__pyx_scope_struct_23_genexpr"), /*tp_name*/
+ sizeof(struct __pyx_obj_3_sa___pyx_scope_struct_23_genexpr), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_3_sa___pyx_scope_struct_22_genexpr, /*tp_dealloc*/
+ __pyx_tp_dealloc_3_sa___pyx_scope_struct_23_genexpr, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
@@ -75378,24 +77855,24 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_22_genexpr = {
0, /*reserved*/
#endif
0, /*tp_repr*/
- &__pyx_tp_as_number___pyx_scope_struct_22_genexpr, /*tp_as_number*/
- &__pyx_tp_as_sequence___pyx_scope_struct_22_genexpr, /*tp_as_sequence*/
- &__pyx_tp_as_mapping___pyx_scope_struct_22_genexpr, /*tp_as_mapping*/
+ &__pyx_tp_as_number___pyx_scope_struct_23_genexpr, /*tp_as_number*/
+ &__pyx_tp_as_sequence___pyx_scope_struct_23_genexpr, /*tp_as_sequence*/
+ &__pyx_tp_as_mapping___pyx_scope_struct_23_genexpr, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
- &__pyx_tp_as_buffer___pyx_scope_struct_22_genexpr, /*tp_as_buffer*/
+ &__pyx_tp_as_buffer___pyx_scope_struct_23_genexpr, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_3_sa___pyx_scope_struct_22_genexpr, /*tp_traverse*/
- __pyx_tp_clear_3_sa___pyx_scope_struct_22_genexpr, /*tp_clear*/
+ __pyx_tp_traverse_3_sa___pyx_scope_struct_23_genexpr, /*tp_traverse*/
+ __pyx_tp_clear_3_sa___pyx_scope_struct_23_genexpr, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
- __pyx_methods_3_sa___pyx_scope_struct_22_genexpr, /*tp_methods*/
+ __pyx_methods_3_sa___pyx_scope_struct_23_genexpr, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
@@ -75405,7 +77882,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_22_genexpr = {
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_3_sa___pyx_scope_struct_22_genexpr, /*tp_new*/
+ __pyx_tp_new_3_sa___pyx_scope_struct_23_genexpr, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -75419,26 +77896,26 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_22_genexpr = {
#endif
};
-static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_23_fmt_rule(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- struct __pyx_obj_3_sa___pyx_scope_struct_23_fmt_rule *p;
+static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_24_fmt_rule(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_obj_3_sa___pyx_scope_struct_24_fmt_rule *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
- p = ((struct __pyx_obj_3_sa___pyx_scope_struct_23_fmt_rule *)o);
+ p = ((struct __pyx_obj_3_sa___pyx_scope_struct_24_fmt_rule *)o);
p->__pyx_v_a = 0;
p->__pyx_v_self = 0;
return o;
}
-static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_23_fmt_rule(PyObject *o) {
- struct __pyx_obj_3_sa___pyx_scope_struct_23_fmt_rule *p = (struct __pyx_obj_3_sa___pyx_scope_struct_23_fmt_rule *)o;
+static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_24_fmt_rule(PyObject *o) {
+ struct __pyx_obj_3_sa___pyx_scope_struct_24_fmt_rule *p = (struct __pyx_obj_3_sa___pyx_scope_struct_24_fmt_rule *)o;
Py_CLEAR(p->__pyx_v_a);
Py_CLEAR(p->__pyx_v_self);
(*Py_TYPE(o)->tp_free)(o);
}
-static int __pyx_tp_traverse_3_sa___pyx_scope_struct_23_fmt_rule(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_3_sa___pyx_scope_struct_24_fmt_rule(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_3_sa___pyx_scope_struct_23_fmt_rule *p = (struct __pyx_obj_3_sa___pyx_scope_struct_23_fmt_rule *)o;
+ struct __pyx_obj_3_sa___pyx_scope_struct_24_fmt_rule *p = (struct __pyx_obj_3_sa___pyx_scope_struct_24_fmt_rule *)o;
if (p->__pyx_v_a) {
e = (*v)(p->__pyx_v_a, a); if (e) return e;
}
@@ -75448,8 +77925,8 @@ static int __pyx_tp_traverse_3_sa___pyx_scope_struct_23_fmt_rule(PyObject *o, vi
return 0;
}
-static int __pyx_tp_clear_3_sa___pyx_scope_struct_23_fmt_rule(PyObject *o) {
- struct __pyx_obj_3_sa___pyx_scope_struct_23_fmt_rule *p = (struct __pyx_obj_3_sa___pyx_scope_struct_23_fmt_rule *)o;
+static int __pyx_tp_clear_3_sa___pyx_scope_struct_24_fmt_rule(PyObject *o) {
+ struct __pyx_obj_3_sa___pyx_scope_struct_24_fmt_rule *p = (struct __pyx_obj_3_sa___pyx_scope_struct_24_fmt_rule *)o;
PyObject* tmp;
tmp = ((PyObject*)p->__pyx_v_a);
p->__pyx_v_a = Py_None; Py_INCREF(Py_None);
@@ -75460,11 +77937,11 @@ static int __pyx_tp_clear_3_sa___pyx_scope_struct_23_fmt_rule(PyObject *o) {
return 0;
}
-static PyMethodDef __pyx_methods_3_sa___pyx_scope_struct_23_fmt_rule[] = {
+static PyMethodDef __pyx_methods_3_sa___pyx_scope_struct_24_fmt_rule[] = {
{0, 0, 0, 0}
};
-static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_23_fmt_rule = {
+static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_24_fmt_rule = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
@@ -75522,7 +77999,7 @@ static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_23_fmt_rule = {
#endif
};
-static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_23_fmt_rule = {
+static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_24_fmt_rule = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
@@ -75535,13 +78012,13 @@ static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_23_fmt_rule = {
0, /*sq_inplace_repeat*/
};
-static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_23_fmt_rule = {
+static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_24_fmt_rule = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};
-static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_23_fmt_rule = {
+static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_24_fmt_rule = {
#if PY_MAJOR_VERSION < 3
0, /*bf_getreadbuffer*/
#endif
@@ -75562,12 +78039,12 @@ static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_23_fmt_rule = {
#endif
};
-static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_23_fmt_rule = {
+static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_24_fmt_rule = {
PyVarObject_HEAD_INIT(0, 0)
- __Pyx_NAMESTR("_sa.__pyx_scope_struct_23_fmt_rule"), /*tp_name*/
- sizeof(struct __pyx_obj_3_sa___pyx_scope_struct_23_fmt_rule), /*tp_basicsize*/
+ __Pyx_NAMESTR("_sa.__pyx_scope_struct_24_fmt_rule"), /*tp_name*/
+ sizeof(struct __pyx_obj_3_sa___pyx_scope_struct_24_fmt_rule), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_3_sa___pyx_scope_struct_23_fmt_rule, /*tp_dealloc*/
+ __pyx_tp_dealloc_3_sa___pyx_scope_struct_24_fmt_rule, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
@@ -75577,24 +78054,24 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_23_fmt_rule = {
0, /*reserved*/
#endif
0, /*tp_repr*/
- &__pyx_tp_as_number___pyx_scope_struct_23_fmt_rule, /*tp_as_number*/
- &__pyx_tp_as_sequence___pyx_scope_struct_23_fmt_rule, /*tp_as_sequence*/
- &__pyx_tp_as_mapping___pyx_scope_struct_23_fmt_rule, /*tp_as_mapping*/
+ &__pyx_tp_as_number___pyx_scope_struct_24_fmt_rule, /*tp_as_number*/
+ &__pyx_tp_as_sequence___pyx_scope_struct_24_fmt_rule, /*tp_as_sequence*/
+ &__pyx_tp_as_mapping___pyx_scope_struct_24_fmt_rule, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
- &__pyx_tp_as_buffer___pyx_scope_struct_23_fmt_rule, /*tp_as_buffer*/
+ &__pyx_tp_as_buffer___pyx_scope_struct_24_fmt_rule, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_3_sa___pyx_scope_struct_23_fmt_rule, /*tp_traverse*/
- __pyx_tp_clear_3_sa___pyx_scope_struct_23_fmt_rule, /*tp_clear*/
+ __pyx_tp_traverse_3_sa___pyx_scope_struct_24_fmt_rule, /*tp_traverse*/
+ __pyx_tp_clear_3_sa___pyx_scope_struct_24_fmt_rule, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
- __pyx_methods_3_sa___pyx_scope_struct_23_fmt_rule, /*tp_methods*/
+ __pyx_methods_3_sa___pyx_scope_struct_24_fmt_rule, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
@@ -75604,7 +78081,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_23_fmt_rule = {
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_3_sa___pyx_scope_struct_23_fmt_rule, /*tp_new*/
+ __pyx_tp_new_3_sa___pyx_scope_struct_24_fmt_rule, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -75618,28 +78095,28 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_23_fmt_rule = {
#endif
};
-static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_24_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- struct __pyx_obj_3_sa___pyx_scope_struct_24_genexpr *p;
+static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_25_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_obj_3_sa___pyx_scope_struct_25_genexpr *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
- p = ((struct __pyx_obj_3_sa___pyx_scope_struct_24_genexpr *)o);
+ p = ((struct __pyx_obj_3_sa___pyx_scope_struct_25_genexpr *)o);
p->__pyx_outer_scope = 0;
p->__pyx_v_packed = 0;
p->__pyx_t_0 = 0;
return o;
}
-static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_24_genexpr(PyObject *o) {
- struct __pyx_obj_3_sa___pyx_scope_struct_24_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_24_genexpr *)o;
+static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_25_genexpr(PyObject *o) {
+ struct __pyx_obj_3_sa___pyx_scope_struct_25_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_25_genexpr *)o;
Py_CLEAR(p->__pyx_outer_scope);
Py_CLEAR(p->__pyx_v_packed);
Py_CLEAR(p->__pyx_t_0);
(*Py_TYPE(o)->tp_free)(o);
}
-static int __pyx_tp_traverse_3_sa___pyx_scope_struct_24_genexpr(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_3_sa___pyx_scope_struct_25_genexpr(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_3_sa___pyx_scope_struct_24_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_24_genexpr *)o;
+ struct __pyx_obj_3_sa___pyx_scope_struct_25_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_25_genexpr *)o;
if (p->__pyx_outer_scope) {
e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
}
@@ -75652,11 +78129,11 @@ static int __pyx_tp_traverse_3_sa___pyx_scope_struct_24_genexpr(PyObject *o, vis
return 0;
}
-static int __pyx_tp_clear_3_sa___pyx_scope_struct_24_genexpr(PyObject *o) {
- struct __pyx_obj_3_sa___pyx_scope_struct_24_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_24_genexpr *)o;
+static int __pyx_tp_clear_3_sa___pyx_scope_struct_25_genexpr(PyObject *o) {
+ struct __pyx_obj_3_sa___pyx_scope_struct_25_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_25_genexpr *)o;
PyObject* tmp;
tmp = ((PyObject*)p->__pyx_outer_scope);
- p->__pyx_outer_scope = ((struct __pyx_obj_3_sa___pyx_scope_struct_23_fmt_rule *)Py_None); Py_INCREF(Py_None);
+ p->__pyx_outer_scope = ((struct __pyx_obj_3_sa___pyx_scope_struct_24_fmt_rule *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
tmp = ((PyObject*)p->__pyx_v_packed);
p->__pyx_v_packed = Py_None; Py_INCREF(Py_None);
@@ -75667,11 +78144,11 @@ static int __pyx_tp_clear_3_sa___pyx_scope_struct_24_genexpr(PyObject *o) {
return 0;
}
-static PyMethodDef __pyx_methods_3_sa___pyx_scope_struct_24_genexpr[] = {
+static PyMethodDef __pyx_methods_3_sa___pyx_scope_struct_25_genexpr[] = {
{0, 0, 0, 0}
};
-static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_24_genexpr = {
+static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_25_genexpr = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
@@ -75729,7 +78206,7 @@ static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_24_genexpr = {
#endif
};
-static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_24_genexpr = {
+static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_25_genexpr = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
@@ -75742,13 +78219,13 @@ static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_24_genexpr = {
0, /*sq_inplace_repeat*/
};
-static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_24_genexpr = {
+static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_25_genexpr = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};
-static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_24_genexpr = {
+static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_25_genexpr = {
#if PY_MAJOR_VERSION < 3
0, /*bf_getreadbuffer*/
#endif
@@ -75769,12 +78246,12 @@ static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_24_genexpr = {
#endif
};
-static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_24_genexpr = {
+static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_25_genexpr = {
PyVarObject_HEAD_INIT(0, 0)
- __Pyx_NAMESTR("_sa.__pyx_scope_struct_24_genexpr"), /*tp_name*/
- sizeof(struct __pyx_obj_3_sa___pyx_scope_struct_24_genexpr), /*tp_basicsize*/
+ __Pyx_NAMESTR("_sa.__pyx_scope_struct_25_genexpr"), /*tp_name*/
+ sizeof(struct __pyx_obj_3_sa___pyx_scope_struct_25_genexpr), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_3_sa___pyx_scope_struct_24_genexpr, /*tp_dealloc*/
+ __pyx_tp_dealloc_3_sa___pyx_scope_struct_25_genexpr, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
@@ -75784,24 +78261,24 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_24_genexpr = {
0, /*reserved*/
#endif
0, /*tp_repr*/
- &__pyx_tp_as_number___pyx_scope_struct_24_genexpr, /*tp_as_number*/
- &__pyx_tp_as_sequence___pyx_scope_struct_24_genexpr, /*tp_as_sequence*/
- &__pyx_tp_as_mapping___pyx_scope_struct_24_genexpr, /*tp_as_mapping*/
+ &__pyx_tp_as_number___pyx_scope_struct_25_genexpr, /*tp_as_number*/
+ &__pyx_tp_as_sequence___pyx_scope_struct_25_genexpr, /*tp_as_sequence*/
+ &__pyx_tp_as_mapping___pyx_scope_struct_25_genexpr, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
- &__pyx_tp_as_buffer___pyx_scope_struct_24_genexpr, /*tp_as_buffer*/
+ &__pyx_tp_as_buffer___pyx_scope_struct_25_genexpr, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_3_sa___pyx_scope_struct_24_genexpr, /*tp_traverse*/
- __pyx_tp_clear_3_sa___pyx_scope_struct_24_genexpr, /*tp_clear*/
+ __pyx_tp_traverse_3_sa___pyx_scope_struct_25_genexpr, /*tp_traverse*/
+ __pyx_tp_clear_3_sa___pyx_scope_struct_25_genexpr, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
- __pyx_methods_3_sa___pyx_scope_struct_24_genexpr, /*tp_methods*/
+ __pyx_methods_3_sa___pyx_scope_struct_25_genexpr, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
@@ -75811,7 +78288,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_24_genexpr = {
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_3_sa___pyx_scope_struct_24_genexpr, /*tp_new*/
+ __pyx_tp_new_3_sa___pyx_scope_struct_25_genexpr, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -75825,32 +78302,255 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_24_genexpr = {
#endif
};
-static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_25___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- struct __pyx_obj_3_sa___pyx_scope_struct_25___iter__ *p;
+static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_26_get_f_phrases(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_obj_3_sa___pyx_scope_struct_26_get_f_phrases *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
- p = ((struct __pyx_obj_3_sa___pyx_scope_struct_25___iter__ *)o);
+ p = ((struct __pyx_obj_3_sa___pyx_scope_struct_26_get_f_phrases *)o);
+ p->__pyx_v_extract = 0;
+ p->__pyx_v_f_len = 0;
+ p->__pyx_v_f_words = 0;
+ p->__pyx_v_phrases = 0;
p->__pyx_v_self = 0;
return o;
}
-static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_25___iter__(PyObject *o) {
- struct __pyx_obj_3_sa___pyx_scope_struct_25___iter__ *p = (struct __pyx_obj_3_sa___pyx_scope_struct_25___iter__ *)o;
+static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_26_get_f_phrases(PyObject *o) {
+ struct __pyx_obj_3_sa___pyx_scope_struct_26_get_f_phrases *p = (struct __pyx_obj_3_sa___pyx_scope_struct_26_get_f_phrases *)o;
+ Py_CLEAR(p->__pyx_v_extract);
+ Py_CLEAR(p->__pyx_v_f_len);
+ Py_CLEAR(p->__pyx_v_f_words);
+ Py_CLEAR(p->__pyx_v_phrases);
Py_CLEAR(p->__pyx_v_self);
(*Py_TYPE(o)->tp_free)(o);
}
-static int __pyx_tp_traverse_3_sa___pyx_scope_struct_25___iter__(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_3_sa___pyx_scope_struct_26_get_f_phrases(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_3_sa___pyx_scope_struct_25___iter__ *p = (struct __pyx_obj_3_sa___pyx_scope_struct_25___iter__ *)o;
+ struct __pyx_obj_3_sa___pyx_scope_struct_26_get_f_phrases *p = (struct __pyx_obj_3_sa___pyx_scope_struct_26_get_f_phrases *)o;
+ if (p->__pyx_v_extract) {
+ e = (*v)(p->__pyx_v_extract, a); if (e) return e;
+ }
+ if (p->__pyx_v_f_len) {
+ e = (*v)(p->__pyx_v_f_len, a); if (e) return e;
+ }
+ if (p->__pyx_v_f_words) {
+ e = (*v)(p->__pyx_v_f_words, a); if (e) return e;
+ }
+ if (p->__pyx_v_phrases) {
+ e = (*v)(p->__pyx_v_phrases, a); if (e) return e;
+ }
if (p->__pyx_v_self) {
e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
}
return 0;
}
-static int __pyx_tp_clear_3_sa___pyx_scope_struct_25___iter__(PyObject *o) {
- struct __pyx_obj_3_sa___pyx_scope_struct_25___iter__ *p = (struct __pyx_obj_3_sa___pyx_scope_struct_25___iter__ *)o;
+static int __pyx_tp_clear_3_sa___pyx_scope_struct_26_get_f_phrases(PyObject *o) {
+ struct __pyx_obj_3_sa___pyx_scope_struct_26_get_f_phrases *p = (struct __pyx_obj_3_sa___pyx_scope_struct_26_get_f_phrases *)o;
+ PyObject* tmp;
+ tmp = ((PyObject*)p->__pyx_v_extract);
+ p->__pyx_v_extract = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_v_f_len);
+ p->__pyx_v_f_len = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_v_f_words);
+ p->__pyx_v_f_words = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_v_phrases);
+ p->__pyx_v_phrases = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_v_self);
+ p->__pyx_v_self = ((struct __pyx_obj_3_sa_HieroCachingRuleFactory *)Py_None); Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ return 0;
+}
+
+static PyMethodDef __pyx_methods_3_sa___pyx_scope_struct_26_get_f_phrases[] = {
+ {0, 0, 0, 0}
+};
+
+static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_26_get_f_phrases = {
+ 0, /*nb_add*/
+ 0, /*nb_subtract*/
+ 0, /*nb_multiply*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*nb_divide*/
+ #endif
+ 0, /*nb_remainder*/
+ 0, /*nb_divmod*/
+ 0, /*nb_power*/
+ 0, /*nb_negative*/
+ 0, /*nb_positive*/
+ 0, /*nb_absolute*/
+ 0, /*nb_nonzero*/
+ 0, /*nb_invert*/
+ 0, /*nb_lshift*/
+ 0, /*nb_rshift*/
+ 0, /*nb_and*/
+ 0, /*nb_xor*/
+ 0, /*nb_or*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*nb_coerce*/
+ #endif
+ 0, /*nb_int*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*nb_long*/
+ #else
+ 0, /*reserved*/
+ #endif
+ 0, /*nb_float*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*nb_oct*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*nb_hex*/
+ #endif
+ 0, /*nb_inplace_add*/
+ 0, /*nb_inplace_subtract*/
+ 0, /*nb_inplace_multiply*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*nb_inplace_divide*/
+ #endif
+ 0, /*nb_inplace_remainder*/
+ 0, /*nb_inplace_power*/
+ 0, /*nb_inplace_lshift*/
+ 0, /*nb_inplace_rshift*/
+ 0, /*nb_inplace_and*/
+ 0, /*nb_inplace_xor*/
+ 0, /*nb_inplace_or*/
+ 0, /*nb_floor_divide*/
+ 0, /*nb_true_divide*/
+ 0, /*nb_inplace_floor_divide*/
+ 0, /*nb_inplace_true_divide*/
+ #if PY_VERSION_HEX >= 0x02050000
+ 0, /*nb_index*/
+ #endif
+};
+
+static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_26_get_f_phrases = {
+ 0, /*sq_length*/
+ 0, /*sq_concat*/
+ 0, /*sq_repeat*/
+ 0, /*sq_item*/
+ 0, /*sq_slice*/
+ 0, /*sq_ass_item*/
+ 0, /*sq_ass_slice*/
+ 0, /*sq_contains*/
+ 0, /*sq_inplace_concat*/
+ 0, /*sq_inplace_repeat*/
+};
+
+static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_26_get_f_phrases = {
+ 0, /*mp_length*/
+ 0, /*mp_subscript*/
+ 0, /*mp_ass_subscript*/
+};
+
+static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_26_get_f_phrases = {
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getreadbuffer*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getwritebuffer*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getsegcount*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getcharbuffer*/
+ #endif
+ #if PY_VERSION_HEX >= 0x02060000
+ 0, /*bf_getbuffer*/
+ #endif
+ #if PY_VERSION_HEX >= 0x02060000
+ 0, /*bf_releasebuffer*/
+ #endif
+};
+
+static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_26_get_f_phrases = {
+ PyVarObject_HEAD_INIT(0, 0)
+ __Pyx_NAMESTR("_sa.__pyx_scope_struct_26_get_f_phrases"), /*tp_name*/
+ sizeof(struct __pyx_obj_3_sa___pyx_scope_struct_26_get_f_phrases), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_3_sa___pyx_scope_struct_26_get_f_phrases, /*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*/
+ &__pyx_tp_as_number___pyx_scope_struct_26_get_f_phrases, /*tp_as_number*/
+ &__pyx_tp_as_sequence___pyx_scope_struct_26_get_f_phrases, /*tp_as_sequence*/
+ &__pyx_tp_as_mapping___pyx_scope_struct_26_get_f_phrases, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ &__pyx_tp_as_buffer___pyx_scope_struct_26_get_f_phrases, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ 0, /*tp_doc*/
+ __pyx_tp_traverse_3_sa___pyx_scope_struct_26_get_f_phrases, /*tp_traverse*/
+ __pyx_tp_clear_3_sa___pyx_scope_struct_26_get_f_phrases, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_3_sa___pyx_scope_struct_26_get_f_phrases, /*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_3_sa___pyx_scope_struct_26_get_f_phrases, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ #if PY_VERSION_HEX >= 0x02060000
+ 0, /*tp_version_tag*/
+ #endif
+};
+
+static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_27___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_obj_3_sa___pyx_scope_struct_27___iter__ *p;
+ PyObject *o = (*t->tp_alloc)(t, 0);
+ if (!o) return 0;
+ p = ((struct __pyx_obj_3_sa___pyx_scope_struct_27___iter__ *)o);
+ p->__pyx_v_self = 0;
+ return o;
+}
+
+static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_27___iter__(PyObject *o) {
+ struct __pyx_obj_3_sa___pyx_scope_struct_27___iter__ *p = (struct __pyx_obj_3_sa___pyx_scope_struct_27___iter__ *)o;
+ Py_CLEAR(p->__pyx_v_self);
+ (*Py_TYPE(o)->tp_free)(o);
+}
+
+static int __pyx_tp_traverse_3_sa___pyx_scope_struct_27___iter__(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_obj_3_sa___pyx_scope_struct_27___iter__ *p = (struct __pyx_obj_3_sa___pyx_scope_struct_27___iter__ *)o;
+ if (p->__pyx_v_self) {
+ e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
+ }
+ return 0;
+}
+
+static int __pyx_tp_clear_3_sa___pyx_scope_struct_27___iter__(PyObject *o) {
+ struct __pyx_obj_3_sa___pyx_scope_struct_27___iter__ *p = (struct __pyx_obj_3_sa___pyx_scope_struct_27___iter__ *)o;
PyObject* tmp;
tmp = ((PyObject*)p->__pyx_v_self);
p->__pyx_v_self = ((struct __pyx_obj_3_sa_FeatureVector *)Py_None); Py_INCREF(Py_None);
@@ -75858,11 +78558,11 @@ static int __pyx_tp_clear_3_sa___pyx_scope_struct_25___iter__(PyObject *o) {
return 0;
}
-static PyMethodDef __pyx_methods_3_sa___pyx_scope_struct_25___iter__[] = {
+static PyMethodDef __pyx_methods_3_sa___pyx_scope_struct_27___iter__[] = {
{0, 0, 0, 0}
};
-static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_25___iter__ = {
+static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_27___iter__ = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
@@ -75920,7 +78620,7 @@ static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_25___iter__ = {
#endif
};
-static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_25___iter__ = {
+static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_27___iter__ = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
@@ -75933,13 +78633,13 @@ static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_25___iter__ = {
0, /*sq_inplace_repeat*/
};
-static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_25___iter__ = {
+static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_27___iter__ = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};
-static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_25___iter__ = {
+static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_27___iter__ = {
#if PY_MAJOR_VERSION < 3
0, /*bf_getreadbuffer*/
#endif
@@ -75960,12 +78660,12 @@ static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_25___iter__ = {
#endif
};
-static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_25___iter__ = {
+static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_27___iter__ = {
PyVarObject_HEAD_INIT(0, 0)
- __Pyx_NAMESTR("_sa.__pyx_scope_struct_25___iter__"), /*tp_name*/
- sizeof(struct __pyx_obj_3_sa___pyx_scope_struct_25___iter__), /*tp_basicsize*/
+ __Pyx_NAMESTR("_sa.__pyx_scope_struct_27___iter__"), /*tp_name*/
+ sizeof(struct __pyx_obj_3_sa___pyx_scope_struct_27___iter__), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_3_sa___pyx_scope_struct_25___iter__, /*tp_dealloc*/
+ __pyx_tp_dealloc_3_sa___pyx_scope_struct_27___iter__, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
@@ -75975,24 +78675,24 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_25___iter__ = {
0, /*reserved*/
#endif
0, /*tp_repr*/
- &__pyx_tp_as_number___pyx_scope_struct_25___iter__, /*tp_as_number*/
- &__pyx_tp_as_sequence___pyx_scope_struct_25___iter__, /*tp_as_sequence*/
- &__pyx_tp_as_mapping___pyx_scope_struct_25___iter__, /*tp_as_mapping*/
+ &__pyx_tp_as_number___pyx_scope_struct_27___iter__, /*tp_as_number*/
+ &__pyx_tp_as_sequence___pyx_scope_struct_27___iter__, /*tp_as_sequence*/
+ &__pyx_tp_as_mapping___pyx_scope_struct_27___iter__, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
- &__pyx_tp_as_buffer___pyx_scope_struct_25___iter__, /*tp_as_buffer*/
+ &__pyx_tp_as_buffer___pyx_scope_struct_27___iter__, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_3_sa___pyx_scope_struct_25___iter__, /*tp_traverse*/
- __pyx_tp_clear_3_sa___pyx_scope_struct_25___iter__, /*tp_clear*/
+ __pyx_tp_traverse_3_sa___pyx_scope_struct_27___iter__, /*tp_traverse*/
+ __pyx_tp_clear_3_sa___pyx_scope_struct_27___iter__, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
- __pyx_methods_3_sa___pyx_scope_struct_25___iter__, /*tp_methods*/
+ __pyx_methods_3_sa___pyx_scope_struct_27___iter__, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
@@ -76002,7 +78702,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_25___iter__ = {
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_3_sa___pyx_scope_struct_25___iter__, /*tp_new*/
+ __pyx_tp_new_3_sa___pyx_scope_struct_27___iter__, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -76016,32 +78716,32 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_25___iter__ = {
#endif
};
-static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_26___str__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- struct __pyx_obj_3_sa___pyx_scope_struct_26___str__ *p;
+static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_28___str__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_obj_3_sa___pyx_scope_struct_28___str__ *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
- p = ((struct __pyx_obj_3_sa___pyx_scope_struct_26___str__ *)o);
+ p = ((struct __pyx_obj_3_sa___pyx_scope_struct_28___str__ *)o);
p->__pyx_v_self = 0;
return o;
}
-static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_26___str__(PyObject *o) {
- struct __pyx_obj_3_sa___pyx_scope_struct_26___str__ *p = (struct __pyx_obj_3_sa___pyx_scope_struct_26___str__ *)o;
+static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_28___str__(PyObject *o) {
+ struct __pyx_obj_3_sa___pyx_scope_struct_28___str__ *p = (struct __pyx_obj_3_sa___pyx_scope_struct_28___str__ *)o;
Py_CLEAR(p->__pyx_v_self);
(*Py_TYPE(o)->tp_free)(o);
}
-static int __pyx_tp_traverse_3_sa___pyx_scope_struct_26___str__(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_3_sa___pyx_scope_struct_28___str__(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_3_sa___pyx_scope_struct_26___str__ *p = (struct __pyx_obj_3_sa___pyx_scope_struct_26___str__ *)o;
+ struct __pyx_obj_3_sa___pyx_scope_struct_28___str__ *p = (struct __pyx_obj_3_sa___pyx_scope_struct_28___str__ *)o;
if (p->__pyx_v_self) {
e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
}
return 0;
}
-static int __pyx_tp_clear_3_sa___pyx_scope_struct_26___str__(PyObject *o) {
- struct __pyx_obj_3_sa___pyx_scope_struct_26___str__ *p = (struct __pyx_obj_3_sa___pyx_scope_struct_26___str__ *)o;
+static int __pyx_tp_clear_3_sa___pyx_scope_struct_28___str__(PyObject *o) {
+ struct __pyx_obj_3_sa___pyx_scope_struct_28___str__ *p = (struct __pyx_obj_3_sa___pyx_scope_struct_28___str__ *)o;
PyObject* tmp;
tmp = ((PyObject*)p->__pyx_v_self);
p->__pyx_v_self = ((struct __pyx_obj_3_sa_FeatureVector *)Py_None); Py_INCREF(Py_None);
@@ -76049,11 +78749,11 @@ static int __pyx_tp_clear_3_sa___pyx_scope_struct_26___str__(PyObject *o) {
return 0;
}
-static PyMethodDef __pyx_methods_3_sa___pyx_scope_struct_26___str__[] = {
+static PyMethodDef __pyx_methods_3_sa___pyx_scope_struct_28___str__[] = {
{0, 0, 0, 0}
};
-static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_26___str__ = {
+static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_28___str__ = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
@@ -76111,7 +78811,7 @@ static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_26___str__ = {
#endif
};
-static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_26___str__ = {
+static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_28___str__ = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
@@ -76124,13 +78824,13 @@ static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_26___str__ = {
0, /*sq_inplace_repeat*/
};
-static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_26___str__ = {
+static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_28___str__ = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};
-static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_26___str__ = {
+static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_28___str__ = {
#if PY_MAJOR_VERSION < 3
0, /*bf_getreadbuffer*/
#endif
@@ -76151,12 +78851,12 @@ static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_26___str__ = {
#endif
};
-static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_26___str__ = {
+static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_28___str__ = {
PyVarObject_HEAD_INIT(0, 0)
- __Pyx_NAMESTR("_sa.__pyx_scope_struct_26___str__"), /*tp_name*/
- sizeof(struct __pyx_obj_3_sa___pyx_scope_struct_26___str__), /*tp_basicsize*/
+ __Pyx_NAMESTR("_sa.__pyx_scope_struct_28___str__"), /*tp_name*/
+ sizeof(struct __pyx_obj_3_sa___pyx_scope_struct_28___str__), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_3_sa___pyx_scope_struct_26___str__, /*tp_dealloc*/
+ __pyx_tp_dealloc_3_sa___pyx_scope_struct_28___str__, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
@@ -76166,24 +78866,24 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_26___str__ = {
0, /*reserved*/
#endif
0, /*tp_repr*/
- &__pyx_tp_as_number___pyx_scope_struct_26___str__, /*tp_as_number*/
- &__pyx_tp_as_sequence___pyx_scope_struct_26___str__, /*tp_as_sequence*/
- &__pyx_tp_as_mapping___pyx_scope_struct_26___str__, /*tp_as_mapping*/
+ &__pyx_tp_as_number___pyx_scope_struct_28___str__, /*tp_as_number*/
+ &__pyx_tp_as_sequence___pyx_scope_struct_28___str__, /*tp_as_sequence*/
+ &__pyx_tp_as_mapping___pyx_scope_struct_28___str__, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
- &__pyx_tp_as_buffer___pyx_scope_struct_26___str__, /*tp_as_buffer*/
+ &__pyx_tp_as_buffer___pyx_scope_struct_28___str__, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_3_sa___pyx_scope_struct_26___str__, /*tp_traverse*/
- __pyx_tp_clear_3_sa___pyx_scope_struct_26___str__, /*tp_clear*/
+ __pyx_tp_traverse_3_sa___pyx_scope_struct_28___str__, /*tp_traverse*/
+ __pyx_tp_clear_3_sa___pyx_scope_struct_28___str__, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
- __pyx_methods_3_sa___pyx_scope_struct_26___str__, /*tp_methods*/
+ __pyx_methods_3_sa___pyx_scope_struct_28___str__, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
@@ -76193,7 +78893,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_26___str__ = {
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_3_sa___pyx_scope_struct_26___str__, /*tp_new*/
+ __pyx_tp_new_3_sa___pyx_scope_struct_28___str__, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -76207,28 +78907,28 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_26___str__ = {
#endif
};
-static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_27_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- struct __pyx_obj_3_sa___pyx_scope_struct_27_genexpr *p;
+static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_29_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_obj_3_sa___pyx_scope_struct_29_genexpr *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
- p = ((struct __pyx_obj_3_sa___pyx_scope_struct_27_genexpr *)o);
+ p = ((struct __pyx_obj_3_sa___pyx_scope_struct_29_genexpr *)o);
p->__pyx_outer_scope = 0;
p->__pyx_v_feat = 0;
p->__pyx_t_0 = 0;
return o;
}
-static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_27_genexpr(PyObject *o) {
- struct __pyx_obj_3_sa___pyx_scope_struct_27_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_27_genexpr *)o;
+static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_29_genexpr(PyObject *o) {
+ struct __pyx_obj_3_sa___pyx_scope_struct_29_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_29_genexpr *)o;
Py_CLEAR(p->__pyx_outer_scope);
Py_CLEAR(p->__pyx_v_feat);
Py_CLEAR(p->__pyx_t_0);
(*Py_TYPE(o)->tp_free)(o);
}
-static int __pyx_tp_traverse_3_sa___pyx_scope_struct_27_genexpr(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_3_sa___pyx_scope_struct_29_genexpr(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_3_sa___pyx_scope_struct_27_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_27_genexpr *)o;
+ struct __pyx_obj_3_sa___pyx_scope_struct_29_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_29_genexpr *)o;
if (p->__pyx_outer_scope) {
e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
}
@@ -76241,11 +78941,11 @@ static int __pyx_tp_traverse_3_sa___pyx_scope_struct_27_genexpr(PyObject *o, vis
return 0;
}
-static int __pyx_tp_clear_3_sa___pyx_scope_struct_27_genexpr(PyObject *o) {
- struct __pyx_obj_3_sa___pyx_scope_struct_27_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_27_genexpr *)o;
+static int __pyx_tp_clear_3_sa___pyx_scope_struct_29_genexpr(PyObject *o) {
+ struct __pyx_obj_3_sa___pyx_scope_struct_29_genexpr *p = (struct __pyx_obj_3_sa___pyx_scope_struct_29_genexpr *)o;
PyObject* tmp;
tmp = ((PyObject*)p->__pyx_outer_scope);
- p->__pyx_outer_scope = ((struct __pyx_obj_3_sa___pyx_scope_struct_26___str__ *)Py_None); Py_INCREF(Py_None);
+ p->__pyx_outer_scope = ((struct __pyx_obj_3_sa___pyx_scope_struct_28___str__ *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
tmp = ((PyObject*)p->__pyx_v_feat);
p->__pyx_v_feat = Py_None; Py_INCREF(Py_None);
@@ -76256,11 +78956,11 @@ static int __pyx_tp_clear_3_sa___pyx_scope_struct_27_genexpr(PyObject *o) {
return 0;
}
-static PyMethodDef __pyx_methods_3_sa___pyx_scope_struct_27_genexpr[] = {
+static PyMethodDef __pyx_methods_3_sa___pyx_scope_struct_29_genexpr[] = {
{0, 0, 0, 0}
};
-static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_27_genexpr = {
+static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_29_genexpr = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
@@ -76318,7 +79018,7 @@ static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_27_genexpr = {
#endif
};
-static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_27_genexpr = {
+static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_29_genexpr = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
@@ -76331,13 +79031,13 @@ static PySequenceMethods __pyx_tp_as_sequence___pyx_scope_struct_27_genexpr = {
0, /*sq_inplace_repeat*/
};
-static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_27_genexpr = {
+static PyMappingMethods __pyx_tp_as_mapping___pyx_scope_struct_29_genexpr = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};
-static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_27_genexpr = {
+static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_29_genexpr = {
#if PY_MAJOR_VERSION < 3
0, /*bf_getreadbuffer*/
#endif
@@ -76358,12 +79058,12 @@ static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_27_genexpr = {
#endif
};
-static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_27_genexpr = {
+static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_29_genexpr = {
PyVarObject_HEAD_INIT(0, 0)
- __Pyx_NAMESTR("_sa.__pyx_scope_struct_27_genexpr"), /*tp_name*/
- sizeof(struct __pyx_obj_3_sa___pyx_scope_struct_27_genexpr), /*tp_basicsize*/
+ __Pyx_NAMESTR("_sa.__pyx_scope_struct_29_genexpr"), /*tp_name*/
+ sizeof(struct __pyx_obj_3_sa___pyx_scope_struct_29_genexpr), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_3_sa___pyx_scope_struct_27_genexpr, /*tp_dealloc*/
+ __pyx_tp_dealloc_3_sa___pyx_scope_struct_29_genexpr, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
@@ -76373,24 +79073,24 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_27_genexpr = {
0, /*reserved*/
#endif
0, /*tp_repr*/
- &__pyx_tp_as_number___pyx_scope_struct_27_genexpr, /*tp_as_number*/
- &__pyx_tp_as_sequence___pyx_scope_struct_27_genexpr, /*tp_as_sequence*/
- &__pyx_tp_as_mapping___pyx_scope_struct_27_genexpr, /*tp_as_mapping*/
+ &__pyx_tp_as_number___pyx_scope_struct_29_genexpr, /*tp_as_number*/
+ &__pyx_tp_as_sequence___pyx_scope_struct_29_genexpr, /*tp_as_sequence*/
+ &__pyx_tp_as_mapping___pyx_scope_struct_29_genexpr, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
- &__pyx_tp_as_buffer___pyx_scope_struct_27_genexpr, /*tp_as_buffer*/
+ &__pyx_tp_as_buffer___pyx_scope_struct_29_genexpr, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_3_sa___pyx_scope_struct_27_genexpr, /*tp_traverse*/
- __pyx_tp_clear_3_sa___pyx_scope_struct_27_genexpr, /*tp_clear*/
+ __pyx_tp_traverse_3_sa___pyx_scope_struct_29_genexpr, /*tp_traverse*/
+ __pyx_tp_clear_3_sa___pyx_scope_struct_29_genexpr, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
- __pyx_methods_3_sa___pyx_scope_struct_27_genexpr, /*tp_methods*/
+ __pyx_methods_3_sa___pyx_scope_struct_29_genexpr, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
@@ -76400,7 +79100,7 @@ static PyTypeObject __pyx_type_3_sa___pyx_scope_struct_27_genexpr = {
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_3_sa___pyx_scope_struct_27_genexpr, /*tp_new*/
+ __pyx_tp_new_3_sa___pyx_scope_struct_29_genexpr, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -76472,10 +79172,11 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_kp_s_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 0, 1, 0},
{&__pyx_kp_s_141, __pyx_k_141, sizeof(__pyx_k_141), 0, 0, 1, 0},
{&__pyx_kp_s_145, __pyx_k_145, sizeof(__pyx_k_145), 0, 0, 1, 0},
- {&__pyx_kp_s_151, __pyx_k_151, sizeof(__pyx_k_151), 0, 0, 1, 0},
+ {&__pyx_n_s_151, __pyx_k_151, sizeof(__pyx_k_151), 0, 0, 1, 1},
{&__pyx_kp_s_154, __pyx_k_154, sizeof(__pyx_k_154), 0, 0, 1, 0},
- {&__pyx_kp_s_155, __pyx_k_155, sizeof(__pyx_k_155), 0, 0, 1, 0},
- {&__pyx_kp_s_159, __pyx_k_159, sizeof(__pyx_k_159), 0, 0, 1, 0},
+ {&__pyx_kp_s_157, __pyx_k_157, sizeof(__pyx_k_157), 0, 0, 1, 0},
+ {&__pyx_kp_s_158, __pyx_k_158, sizeof(__pyx_k_158), 0, 0, 1, 0},
+ {&__pyx_kp_s_162, __pyx_k_162, sizeof(__pyx_k_162), 0, 0, 1, 0},
{&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0},
{&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
{&__pyx_kp_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 0},
@@ -76562,6 +79263,9 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s__arr, __pyx_k__arr, sizeof(__pyx_k__arr), 0, 0, 1, 1},
{&__pyx_n_s__arr_high, __pyx_k__arr_high, sizeof(__pyx_k__arr_high), 0, 0, 1, 1},
{&__pyx_n_s__arr_low, __pyx_k__arr_low, sizeof(__pyx_k__arr_low), 0, 0, 1, 1},
+ {&__pyx_n_s__bilex_e, __pyx_k__bilex_e, sizeof(__pyx_k__bilex_e), 0, 0, 1, 1},
+ {&__pyx_n_s__bilex_f, __pyx_k__bilex_f, sizeof(__pyx_k__bilex_f), 0, 0, 1, 1},
+ {&__pyx_n_s__bilex_fe, __pyx_k__bilex_fe, sizeof(__pyx_k__bilex_fe), 0, 0, 1, 1},
{&__pyx_n_s__by_slack_factor, __pyx_k__by_slack_factor, sizeof(__pyx_k__by_slack_factor), 0, 0, 1, 1},
{&__pyx_n_s__category, __pyx_k__category, sizeof(__pyx_k__category), 0, 0, 1, 1},
{&__pyx_n_s__chain, __pyx_k__chain, sizeof(__pyx_k__chain), 0, 0, 1, 1},
@@ -76577,6 +79281,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s__decode_words, __pyx_k__decode_words, sizeof(__pyx_k__decode_words), 0, 0, 1, 1},
{&__pyx_n_s__defaultdict, __pyx_k__defaultdict, sizeof(__pyx_k__defaultdict), 0, 0, 1, 1},
{&__pyx_n_s__dist, __pyx_k__dist, sizeof(__pyx_k__dist), 0, 0, 1, 1},
+ {&__pyx_n_s__dump_online_rules, __pyx_k__dump_online_rules, sizeof(__pyx_k__dump_online_rules), 0, 0, 1, 1},
{&__pyx_n_s__e, __pyx_k__e, sizeof(__pyx_k__e), 0, 0, 1, 1},
{&__pyx_n_s__e_i, __pyx_k__e_i, sizeof(__pyx_k__e_i), 0, 0, 1, 1},
{&__pyx_n_s__e_j, __pyx_k__e_j, sizeof(__pyx_k__e_j), 0, 0, 1, 1},
@@ -76618,9 +79323,11 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s__fwords, __pyx_k__fwords, sizeof(__pyx_k__fwords), 0, 0, 1, 1},
{&__pyx_n_s__gc, __pyx_k__gc, sizeof(__pyx_k__gc), 0, 0, 1, 1},
{&__pyx_n_s__genexpr, __pyx_k__genexpr, sizeof(__pyx_k__genexpr), 0, 0, 1, 1},
+ {&__pyx_n_s__get, __pyx_k__get, sizeof(__pyx_k__get), 0, 0, 1, 1},
{&__pyx_n_s__getLogger, __pyx_k__getLogger, sizeof(__pyx_k__getLogger), 0, 0, 1, 1},
{&__pyx_n_s__get_e_id, __pyx_k__get_e_id, sizeof(__pyx_k__get_e_id), 0, 0, 1, 1},
{&__pyx_n_s__get_f_id, __pyx_k__get_f_id, sizeof(__pyx_k__get_f_id), 0, 0, 1, 1},
+ {&__pyx_n_s__get_f_phrases, __pyx_k__get_f_phrases, sizeof(__pyx_k__get_f_phrases), 0, 0, 1, 1},
{&__pyx_n_s__get_id, __pyx_k__get_id, sizeof(__pyx_k__get_id), 0, 0, 1, 1},
{&__pyx_n_s__get_next_states, __pyx_k__get_next_states, sizeof(__pyx_k__get_next_states), 0, 0, 1, 1},
{&__pyx_n_s__get_word, __pyx_k__get_word, sizeof(__pyx_k__get_word), 0, 0, 1, 1},
@@ -76640,6 +79347,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s__input_span, __pyx_k__input_span, sizeof(__pyx_k__input_span), 0, 0, 1, 1},
{&__pyx_n_s__insert, __pyx_k__insert, sizeof(__pyx_k__insert), 0, 0, 1, 1},
{&__pyx_n_s__isa, __pyx_k__isa, sizeof(__pyx_k__isa), 0, 0, 1, 1},
+ {&__pyx_n_s__isvar, __pyx_k__isvar, sizeof(__pyx_k__isvar), 0, 0, 1, 1},
{&__pyx_n_s__iteritems, __pyx_k__iteritems, sizeof(__pyx_k__iteritems), 0, 0, 1, 1},
{&__pyx_n_s__itertools, __pyx_k__itertools, sizeof(__pyx_k__itertools), 0, 0, 1, 1},
{&__pyx_n_s__itervalues, __pyx_k__itervalues, sizeof(__pyx_k__itervalues), 0, 0, 1, 1},
@@ -76649,6 +79357,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s__k, __pyx_k__k, sizeof(__pyx_k__k), 0, 0, 1, 1},
{&__pyx_n_s__key, __pyx_k__key, sizeof(__pyx_k__key), 0, 0, 1, 1},
{&__pyx_n_s__lattice, __pyx_k__lattice, sizeof(__pyx_k__lattice), 0, 0, 1, 1},
+ {&__pyx_n_s__lex_i, __pyx_k__lex_i, sizeof(__pyx_k__lex_i), 0, 0, 1, 1},
+ {&__pyx_n_s__lex_j, __pyx_k__lex_j, sizeof(__pyx_k__lex_j), 0, 0, 1, 1},
{&__pyx_n_s__lhs, __pyx_k__lhs, sizeof(__pyx_k__lhs), 0, 0, 1, 1},
{&__pyx_n_s__link, __pyx_k__link, sizeof(__pyx_k__link), 0, 0, 1, 1},
{&__pyx_n_s__link_i, __pyx_k__link_i, sizeof(__pyx_k__link_i), 0, 0, 1, 1},
@@ -76677,14 +79387,19 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s__namedtuple, __pyx_k__namedtuple, sizeof(__pyx_k__namedtuple), 0, 0, 1, 1},
{&__pyx_n_s__new_e_i, __pyx_k__new_e_i, sizeof(__pyx_k__new_e_i), 0, 0, 1, 1},
{&__pyx_n_s__new_e_j, __pyx_k__new_e_j, sizeof(__pyx_k__new_e_j), 0, 0, 1, 1},
+ {&__pyx_n_s__new_lex_i, __pyx_k__new_lex_i, sizeof(__pyx_k__new_lex_i), 0, 0, 1, 1},
+ {&__pyx_n_s__new_lex_j, __pyx_k__new_lex_j, sizeof(__pyx_k__new_lex_j), 0, 0, 1, 1},
{&__pyx_n_s__new_min_bound, __pyx_k__new_min_bound, sizeof(__pyx_k__new_min_bound), 0, 0, 1, 1},
{&__pyx_n_s__next_states, __pyx_k__next_states, sizeof(__pyx_k__next_states), 0, 0, 1, 1},
{&__pyx_n_s__nt, __pyx_k__nt, sizeof(__pyx_k__nt), 0, 0, 1, 1},
{&__pyx_n_s__nt_collision, __pyx_k__nt_collision, sizeof(__pyx_k__nt_collision), 0, 0, 1, 1},
{&__pyx_n_s__nt_open, __pyx_k__nt_open, sizeof(__pyx_k__nt_open), 0, 0, 1, 1},
+ {&__pyx_n_s__ntc, __pyx_k__ntc, sizeof(__pyx_k__ntc), 0, 0, 1, 1},
{&__pyx_n_s__num_subpatterns, __pyx_k__num_subpatterns, sizeof(__pyx_k__num_subpatterns), 0, 0, 1, 1},
{&__pyx_n_s__offset, __pyx_k__offset, sizeof(__pyx_k__offset), 0, 0, 1, 1},
{&__pyx_n_s__old_last_nt, __pyx_k__old_last_nt, sizeof(__pyx_k__old_last_nt), 0, 0, 1, 1},
+ {&__pyx_n_s__online, __pyx_k__online, sizeof(__pyx_k__online), 0, 0, 1, 1},
+ {&__pyx_n_s__online_ctx_lookup, __pyx_k__online_ctx_lookup, sizeof(__pyx_k__online_ctx_lookup), 0, 0, 1, 1},
{&__pyx_n_s__open, __pyx_k__open, sizeof(__pyx_k__open), 0, 0, 1, 1},
{&__pyx_n_s__pad, __pyx_k__pad, sizeof(__pyx_k__pad), 0, 0, 1, 1},
{&__pyx_n_s__paircount, __pyx_k__paircount, sizeof(__pyx_k__paircount), 0, 0, 1, 1},
@@ -76739,6 +79454,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s__stats, __pyx_k__stats, sizeof(__pyx_k__stats), 0, 0, 1, 1},
{&__pyx_n_s__stop, __pyx_k__stop, sizeof(__pyx_k__stop), 0, 0, 1, 1},
{&__pyx_n_s__suffix_link, __pyx_k__suffix_link, sizeof(__pyx_k__suffix_link), 0, 0, 1, 1},
+ {&__pyx_n_s__sym, __pyx_k__sym, sizeof(__pyx_k__sym), 0, 0, 1, 1},
{&__pyx_n_s__syms, __pyx_k__syms, sizeof(__pyx_k__syms), 0, 0, 1, 1},
{&__pyx_n_s__test_sentence, __pyx_k__test_sentence, sizeof(__pyx_k__test_sentence), 0, 0, 1, 1},
{&__pyx_n_s__tight_phrases, __pyx_k__tight_phrases, sizeof(__pyx_k__tight_phrases), 0, 0, 1, 1},
@@ -76776,8 +79492,8 @@ static int __Pyx_InitCachedBuiltins(void) {
__pyx_builtin_zip = __Pyx_GetName(__pyx_b, __pyx_n_s__zip); if (!__pyx_builtin_zip) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_builtin_StopIteration = __Pyx_GetName(__pyx_b, __pyx_n_s__StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_builtin_cmp = __Pyx_GetName(__pyx_b, __pyx_n_s__cmp); if (!__pyx_builtin_cmp) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_sorted = __Pyx_GetName(__pyx_b, __pyx_n_s__sorted); if (!__pyx_builtin_sorted) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_max = __Pyx_GetName(__pyx_b, __pyx_n_s__max); if (!__pyx_builtin_max) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_sorted = __Pyx_GetName(__pyx_b, __pyx_n_s__sorted); if (!__pyx_builtin_sorted) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_max = __Pyx_GetName(__pyx_b, __pyx_n_s__max); if (!__pyx_builtin_max) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
return 0;
__pyx_L1_error:;
return -1;
@@ -77497,56 +80213,56 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(Py_None);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_98));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":109
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":119
* logger.info("Sampling strategy: uniform, max sample size = %d", sample_size)
* else:
* logger.info("Sampling strategy: no sampling") # <<<<<<<<<<<<<<
*
* def sample(self, PhraseLocation phrase_location):
*/
- __pyx_k_tuple_102 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_102)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_102 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_102)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_102);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_101));
PyTuple_SET_ITEM(__pyx_k_tuple_102, 0, ((PyObject *)__pyx_kp_s_101));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_101));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_102));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":326
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":338
* self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation())
* if alignment is None:
* raise Exception("Must specify an alignment object") # <<<<<<<<<<<<<<
* self.alignment = alignment
*
*/
- __pyx_k_tuple_107 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_107)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_107 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_107)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_107);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_106));
PyTuple_SET_ITEM(__pyx_k_tuple_107, 0, ((PyObject *)__pyx_kp_s_106));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_106));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_107));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1039
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1062
* else:
* #ERROR: We never get here
* raise Exception("Keyword trie error") # <<<<<<<<<<<<<<
* # checking whether lookup_required
* if lookup_required:
*/
- __pyx_k_tuple_122 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_122)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_122 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_122)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_122);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_121));
PyTuple_SET_ITEM(__pyx_k_tuple_122, 0, ((PyObject *)__pyx_kp_s_121));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_121));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_122));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1861
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1913
* # f_ i and j are current, e_ i and j are previous
* # We care _considering_ f_j, so it is not yet in counts
* def extract(f_i, f_j, e_i, e_j, min_bound, wc, links, nt, nt_open): # <<<<<<<<<<<<<<
* # Phrase extraction limits
* if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size:
*/
- __pyx_k_tuple_134 = PyTuple_New(19); if (unlikely(!__pyx_k_tuple_134)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_134 = PyTuple_New(19); if (unlikely(!__pyx_k_tuple_134)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_134);
__Pyx_INCREF(((PyObject *)__pyx_n_s__f_i));
PyTuple_SET_ITEM(__pyx_k_tuple_134, 0, ((PyObject *)__pyx_n_s__f_i));
@@ -77606,134 +80322,176 @@ static int __Pyx_InitCachedConstants(void) {
PyTuple_SET_ITEM(__pyx_k_tuple_134, 18, ((PyObject *)__pyx_n_s__old_last_nt));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__old_last_nt));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_134));
- __pyx_k_codeobj_135 = (PyObject*)__Pyx_PyCode_New(9, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_136, __pyx_n_s__extract, 1861, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_135)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_codeobj_135 = (PyObject*)__Pyx_PyCode_New(9, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_136, __pyx_n_s__extract, 1913, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_135)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2063
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2120
* # Debugging
* def dump_online_stats(self):
* logger.info('------------------------------') # <<<<<<<<<<<<<<
* logger.info(' Online Stats ')
* logger.info('------------------------------')
*/
- __pyx_k_tuple_140 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_140)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_140 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_140)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_140);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_139));
PyTuple_SET_ITEM(__pyx_k_tuple_140, 0, ((PyObject *)__pyx_kp_s_139));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_139));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_140));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2064
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2121
* def dump_online_stats(self):
* logger.info('------------------------------')
* logger.info(' Online Stats ') # <<<<<<<<<<<<<<
* logger.info('------------------------------')
* logger.info('f')
*/
- __pyx_k_tuple_142 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_142)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_142 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_142)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_142);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_141));
PyTuple_SET_ITEM(__pyx_k_tuple_142, 0, ((PyObject *)__pyx_kp_s_141));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_141));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_142));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2065
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2122
* logger.info('------------------------------')
* logger.info(' Online Stats ')
* logger.info('------------------------------') # <<<<<<<<<<<<<<
* logger.info('f')
* for w in self.bilex_f:
*/
- __pyx_k_tuple_143 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_143)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_143 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_143)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_143);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_139));
PyTuple_SET_ITEM(__pyx_k_tuple_143, 0, ((PyObject *)__pyx_kp_s_139));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_139));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_143));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2066
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2123
* logger.info(' Online Stats ')
* logger.info('------------------------------')
* logger.info('f') # <<<<<<<<<<<<<<
* for w in self.bilex_f:
* logger.info(sym_tostring(w) + ' : ' + str(self.bilex_f[w]))
*/
- __pyx_k_tuple_144 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_144)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_144 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_144)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_144);
__Pyx_INCREF(((PyObject *)__pyx_n_s__f));
PyTuple_SET_ITEM(__pyx_k_tuple_144, 0, ((PyObject *)__pyx_n_s__f));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__f));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_144));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2069
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2126
* for w in self.bilex_f:
* logger.info(sym_tostring(w) + ' : ' + str(self.bilex_f[w]))
* logger.info('e') # <<<<<<<<<<<<<<
* for w in self.bilex_e:
* logger.info(sym_tostring(w) + ' : ' + str(self.bilex_e[w]))
*/
- __pyx_k_tuple_146 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_146)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_146 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_146)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_146);
__Pyx_INCREF(((PyObject *)__pyx_n_s__e));
PyTuple_SET_ITEM(__pyx_k_tuple_146, 0, ((PyObject *)__pyx_n_s__e));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__e));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_146));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2072
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2129
* for w in self.bilex_e:
* logger.info(sym_tostring(w) + ' : ' + str(self.bilex_e[w]))
* logger.info('fe') # <<<<<<<<<<<<<<
* for w in self.bilex_fe:
* for w2 in self.bilex_fe[w]:
*/
- __pyx_k_tuple_147 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_147)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_147 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_147)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_147);
__Pyx_INCREF(((PyObject *)__pyx_n_s__fe));
PyTuple_SET_ITEM(__pyx_k_tuple_147, 0, ((PyObject *)__pyx_n_s__fe));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__fe));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_147));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2076
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2133
* for w2 in self.bilex_fe[w]:
* logger.info(sym_tostring(w) + ' : ' + sym_tostring(w2) + ' : ' + str(self.bilex_fe[w][w2]))
* logger.info('F') # <<<<<<<<<<<<<<
* for ph in self.phrases_f:
* logger.info(str(ph) + ' ||| ' + str(self.phrases_f[ph]))
*/
- __pyx_k_tuple_148 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_148)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_148 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_148)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_148);
__Pyx_INCREF(((PyObject *)__pyx_n_s__F));
PyTuple_SET_ITEM(__pyx_k_tuple_148, 0, ((PyObject *)__pyx_n_s__F));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__F));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_148));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2079
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2136
* for ph in self.phrases_f:
* logger.info(str(ph) + ' ||| ' + str(self.phrases_f[ph]))
* logger.info('E') # <<<<<<<<<<<<<<
* for ph in self.phrases_e:
* logger.info(str(ph) + ' ||| ' + str(self.phrases_e[ph]))
*/
- __pyx_k_tuple_149 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_149)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_149 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_149)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_149);
__Pyx_INCREF(((PyObject *)__pyx_n_s__E));
PyTuple_SET_ITEM(__pyx_k_tuple_149, 0, ((PyObject *)__pyx_n_s__E));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__E));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_149));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2082
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2139
* for ph in self.phrases_e:
* logger.info(str(ph) + ' ||| ' + str(self.phrases_e[ph]))
* logger.info('FE') # <<<<<<<<<<<<<<
- * for ph in self.phrases_fe:
- * for ph2 in self.phrases_fe[ph]:
+ * self.dump_online_rules()
+ *
*/
- __pyx_k_tuple_150 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_150)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_150 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_150)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_150);
__Pyx_INCREF(((PyObject *)__pyx_n_s__FE));
PyTuple_SET_ITEM(__pyx_k_tuple_150, 0, ((PyObject *)__pyx_n_s__FE));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__FE));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_150));
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2166
+ * phrases = set() # (fphrase, lex_i, lex_j)
+ *
+ * def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms): # <<<<<<<<<<<<<<
+ * # Phrase extraction limits
+ * if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size:
+ */
+ __pyx_k_tuple_152 = PyTuple_New(10); if (unlikely(!__pyx_k_tuple_152)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_152);
+ __Pyx_INCREF(((PyObject *)__pyx_n_s__f_i));
+ PyTuple_SET_ITEM(__pyx_k_tuple_152, 0, ((PyObject *)__pyx_n_s__f_i));
+ __Pyx_GIVEREF(((PyObject *)__pyx_n_s__f_i));
+ __Pyx_INCREF(((PyObject *)__pyx_n_s__f_j));
+ PyTuple_SET_ITEM(__pyx_k_tuple_152, 1, ((PyObject *)__pyx_n_s__f_j));
+ __Pyx_GIVEREF(((PyObject *)__pyx_n_s__f_j));
+ __Pyx_INCREF(((PyObject *)__pyx_n_s__lex_i));
+ PyTuple_SET_ITEM(__pyx_k_tuple_152, 2, ((PyObject *)__pyx_n_s__lex_i));
+ __Pyx_GIVEREF(((PyObject *)__pyx_n_s__lex_i));
+ __Pyx_INCREF(((PyObject *)__pyx_n_s__lex_j));
+ PyTuple_SET_ITEM(__pyx_k_tuple_152, 3, ((PyObject *)__pyx_n_s__lex_j));
+ __Pyx_GIVEREF(((PyObject *)__pyx_n_s__lex_j));
+ __Pyx_INCREF(((PyObject *)__pyx_n_s__wc));
+ PyTuple_SET_ITEM(__pyx_k_tuple_152, 4, ((PyObject *)__pyx_n_s__wc));
+ __Pyx_GIVEREF(((PyObject *)__pyx_n_s__wc));
+ __Pyx_INCREF(((PyObject *)__pyx_n_s__ntc));
+ PyTuple_SET_ITEM(__pyx_k_tuple_152, 5, ((PyObject *)__pyx_n_s__ntc));
+ __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ntc));
+ __Pyx_INCREF(((PyObject *)__pyx_n_s__syms));
+ PyTuple_SET_ITEM(__pyx_k_tuple_152, 6, ((PyObject *)__pyx_n_s__syms));
+ __Pyx_GIVEREF(((PyObject *)__pyx_n_s__syms));
+ __Pyx_INCREF(((PyObject *)__pyx_n_s__f));
+ PyTuple_SET_ITEM(__pyx_k_tuple_152, 7, ((PyObject *)__pyx_n_s__f));
+ __Pyx_GIVEREF(((PyObject *)__pyx_n_s__f));
+ __Pyx_INCREF(((PyObject *)__pyx_n_s__new_lex_i));
+ PyTuple_SET_ITEM(__pyx_k_tuple_152, 8, ((PyObject *)__pyx_n_s__new_lex_i));
+ __Pyx_GIVEREF(((PyObject *)__pyx_n_s__new_lex_i));
+ __Pyx_INCREF(((PyObject *)__pyx_n_s__new_lex_j));
+ PyTuple_SET_ITEM(__pyx_k_tuple_152, 9, ((PyObject *)__pyx_n_s__new_lex_j));
+ __Pyx_GIVEREF(((PyObject *)__pyx_n_s__new_lex_j));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_152));
+ __pyx_k_codeobj_153 = (PyObject*)__Pyx_PyCode_New(7, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_152, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_136, __pyx_n_s__extract, 2166, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_153)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
/* "_sa.pyx":9
* resource.getrusage(resource.RUSAGE_SELF).ru_stime)
*
@@ -77741,16 +80499,16 @@ static int __Pyx_InitCachedConstants(void) {
* if filename.endswith('.gz'):
* return gzip.GzipFile(filename)
*/
- __pyx_k_tuple_152 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_152)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_152);
+ __pyx_k_tuple_155 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_155)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_155);
__Pyx_INCREF(((PyObject *)__pyx_n_s__filename));
- PyTuple_SET_ITEM(__pyx_k_tuple_152, 0, ((PyObject *)__pyx_n_s__filename));
+ PyTuple_SET_ITEM(__pyx_k_tuple_155, 0, ((PyObject *)__pyx_n_s__filename));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__filename));
__Pyx_INCREF(((PyObject *)__pyx_n_s__filename));
- PyTuple_SET_ITEM(__pyx_k_tuple_152, 1, ((PyObject *)__pyx_n_s__filename));
+ PyTuple_SET_ITEM(__pyx_k_tuple_155, 1, ((PyObject *)__pyx_n_s__filename));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__filename));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_152));
- __pyx_k_codeobj_153 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_152, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_154, __pyx_n_s__gzip_or_text, 9, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_153)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_155));
+ __pyx_k_codeobj_156 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_155, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_157, __pyx_n_s__gzip_or_text, 9, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_156)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
/* "_sa.pyx":15
* return open(filename)
@@ -77759,194 +80517,209 @@ static int __Pyx_InitCachedConstants(void) {
*
* include "float_list.pxi"
*/
- __pyx_k_tuple_156 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_156)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_156);
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_155));
- PyTuple_SET_ITEM(__pyx_k_tuple_156, 0, ((PyObject *)__pyx_kp_s_155));
- __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_155));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_156));
+ __pyx_k_tuple_159 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_159)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_159);
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_158));
+ PyTuple_SET_ITEM(__pyx_k_tuple_159, 0, ((PyObject *)__pyx_kp_s_158));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_158));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_159));
/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":107
* return ALPHABET.fromstring(string, terminal)
*
+ * def isvar(sym): # <<<<<<<<<<<<<<
+ * return sym_isvar(sym)
+ *
+ */
+ __pyx_k_tuple_160 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_160)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_160);
+ __Pyx_INCREF(((PyObject *)__pyx_n_s__sym));
+ PyTuple_SET_ITEM(__pyx_k_tuple_160, 0, ((PyObject *)__pyx_n_s__sym));
+ __Pyx_GIVEREF(((PyObject *)__pyx_n_s__sym));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_160));
+ __pyx_k_codeobj_161 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_160, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_162, __pyx_n_s__isvar, 107, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_161)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":110
+ * return sym_isvar(sym)
+ *
* def make_lattice(words): # <<<<<<<<<<<<<<
* word_ids = (sym_fromstring(word, True) for word in words)
* return tuple(((word, None, 1), ) for word in word_ids)
*/
- __pyx_k_tuple_157 = PyTuple_New(5); if (unlikely(!__pyx_k_tuple_157)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_157);
+ __pyx_k_tuple_163 = PyTuple_New(5); if (unlikely(!__pyx_k_tuple_163)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_163);
__Pyx_INCREF(((PyObject *)__pyx_n_s__words));
- PyTuple_SET_ITEM(__pyx_k_tuple_157, 0, ((PyObject *)__pyx_n_s__words));
+ PyTuple_SET_ITEM(__pyx_k_tuple_163, 0, ((PyObject *)__pyx_n_s__words));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__words));
__Pyx_INCREF(((PyObject *)__pyx_n_s__word_ids));
- PyTuple_SET_ITEM(__pyx_k_tuple_157, 1, ((PyObject *)__pyx_n_s__word_ids));
+ PyTuple_SET_ITEM(__pyx_k_tuple_163, 1, ((PyObject *)__pyx_n_s__word_ids));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__word_ids));
__Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr));
- PyTuple_SET_ITEM(__pyx_k_tuple_157, 2, ((PyObject *)__pyx_n_s__genexpr));
+ PyTuple_SET_ITEM(__pyx_k_tuple_163, 2, ((PyObject *)__pyx_n_s__genexpr));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr));
__Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr));
- PyTuple_SET_ITEM(__pyx_k_tuple_157, 3, ((PyObject *)__pyx_n_s__genexpr));
+ PyTuple_SET_ITEM(__pyx_k_tuple_163, 3, ((PyObject *)__pyx_n_s__genexpr));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr));
__Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr));
- PyTuple_SET_ITEM(__pyx_k_tuple_157, 4, ((PyObject *)__pyx_n_s__genexpr));
+ PyTuple_SET_ITEM(__pyx_k_tuple_163, 4, ((PyObject *)__pyx_n_s__genexpr));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_157));
- __pyx_k_codeobj_158 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_157, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_159, __pyx_n_s__make_lattice, 107, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_158)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_163));
+ __pyx_k_codeobj_164 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_163, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_162, __pyx_n_s__make_lattice, 110, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_164)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":111
+ /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":114
* return tuple(((word, None, 1), ) for word in word_ids)
*
* def decode_lattice(lattice): # <<<<<<<<<<<<<<
* return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc
* for arc in node for node in lattice)
*/
- __pyx_k_tuple_160 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_160)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_160);
+ __pyx_k_tuple_165 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_165)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_165);
__Pyx_INCREF(((PyObject *)__pyx_n_s__lattice));
- PyTuple_SET_ITEM(__pyx_k_tuple_160, 0, ((PyObject *)__pyx_n_s__lattice));
+ PyTuple_SET_ITEM(__pyx_k_tuple_165, 0, ((PyObject *)__pyx_n_s__lattice));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__lattice));
__Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr));
- PyTuple_SET_ITEM(__pyx_k_tuple_160, 1, ((PyObject *)__pyx_n_s__genexpr));
+ PyTuple_SET_ITEM(__pyx_k_tuple_165, 1, ((PyObject *)__pyx_n_s__genexpr));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr));
__Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr));
- PyTuple_SET_ITEM(__pyx_k_tuple_160, 2, ((PyObject *)__pyx_n_s__genexpr));
+ PyTuple_SET_ITEM(__pyx_k_tuple_165, 2, ((PyObject *)__pyx_n_s__genexpr));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_160));
- __pyx_k_codeobj_161 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_160, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_159, __pyx_n_s__decode_lattice, 111, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_161)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_165));
+ __pyx_k_codeobj_166 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_165, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_162, __pyx_n_s__decode_lattice, 114, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_166)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":115
+ /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":118
* for arc in node for node in lattice)
*
* def decode_sentence(lattice): # <<<<<<<<<<<<<<
* return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice)
*
*/
- __pyx_k_tuple_162 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_162)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_162);
+ __pyx_k_tuple_167 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_167)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_167);
__Pyx_INCREF(((PyObject *)__pyx_n_s__lattice));
- PyTuple_SET_ITEM(__pyx_k_tuple_162, 0, ((PyObject *)__pyx_n_s__lattice));
+ PyTuple_SET_ITEM(__pyx_k_tuple_167, 0, ((PyObject *)__pyx_n_s__lattice));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__lattice));
__Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr));
- PyTuple_SET_ITEM(__pyx_k_tuple_162, 1, ((PyObject *)__pyx_n_s__genexpr));
+ PyTuple_SET_ITEM(__pyx_k_tuple_167, 1, ((PyObject *)__pyx_n_s__genexpr));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr));
__Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr));
- PyTuple_SET_ITEM(__pyx_k_tuple_162, 2, ((PyObject *)__pyx_n_s__genexpr));
+ PyTuple_SET_ITEM(__pyx_k_tuple_167, 2, ((PyObject *)__pyx_n_s__genexpr));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_162));
- __pyx_k_codeobj_163 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_162, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_159, __pyx_n_s__decode_sentence, 115, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_163)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_167));
+ __pyx_k_codeobj_168 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_167, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_162, __pyx_n_s__decode_sentence, 118, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_168)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":118
+ /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":121
* return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice)
*
* def encode_words(words): # <<<<<<<<<<<<<<
* return tuple(sym_fromstring(word, True) for word in words)
*
*/
- __pyx_k_tuple_164 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_164)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_164);
+ __pyx_k_tuple_169 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_169)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_169);
__Pyx_INCREF(((PyObject *)__pyx_n_s__words));
- PyTuple_SET_ITEM(__pyx_k_tuple_164, 0, ((PyObject *)__pyx_n_s__words));
+ PyTuple_SET_ITEM(__pyx_k_tuple_169, 0, ((PyObject *)__pyx_n_s__words));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__words));
__Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr));
- PyTuple_SET_ITEM(__pyx_k_tuple_164, 1, ((PyObject *)__pyx_n_s__genexpr));
+ PyTuple_SET_ITEM(__pyx_k_tuple_169, 1, ((PyObject *)__pyx_n_s__genexpr));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr));
__Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr));
- PyTuple_SET_ITEM(__pyx_k_tuple_164, 2, ((PyObject *)__pyx_n_s__genexpr));
+ PyTuple_SET_ITEM(__pyx_k_tuple_169, 2, ((PyObject *)__pyx_n_s__genexpr));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_164));
- __pyx_k_codeobj_165 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_164, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_159, __pyx_n_s__encode_words, 118, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_165)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_169));
+ __pyx_k_codeobj_170 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_169, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_162, __pyx_n_s__encode_words, 121, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_170)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":121
+ /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":124
* return tuple(sym_fromstring(word, True) for word in words)
*
* def decode_words(syms): # <<<<<<<<<<<<<<
* return tuple(sym_tostring(sym) for sym in syms)
*/
- __pyx_k_tuple_166 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_166)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_166);
+ __pyx_k_tuple_171 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_171)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_171);
__Pyx_INCREF(((PyObject *)__pyx_n_s__syms));
- PyTuple_SET_ITEM(__pyx_k_tuple_166, 0, ((PyObject *)__pyx_n_s__syms));
+ PyTuple_SET_ITEM(__pyx_k_tuple_171, 0, ((PyObject *)__pyx_n_s__syms));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__syms));
__Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr));
- PyTuple_SET_ITEM(__pyx_k_tuple_166, 1, ((PyObject *)__pyx_n_s__genexpr));
+ PyTuple_SET_ITEM(__pyx_k_tuple_171, 1, ((PyObject *)__pyx_n_s__genexpr));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr));
__Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr));
- PyTuple_SET_ITEM(__pyx_k_tuple_166, 2, ((PyObject *)__pyx_n_s__genexpr));
+ PyTuple_SET_ITEM(__pyx_k_tuple_171, 2, ((PyObject *)__pyx_n_s__genexpr));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_166));
- __pyx_k_codeobj_167 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_166, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_159, __pyx_n_s__decode_words, 121, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_167)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_171));
+ __pyx_k_codeobj_172 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_171, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_162, __pyx_n_s__decode_words, 124, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_172)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2088
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2200
*
* # Spans are _inclusive_ on both ends [i, j]
* def span_check(vec, i, j): # <<<<<<<<<<<<<<
* k = i
* while k <= j:
*/
- __pyx_k_tuple_169 = PyTuple_New(4); if (unlikely(!__pyx_k_tuple_169)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_169);
+ __pyx_k_tuple_174 = PyTuple_New(4); if (unlikely(!__pyx_k_tuple_174)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_174);
__Pyx_INCREF(((PyObject *)__pyx_n_s__vec));
- PyTuple_SET_ITEM(__pyx_k_tuple_169, 0, ((PyObject *)__pyx_n_s__vec));
+ PyTuple_SET_ITEM(__pyx_k_tuple_174, 0, ((PyObject *)__pyx_n_s__vec));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__vec));
__Pyx_INCREF(((PyObject *)__pyx_n_s__i));
- PyTuple_SET_ITEM(__pyx_k_tuple_169, 1, ((PyObject *)__pyx_n_s__i));
+ PyTuple_SET_ITEM(__pyx_k_tuple_174, 1, ((PyObject *)__pyx_n_s__i));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__i));
__Pyx_INCREF(((PyObject *)__pyx_n_s__j));
- PyTuple_SET_ITEM(__pyx_k_tuple_169, 2, ((PyObject *)__pyx_n_s__j));
+ PyTuple_SET_ITEM(__pyx_k_tuple_174, 2, ((PyObject *)__pyx_n_s__j));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__j));
__Pyx_INCREF(((PyObject *)__pyx_n_s__k));
- PyTuple_SET_ITEM(__pyx_k_tuple_169, 3, ((PyObject *)__pyx_n_s__k));
+ PyTuple_SET_ITEM(__pyx_k_tuple_174, 3, ((PyObject *)__pyx_n_s__k));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__k));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_169));
- __pyx_k_codeobj_170 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_169, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_136, __pyx_n_s__span_check, 2088, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_170)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_174));
+ __pyx_k_codeobj_175 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_174, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_136, __pyx_n_s__span_check, 2200, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_175)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2096
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2208
* return True
*
* def span_inc(vec, i, j): # <<<<<<<<<<<<<<
* k = i
* while k <= j:
*/
- __pyx_k_tuple_171 = PyTuple_New(4); if (unlikely(!__pyx_k_tuple_171)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_171);
+ __pyx_k_tuple_176 = PyTuple_New(4); if (unlikely(!__pyx_k_tuple_176)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_176);
__Pyx_INCREF(((PyObject *)__pyx_n_s__vec));
- PyTuple_SET_ITEM(__pyx_k_tuple_171, 0, ((PyObject *)__pyx_n_s__vec));
+ PyTuple_SET_ITEM(__pyx_k_tuple_176, 0, ((PyObject *)__pyx_n_s__vec));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__vec));
__Pyx_INCREF(((PyObject *)__pyx_n_s__i));
- PyTuple_SET_ITEM(__pyx_k_tuple_171, 1, ((PyObject *)__pyx_n_s__i));
+ PyTuple_SET_ITEM(__pyx_k_tuple_176, 1, ((PyObject *)__pyx_n_s__i));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__i));
__Pyx_INCREF(((PyObject *)__pyx_n_s__j));
- PyTuple_SET_ITEM(__pyx_k_tuple_171, 2, ((PyObject *)__pyx_n_s__j));
+ PyTuple_SET_ITEM(__pyx_k_tuple_176, 2, ((PyObject *)__pyx_n_s__j));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__j));
__Pyx_INCREF(((PyObject *)__pyx_n_s__k));
- PyTuple_SET_ITEM(__pyx_k_tuple_171, 3, ((PyObject *)__pyx_n_s__k));
+ PyTuple_SET_ITEM(__pyx_k_tuple_176, 3, ((PyObject *)__pyx_n_s__k));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__k));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_171));
- __pyx_k_codeobj_172 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_171, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_136, __pyx_n_s__span_inc, 2096, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_172)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_176));
+ __pyx_k_codeobj_177 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_176, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_136, __pyx_n_s__span_inc, 2208, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_177)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2102
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2214
* k += 1
*
* def span_dec(vec, i, j): # <<<<<<<<<<<<<<
* k = i
* while k <= j:
*/
- __pyx_k_tuple_173 = PyTuple_New(4); if (unlikely(!__pyx_k_tuple_173)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_173);
+ __pyx_k_tuple_178 = PyTuple_New(4); if (unlikely(!__pyx_k_tuple_178)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_178);
__Pyx_INCREF(((PyObject *)__pyx_n_s__vec));
- PyTuple_SET_ITEM(__pyx_k_tuple_173, 0, ((PyObject *)__pyx_n_s__vec));
+ PyTuple_SET_ITEM(__pyx_k_tuple_178, 0, ((PyObject *)__pyx_n_s__vec));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__vec));
__Pyx_INCREF(((PyObject *)__pyx_n_s__i));
- PyTuple_SET_ITEM(__pyx_k_tuple_173, 1, ((PyObject *)__pyx_n_s__i));
+ PyTuple_SET_ITEM(__pyx_k_tuple_178, 1, ((PyObject *)__pyx_n_s__i));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__i));
__Pyx_INCREF(((PyObject *)__pyx_n_s__j));
- PyTuple_SET_ITEM(__pyx_k_tuple_173, 2, ((PyObject *)__pyx_n_s__j));
+ PyTuple_SET_ITEM(__pyx_k_tuple_178, 2, ((PyObject *)__pyx_n_s__j));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__j));
__Pyx_INCREF(((PyObject *)__pyx_n_s__k));
- PyTuple_SET_ITEM(__pyx_k_tuple_173, 3, ((PyObject *)__pyx_n_s__k));
+ PyTuple_SET_ITEM(__pyx_k_tuple_178, 3, ((PyObject *)__pyx_n_s__k));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__k));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_173));
- __pyx_k_codeobj_174 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_173, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_136, __pyx_n_s__span_dec, 2102, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_174)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_178));
+ __pyx_k_codeobj_179 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_178, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_136, __pyx_n_s__span_dec, 2214, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_179)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_RefNannyFinishContext();
return 0;
__pyx_L1_error:;
@@ -78167,24 +80940,24 @@ PyMODINIT_FUNC PyInit__sa(void)
if (__Pyx_SetVtable(__pyx_type_3_sa_SuffixArray.tp_dict, __pyx_vtabptr_3_sa_SuffixArray) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__Pyx_SetAttrString(__pyx_m, "SuffixArray", (PyObject *)&__pyx_type_3_sa_SuffixArray) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa_SuffixArray = &__pyx_type_3_sa_SuffixArray;
- if (PyType_Ready(&__pyx_type_3_sa_TrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__Pyx_SetAttrString(__pyx_m, "TrieNode", (PyObject *)&__pyx_type_3_sa_TrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_3_sa_TrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetAttrString(__pyx_m, "TrieNode", (PyObject *)&__pyx_type_3_sa_TrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa_TrieNode = &__pyx_type_3_sa_TrieNode;
__pyx_type_3_sa_ExtendedTrieNode.tp_base = __pyx_ptype_3_sa_TrieNode;
- if (PyType_Ready(&__pyx_type_3_sa_ExtendedTrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__Pyx_SetAttrString(__pyx_m, "ExtendedTrieNode", (PyObject *)&__pyx_type_3_sa_ExtendedTrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_3_sa_ExtendedTrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetAttrString(__pyx_m, "ExtendedTrieNode", (PyObject *)&__pyx_type_3_sa_ExtendedTrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa_ExtendedTrieNode = &__pyx_type_3_sa_ExtendedTrieNode;
- if (PyType_Ready(&__pyx_type_3_sa_TrieTable) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__Pyx_SetAttrString(__pyx_m, "TrieTable", (PyObject *)&__pyx_type_3_sa_TrieTable) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_3_sa_TrieTable) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetAttrString(__pyx_m, "TrieTable", (PyObject *)&__pyx_type_3_sa_TrieTable) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa_TrieTable = &__pyx_type_3_sa_TrieTable;
__pyx_vtabptr_3_sa_PhraseLocation = &__pyx_vtable_3_sa_PhraseLocation;
__pyx_vtable_3_sa_PhraseLocation.contains = (int (*)(struct __pyx_obj_3_sa_PhraseLocation *, int))__pyx_f_3_sa_14PhraseLocation_contains;
- if (PyType_Ready(&__pyx_type_3_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__Pyx_SetVtable(__pyx_type_3_sa_PhraseLocation.tp_dict, __pyx_vtabptr_3_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__Pyx_SetAttrString(__pyx_m, "PhraseLocation", (PyObject *)&__pyx_type_3_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_3_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetVtable(__pyx_type_3_sa_PhraseLocation.tp_dict, __pyx_vtabptr_3_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetAttrString(__pyx_m, "PhraseLocation", (PyObject *)&__pyx_type_3_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa_PhraseLocation = &__pyx_type_3_sa_PhraseLocation;
- if (PyType_Ready(&__pyx_type_3_sa_Sampler) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__Pyx_SetAttrString(__pyx_m, "Sampler", (PyObject *)&__pyx_type_3_sa_Sampler) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_3_sa_Sampler) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetAttrString(__pyx_m, "Sampler", (PyObject *)&__pyx_type_3_sa_Sampler) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa_Sampler = &__pyx_type_3_sa_Sampler;
__pyx_vtabptr_3_sa_HieroCachingRuleFactory = &__pyx_vtable_3_sa_HieroCachingRuleFactory;
__pyx_vtable_3_sa_HieroCachingRuleFactory.set_idmap = (PyObject *(*)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, struct __pyx_obj_3_sa_DataArray *))__pyx_f_3_sa_23HieroCachingRuleFactory_set_idmap;
@@ -78202,9 +80975,9 @@ PyMODINIT_FUNC PyInit__sa(void)
__pyx_vtable_3_sa_HieroCachingRuleFactory.extract_phrases = (PyObject *(*)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, int, int, int *, int *, int *, int, int, int, int *, int *, int *, int, int, int))__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases;
__pyx_vtable_3_sa_HieroCachingRuleFactory.create_alignments = (struct __pyx_obj_3_sa_IntList *(*)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, int *, int, PyObject *, PyObject *))__pyx_f_3_sa_23HieroCachingRuleFactory_create_alignments;
__pyx_vtable_3_sa_HieroCachingRuleFactory.extract = (PyObject *(*)(struct __pyx_obj_3_sa_HieroCachingRuleFactory *, struct __pyx_obj_3_sa_Phrase *, struct __pyx_t_3_sa_Matching *, int *, int))__pyx_f_3_sa_23HieroCachingRuleFactory_extract;
- if (PyType_Ready(&__pyx_type_3_sa_HieroCachingRuleFactory) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__Pyx_SetVtable(__pyx_type_3_sa_HieroCachingRuleFactory.tp_dict, __pyx_vtabptr_3_sa_HieroCachingRuleFactory) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__Pyx_SetAttrString(__pyx_m, "HieroCachingRuleFactory", (PyObject *)&__pyx_type_3_sa_HieroCachingRuleFactory) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_3_sa_HieroCachingRuleFactory) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetVtable(__pyx_type_3_sa_HieroCachingRuleFactory.tp_dict, __pyx_vtabptr_3_sa_HieroCachingRuleFactory) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetAttrString(__pyx_m, "HieroCachingRuleFactory", (PyObject *)&__pyx_type_3_sa_HieroCachingRuleFactory) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa_HieroCachingRuleFactory = &__pyx_type_3_sa_HieroCachingRuleFactory;
__pyx_vtabptr_3_sa_Scorer = &__pyx_vtable_3_sa_Scorer;
__pyx_vtable_3_sa_Scorer.score = (struct __pyx_obj_3_sa_FeatureVector *(*)(struct __pyx_obj_3_sa_Scorer *, PyObject *))__pyx_f_3_sa_6Scorer_score;
@@ -78220,27 +80993,27 @@ PyMODINIT_FUNC PyInit__sa(void)
__pyx_ptype_3_sa___pyx_scope_struct_2_genexpr = &__pyx_type_3_sa___pyx_scope_struct_2_genexpr;
if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_3_compute_stats) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa___pyx_scope_struct_3_compute_stats = &__pyx_type_3_sa___pyx_scope_struct_3_compute_stats;
- if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_4_make_lattice) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_4_make_lattice) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa___pyx_scope_struct_4_make_lattice = &__pyx_type_3_sa___pyx_scope_struct_4_make_lattice;
- if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_5_genexpr) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_5_genexpr) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa___pyx_scope_struct_5_genexpr = &__pyx_type_3_sa___pyx_scope_struct_5_genexpr;
- if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_6_genexpr) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_6_genexpr) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa___pyx_scope_struct_6_genexpr = &__pyx_type_3_sa___pyx_scope_struct_6_genexpr;
- if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_7_decode_lattice) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_7_decode_lattice) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa___pyx_scope_struct_7_decode_lattice = &__pyx_type_3_sa___pyx_scope_struct_7_decode_lattice;
- if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_8_genexpr) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_8_genexpr) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa___pyx_scope_struct_8_genexpr = &__pyx_type_3_sa___pyx_scope_struct_8_genexpr;
- if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_9_decode_sentence) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_9_decode_sentence) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa___pyx_scope_struct_9_decode_sentence = &__pyx_type_3_sa___pyx_scope_struct_9_decode_sentence;
- if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_10_genexpr) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_10_genexpr) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa___pyx_scope_struct_10_genexpr = &__pyx_type_3_sa___pyx_scope_struct_10_genexpr;
- if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_11_encode_words) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_11_encode_words) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa___pyx_scope_struct_11_encode_words = &__pyx_type_3_sa___pyx_scope_struct_11_encode_words;
- if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_12_genexpr) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_12_genexpr) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa___pyx_scope_struct_12_genexpr = &__pyx_type_3_sa___pyx_scope_struct_12_genexpr;
- if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_13_decode_words) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_13_decode_words) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa___pyx_scope_struct_13_decode_words = &__pyx_type_3_sa___pyx_scope_struct_13_decode_words;
- if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_14_genexpr) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_14_genexpr) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa___pyx_scope_struct_14_genexpr = &__pyx_type_3_sa___pyx_scope_struct_14_genexpr;
if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_15___iter__) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa___pyx_scope_struct_15___iter__ = &__pyx_type_3_sa___pyx_scope_struct_15___iter__;
@@ -78250,24 +81023,28 @@ PyMODINIT_FUNC PyInit__sa(void)
__pyx_ptype_3_sa___pyx_scope_struct_17_genexpr = &__pyx_type_3_sa___pyx_scope_struct_17_genexpr;
if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_18_alignments) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa___pyx_scope_struct_18_alignments = &__pyx_type_3_sa___pyx_scope_struct_18_alignments;
- if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_19_input) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_19_input) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa___pyx_scope_struct_19_input = &__pyx_type_3_sa___pyx_scope_struct_19_input;
- if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_20_add_instance) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_3_sa___pyx_scope_struct_20_add_instance = &__pyx_type_3_sa___pyx_scope_struct_20_add_instance;
- if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_21_form_rule) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_3_sa___pyx_scope_struct_21_form_rule = &__pyx_type_3_sa___pyx_scope_struct_21_form_rule;
- if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_22_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_3_sa___pyx_scope_struct_22_genexpr = &__pyx_type_3_sa___pyx_scope_struct_22_genexpr;
- if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_23_fmt_rule) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_3_sa___pyx_scope_struct_23_fmt_rule = &__pyx_type_3_sa___pyx_scope_struct_23_fmt_rule;
- if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_24_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_3_sa___pyx_scope_struct_24_genexpr = &__pyx_type_3_sa___pyx_scope_struct_24_genexpr;
- if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_25___iter__) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_3_sa___pyx_scope_struct_25___iter__ = &__pyx_type_3_sa___pyx_scope_struct_25___iter__;
- if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_26___str__) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_3_sa___pyx_scope_struct_26___str__ = &__pyx_type_3_sa___pyx_scope_struct_26___str__;
- if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_27_genexpr) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_3_sa___pyx_scope_struct_27_genexpr = &__pyx_type_3_sa___pyx_scope_struct_27_genexpr;
+ if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_20_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_3_sa___pyx_scope_struct_20_genexpr = &__pyx_type_3_sa___pyx_scope_struct_20_genexpr;
+ if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_21_add_instance) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_3_sa___pyx_scope_struct_21_add_instance = &__pyx_type_3_sa___pyx_scope_struct_21_add_instance;
+ if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_22_form_rule) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_3_sa___pyx_scope_struct_22_form_rule = &__pyx_type_3_sa___pyx_scope_struct_22_form_rule;
+ if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_23_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_3_sa___pyx_scope_struct_23_genexpr = &__pyx_type_3_sa___pyx_scope_struct_23_genexpr;
+ if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_24_fmt_rule) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_3_sa___pyx_scope_struct_24_fmt_rule = &__pyx_type_3_sa___pyx_scope_struct_24_fmt_rule;
+ if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_25_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_3_sa___pyx_scope_struct_25_genexpr = &__pyx_type_3_sa___pyx_scope_struct_25_genexpr;
+ if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_26_get_f_phrases) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_3_sa___pyx_scope_struct_26_get_f_phrases = &__pyx_type_3_sa___pyx_scope_struct_26_get_f_phrases;
+ if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_27___iter__) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_3_sa___pyx_scope_struct_27___iter__ = &__pyx_type_3_sa___pyx_scope_struct_27___iter__;
+ if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_28___str__) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_3_sa___pyx_scope_struct_28___str__ = &__pyx_type_3_sa___pyx_scope_struct_28___str__;
+ if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_29_genexpr) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_3_sa___pyx_scope_struct_29_genexpr = &__pyx_type_3_sa___pyx_scope_struct_29_genexpr;
/*--- Type import code ---*/
/*--- Variable import code ---*/
/*--- Function import code ---*/
@@ -78330,7 +81107,7 @@ PyMODINIT_FUNC PyInit__sa(void)
__pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__getLogger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_156), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_159), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_s__logger, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
@@ -78412,60 +81189,72 @@ PyMODINIT_FUNC PyInit__sa(void)
/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":107
* return ALPHABET.fromstring(string, terminal)
*
+ * def isvar(sym): # <<<<<<<<<<<<<<
+ * return sym_isvar(sym)
+ *
+ */
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3_sa_3isvar, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyObject_SetAttr(__pyx_m, __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;
+
+ /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":110
+ * return sym_isvar(sym)
+ *
* def make_lattice(words): # <<<<<<<<<<<<<<
* word_ids = (sym_fromstring(word, True) for word in words)
* return tuple(((word, None, 1), ) for word in word_ids)
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3_sa_3make_lattice, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3_sa_5make_lattice, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__make_lattice, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetAttr(__pyx_m, __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;
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":111
+ /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":114
* return tuple(((word, None, 1), ) for word in word_ids)
*
* def decode_lattice(lattice): # <<<<<<<<<<<<<<
* return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc
* for arc in node for node in lattice)
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3_sa_5decode_lattice, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3_sa_7decode_lattice, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__decode_lattice, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetAttr(__pyx_m, __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;
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":115
+ /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":118
* for arc in node for node in lattice)
*
* def decode_sentence(lattice): # <<<<<<<<<<<<<<
* return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice)
*
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3_sa_7decode_sentence, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3_sa_9decode_sentence, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__decode_sentence, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetAttr(__pyx_m, __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;
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":118
+ /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":121
* return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice)
*
* def encode_words(words): # <<<<<<<<<<<<<<
* return tuple(sym_fromstring(word, True) for word in words)
*
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3_sa_9encode_words, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3_sa_11encode_words, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__encode_words, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetAttr(__pyx_m, __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;
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":121
+ /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":124
* return tuple(sym_fromstring(word, True) for word in words)
*
* def decode_words(syms): # <<<<<<<<<<<<<<
* return tuple(sym_tostring(sym) for sym in syms)
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3_sa_11decode_words, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3_sa_13decode_words, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__decode_words, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetAttr(__pyx_m, __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;
/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":5
@@ -78556,7 +81345,7 @@ PyMODINIT_FUNC PyInit__sa(void)
* 'ephrase',
* 'paircount',
*/
- __pyx_t_1 = PyList_New(12); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(13); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_n_s__fphrase));
PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__fphrase));
@@ -78594,6 +81383,9 @@ PyMODINIT_FUNC PyInit__sa(void)
__Pyx_INCREF(((PyObject *)__pyx_n_s__meta));
PyList_SET_ITEM(__pyx_t_1, 11, ((PyObject *)__pyx_n_s__meta));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__meta));
+ __Pyx_INCREF(((PyObject *)__pyx_n_s__online));
+ PyList_SET_ITEM(__pyx_t_1, 12, ((PyObject *)__pyx_n_s__online));
+ __Pyx_GIVEREF(((PyObject *)__pyx_n_s__online));
__pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_n_s__FeatureContext));
@@ -78609,7 +81401,59 @@ PyMODINIT_FUNC PyInit__sa(void)
if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FeatureContext, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":29
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":30
+ * ])
+ *
+ * OnlineFeatureContext = namedtuple('OnlineFeatureContext', # <<<<<<<<<<<<<<
+ * ['fcount',
+ * 'fsample_count',
+ */
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__namedtuple); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":31
+ *
+ * OnlineFeatureContext = namedtuple('OnlineFeatureContext',
+ * ['fcount', # <<<<<<<<<<<<<<
+ * 'fsample_count',
+ * 'paircount',
+ */
+ __pyx_t_3 = PyList_New(6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(((PyObject *)__pyx_n_s__fcount));
+ PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_n_s__fcount));
+ __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fcount));
+ __Pyx_INCREF(((PyObject *)__pyx_n_s__fsample_count));
+ PyList_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__fsample_count));
+ __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fsample_count));
+ __Pyx_INCREF(((PyObject *)__pyx_n_s__paircount));
+ PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_n_s__paircount));
+ __Pyx_GIVEREF(((PyObject *)__pyx_n_s__paircount));
+ __Pyx_INCREF(((PyObject *)__pyx_n_s__bilex_f));
+ PyList_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_n_s__bilex_f));
+ __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bilex_f));
+ __Pyx_INCREF(((PyObject *)__pyx_n_s__bilex_e));
+ PyList_SET_ITEM(__pyx_t_3, 4, ((PyObject *)__pyx_n_s__bilex_e));
+ __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bilex_e));
+ __Pyx_INCREF(((PyObject *)__pyx_n_s__bilex_fe));
+ PyList_SET_ITEM(__pyx_t_3, 5, ((PyObject *)__pyx_n_s__bilex_fe));
+ __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bilex_fe));
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(((PyObject *)__pyx_n_s_151));
+ PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s_151));
+ __Pyx_GIVEREF(((PyObject *)__pyx_n_s_151));
+ PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_t_3));
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
+ __pyx_t_3 = 0;
+ __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_151, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":39
* ])
*
* cdef int PRECOMPUTE = 0 # <<<<<<<<<<<<<<
@@ -78618,7 +81462,7 @@ PyMODINIT_FUNC PyInit__sa(void)
*/
__pyx_v_3_sa_PRECOMPUTE = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":30
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":40
*
* cdef int PRECOMPUTE = 0
* cdef int MERGE = 1 # <<<<<<<<<<<<<<
@@ -78627,7 +81471,7 @@ PyMODINIT_FUNC PyInit__sa(void)
*/
__pyx_v_3_sa_MERGE = 1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":31
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":41
* cdef int PRECOMPUTE = 0
* cdef int MERGE = 1
* cdef int BAEZA_YATES = 2 # <<<<<<<<<<<<<<
@@ -78636,76 +81480,76 @@ PyMODINIT_FUNC PyInit__sa(void)
*/
__pyx_v_3_sa_BAEZA_YATES = 2;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":34
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":44
*
* # NOTE: was encoded as a non-terminal in the previous version
* cdef int EPSILON = sym_fromstring('*EPS*', True) # <<<<<<<<<<<<<<
*
* cdef class TrieNode:
*/
- __pyx_v_3_sa_EPSILON = __pyx_f_3_sa_sym_fromstring(__pyx_k_168, 1);
+ __pyx_v_3_sa_EPSILON = __pyx_f_3_sa_sym_fromstring(__pyx_k_173, 1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":57
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":67
* cdef public int count
* cdef public root
* def __cinit__(self, extended=False): # <<<<<<<<<<<<<<
* self.count = 0
* self.extended = extended
*/
- __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_k_99 = __pyx_t_1;
- __Pyx_GIVEREF(__pyx_t_1);
- __pyx_t_1 = 0;
+ __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_k_99 = __pyx_t_3;
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2088
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2200
*
* # Spans are _inclusive_ on both ends [i, j]
* def span_check(vec, i, j): # <<<<<<<<<<<<<<
* k = i
* while k <= j:
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3_sa_13span_check, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__span_check, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3_sa_15span_check, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__span_check, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2096
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2208
* return True
*
* def span_inc(vec, i, j): # <<<<<<<<<<<<<<
* k = i
* while k <= j:
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3_sa_15span_inc, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__span_inc, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3_sa_17span_inc, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__span_inc, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2102
+ /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2214
* k += 1
*
* def span_dec(vec, i, j): # <<<<<<<<<<<<<<
* k = i
* while k <= j:
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3_sa_17span_dec, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__span_dec, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3_sa_19span_dec, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__span_dec, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "/home/m/workspace/cdec/python/src/sa/features.pxi":1
* cdef StringMap FD = StringMap() # Feature name dictionary # <<<<<<<<<<<<<<
*
* INITIAL_CAPACITY = 7 # default number of features
*/
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_StringMap)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_StringMap)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
__Pyx_XGOTREF(((PyObject *)__pyx_v_3_sa_FD));
__Pyx_DECREF(((PyObject *)__pyx_v_3_sa_FD));
- __Pyx_GIVEREF(__pyx_t_1);
- __pyx_v_3_sa_FD = ((struct __pyx_obj_3_sa_StringMap *)__pyx_t_1);
- __pyx_t_1 = 0;
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_v_3_sa_FD = ((struct __pyx_obj_3_sa_StringMap *)__pyx_t_3);
+ __pyx_t_3 = 0;
/* "/home/m/workspace/cdec/python/src/sa/features.pxi":3
* cdef StringMap FD = StringMap() # Feature name dictionary
@@ -78723,20 +81567,20 @@ PyMODINIT_FUNC PyInit__sa(void)
*
* cdef class FeatureVector:
*/
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__INITIAL_CAPACITY); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__INCREMENT, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__INITIAL_CAPACITY); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__INCREMENT, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "_sa.pyx":1
* import logging # <<<<<<<<<<<<<<
* import resource
* import gzip
*/
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_1));
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
diff --git a/python/src/sa/default_scorer.pxi b/python/src/sa/default_scorer.pxi
deleted file mode 100644
index 483f4743..00000000
--- a/python/src/sa/default_scorer.pxi
+++ /dev/null
@@ -1,74 +0,0 @@
-from libc.stdlib cimport malloc, realloc, free
-from libc.math cimport log10
-
-MAXSCORE = -99
-EgivenFCoherent = 0
-SampleCountF = 1
-CountEF = 2
-MaxLexFgivenE = 3
-MaxLexEgivenF = 4
-IsSingletonF = 5
-IsSingletonFE = 6
-NFEATURES = 7
-
-cdef class DefaultScorer(Scorer):
- cdef BiLex ttable
- cdef int* fid
-
- def __dealloc__(self):
- free(self.fid)
-
- def __init__(self, BiLex ttable):
- self.ttable = ttable
- self.fid = <int*> malloc(NFEATURES*sizeof(int))
- cdef unsigned i
- for i, fnames in enumerate(('EgivenFCoherent', 'SampleCountF', 'CountEF',
- 'MaxLexFgivenE', 'MaxLexEgivenF', 'IsSingletonF', 'IsSingletonFE')):
- self.fid[i] = FD.index(fnames)
-
- cdef FeatureVector score(self, Phrase fphrase, Phrase ephrase,
- unsigned paircount, unsigned fcount, unsigned fsample_count):
- cdef FeatureVector scores = FeatureVector()
-
- # EgivenFCoherent
- cdef float efc = <float>paircount/fsample_count
- scores.set(self.fid[EgivenFCoherent], -log10(efc) if efc > 0 else MAXSCORE)
-
- # SampleCountF
- scores.set(self.fid[SampleCountF], log10(1 + fsample_count))
-
- # CountEF
- scores.set(self.fid[CountEF], log10(1 + paircount))
-
- # MaxLexFgivenE TODO typify
- ewords = ephrase.words
- ewords.append('NULL')
- cdef float mlfe = 0, max_score = -1
- for f in fphrase.words:
- for e in ewords:
- score = self.ttable.get_score(f, e, 1)
- if score > max_score:
- max_score = score
- mlfe += -log10(max_score) if max_score > 0 else MAXSCORE
- scores.set(self.fid[MaxLexFgivenE], mlfe)
-
- # MaxLexEgivenF TODO same
- fwords = fphrase.words
- fwords.append('NULL')
- cdef float mlef = 0
- max_score = -1
- for e in ephrase.words:
- for f in fwords:
- score = self.ttable.get_score(f, e, 0)
- if score > max_score:
- max_score = score
- mlef += -log10(max_score) if max_score > 0 else MAXSCORE
- scores.set(self.fid[MaxLexEgivenF], mlef)
-
- # IsSingletonF
- scores.set(self.fid[IsSingletonF], (fcount == 1))
-
- # IsSingletonFE
- scores.set(self.fid[IsSingletonFE], (paircount == 1))
-
- return scores
diff --git a/python/src/sa/rulefactory.pxi b/python/src/sa/rulefactory.pxi
index b10d25dd..7063c2da 100644
--- a/python/src/sa/rulefactory.pxi
+++ b/python/src/sa/rulefactory.pxi
@@ -23,7 +23,17 @@ FeatureContext = namedtuple('FeatureContext',
'test_sentence',
'f_text',
'e_text',
- 'meta'
+ 'meta',
+ 'online'
+ ])
+
+OnlineFeatureContext = namedtuple('OnlineFeatureContext',
+ ['fcount',
+ 'fsample_count',
+ 'paircount',
+ 'bilex_f',
+ 'bilex_e',
+ 'bilex_fe'
])
cdef int PRECOMPUTE = 0
@@ -264,6 +274,8 @@ cdef class HieroCachingRuleFactory:
cdef IntList findexes
cdef IntList findexes1
+ cdef bint online
+ cdef samples_f
cdef phrases_f
cdef phrases_e
cdef phrases_fe
@@ -381,6 +393,12 @@ cdef class HieroCachingRuleFactory:
# Online stats
+ # True after data is added
+ self.online = False
+
+ # Keep track of everything that can be sampled:
+ self.samples_f = defaultdict(int)
+
# Phrase counts
self.phrases_f = defaultdict(int)
self.phrases_e = defaultdict(int)
@@ -969,6 +987,11 @@ cdef class HieroCachingRuleFactory:
hit = 0
reachable_buffer = {}
+ # Phrase pairs processed by suffix array extractor. Do not re-extract
+ # during online extraction. This is probably the hackiest part of
+ # online grammar extraction.
+ seen_phrases = set()
+
# Do not cache between sentences
self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation())
@@ -1124,7 +1147,12 @@ cdef class HieroCachingRuleFactory:
f, e, count, fcount[f], num_samples,
(k,i+spanlen), locs, input_match,
fwords, self.fda, self.eda,
- meta))
+ meta,
+ # Include online stats. None if none.
+ self.online_ctx_lookup(f, e)))
+ # Phrase pair processed
+ if self.online:
+ seen_phrases.add((f, e))
yield Rule(self.category, f, e, scores, alignment)
if len(phrase) < self.max_length and i+spanlen < len(fwords) and pathlen+1 <= self.max_initial_size:
@@ -1148,7 +1176,29 @@ cdef class HieroCachingRuleFactory:
for (i, alt, pathlen) in frontier_nodes:
new_frontier.append((k, i, input_match + (i,), alt, pathlen, xnode, phrase +(xcat,), is_shadow_path))
frontier = new_frontier
-
+
+ # Online rule extraction and scoring
+ if self.online:
+ f_syms = tuple(word[0][0] for word in fwords)
+ for (f, lex_i, lex_j) in self.get_f_phrases(f_syms):
+ spanlen = (lex_j - lex_i) + 1
+ if not sym_isvar(f[0]):
+ spanlen += 1
+ if not sym_isvar(f[1]):
+ spanlen += 1
+ for e in self.phrases_fe.get(f, ()):
+ if (f, e) not in seen_phrases:
+ # Don't add multiple instances of the same phrase here
+ seen_phrases.add((f, e))
+ scores = self.scorer.score(FeatureContext(
+ f, e, 0, 0, 0,
+ spanlen, None, None,
+ fwords, self.fda, self.eda,
+ meta,
+ self.online_ctx_lookup(f, e)))
+ alignment = self.phrases_al[f][e]
+ yield Rule(self.category, f, e, scores, alignment)
+
stop_time = monitor_cpu()
logger.info("Total time for rule lookup, extraction, and scoring = %f seconds", (stop_time - start_time))
gc.collect()
@@ -1828,6 +1878,8 @@ cdef class HieroCachingRuleFactory:
# (Extract rules, update counts)
def add_instance(self, f_words, e_words, alignment):
+ self.online = True
+
# Rules extracted from this instance
# Track span of lexical items (terminals) to make
# sure we don't extract the same rule for the same
@@ -1970,11 +2022,17 @@ cdef class HieroCachingRuleFactory:
continue
extract(f_i, f_i, f_len + 1, -1, f_i, 0, [], [], False)
+ # Update possible phrases (samples)
+ # This could be more efficiently integrated with extraction
+ # at the cost of readability
+ for (f, lex_i, lex_j) in self.get_f_phrases(f_words):
+ self.samples_f[f] += 1
+
# Update phrase counts
for rule in rules:
(f_ph, e_ph, al) = rule[:3]
self.phrases_f[f_ph] += 1
- self.phrases_e[e_ph] += 1
+ self.phrases_e[e_ph] += 1
self.phrases_fe[f_ph][e_ph] += 1
if not self.phrases_al[f_ph][e_ph]:
self.phrases_al[f_ph][e_ph] = al
@@ -1987,7 +2045,6 @@ cdef class HieroCachingRuleFactory:
for e_w in e_words:
self.bilex_fe[f_w][e_w] += 1
-
# Create a rule from source, target, non-terminals, and alignments
def form_rule(self, f_i, e_i, f_span, e_span, nt, al):
@@ -2080,10 +2137,65 @@ cdef class HieroCachingRuleFactory:
for ph in self.phrases_e:
logger.info(str(ph) + ' ||| ' + str(self.phrases_e[ph]))
logger.info('FE')
+ self.dump_online_rules()
+
+ def dump_online_rules(self):
for ph in self.phrases_fe:
for ph2 in self.phrases_fe[ph]:
logger.info(self.fmt_rule(str(ph), str(ph2), self.phrases_al[ph][ph2]) + ' ||| ' + str(self.phrases_fe[ph][ph2]))
+
+ # 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):
+ if self.online:
+ fcount = self.phrases_f.get(f, 0)
+ fsample_count = self.samples_f.get(f, 0)
+ d = self.phrases_fe.get(f, None)
+ paircount = d.get(e, 0) if d else 0
+ return OnlineFeatureContext(fcount, fsample_count, paircount, self.bilex_f, self.bilex_e, self.bilex_fe)
+ return None
+
+ # Find all phrases that we might try to extract
+ # (Used for EGivenFCoherent)
+ # Return set of (fphrase, lex_i, lex_j)
+ def get_f_phrases(self, f_words):
+
+ f_len = len(f_words)
+ phrases = set() # (fphrase, lex_i, lex_j)
+ def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms):
+ # Phrase extraction limits
+ if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size:
+ return
+ # Extend with word
+ if wc + ntc < self.max_length:
+ syms.append(f_words[f_j])
+ f = Phrase(syms)
+ new_lex_i = min(lex_i, f_j)
+ new_lex_j = max(lex_j, f_j)
+ phrases.add((f, new_lex_i, new_lex_j))
+ extract(f_i, f_j + 1, new_lex_i, new_lex_j, wc + 1, ntc, syms)
+ syms.pop()
+ # Extend with existing non-terminal
+ if syms and sym_isvar(syms[-1]):
+ # Don't re-extract the same phrase
+ extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc, syms)
+ # Extend with new non-terminal
+ if wc + ntc < self.max_length:
+ if not syms or (ntc < self.max_nonterminals and not sym_isvar(syms[-1])):
+ syms.append(sym_setindex(self.category, ntc + 1))
+ f = Phrase(syms)
+ if wc > 0:
+ phrases.add((f, lex_i, lex_j))
+ extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc + 1, syms)
+ syms.pop()
+
+ # Try to extract phrases from every f index
+ for f_i from 0 <= f_i < f_len:
+ extract(f_i, f_i, f_len, -1, 0, 0, [])
+
+ return phrases
+
# Spans are _inclusive_ on both ends [i, j]
def span_check(vec, i, j):
k = i
diff --git a/python/src/sa/sym.pxi b/python/src/sa/sym.pxi
index 81f19ef1..f253aec0 100644
--- a/python/src/sa/sym.pxi
+++ b/python/src/sa/sym.pxi
@@ -104,6 +104,9 @@ cdef int sym_setindex(int sym, int id):
cdef int sym_fromstring(char* string, bint terminal):
return ALPHABET.fromstring(string, terminal)
+def isvar(sym):
+ return sym_isvar(sym)
+
def make_lattice(words):
word_ids = (sym_fromstring(word, True) for word in words)
return tuple(((word, None, 1), ) for word in word_ids)