summaryrefslogtreecommitdiff
path: root/python/cdec
diff options
context:
space:
mode:
Diffstat (limited to 'python/cdec')
-rw-r--r--python/cdec/sa/_sa.cpp9343
-rw-r--r--python/cdec/sa/compile.py6
-rw-r--r--python/cdec/sa/extractor.py10
-rw-r--r--python/cdec/sa/features.py63
-rw-r--r--python/cdec/sa/online.py72
-rw-r--r--python/cdec/sa/rulefactory.pxi42
6 files changed, 4015 insertions, 5521 deletions
diff --git a/python/cdec/sa/_sa.cpp b/python/cdec/sa/_sa.cpp
index 6e8b0a6f..e19d519c 100644
--- a/python/cdec/sa/_sa.cpp
+++ b/python/cdec/sa/_sa.cpp
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.19.2 on Thu Mar 6 14:00:22 2014 */
+/* Generated by Cython 0.19.2 on Fri Mar 7 01:47:56 2014 */
#define PY_SSIZE_T_CLEAN
#ifndef CYTHON_USE_PYLONG_INTERNALS
@@ -639,7 +639,7 @@ struct __pyx_t_4cdec_2sa_3_sa__Trie_Node {
int arr_len;
};
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":104
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":90
*
* # linked list structure for storing matches in BaselineRuleFactory
* cdef struct match_node: # <<<<<<<<<<<<<<
@@ -651,7 +651,7 @@ struct __pyx_t_4cdec_2sa_3_sa_match_node {
struct __pyx_t_4cdec_2sa_3_sa_match_node *next;
};
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":200
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":186
*
* # struct used to encapsulate a single matching
* cdef struct Matching: # <<<<<<<<<<<<<<
@@ -710,7 +710,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice {
};
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2149
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2109
*
* # Rule string from rule
* def fmt_rule(self, f, e, a): # <<<<<<<<<<<<<<
@@ -755,7 +755,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr {
};
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":40
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":36
* ])
*
* cdef class OnlineStats: # <<<<<<<<<<<<<<
@@ -769,10 +769,6 @@ struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats {
PyObject *phrases_e;
PyObject *phrases_fe;
PyObject *phrases_al;
- PyObject *bilex_f;
- PyObject *bilex_e;
- PyObject *bilex_fe;
- PyObject *bilex_ef;
};
@@ -810,7 +806,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_Phrase {
};
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":74
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":60
* cdef int EPSILON = sym_fromstring('*EPS*', True)
*
* cdef class TrieNode: # <<<<<<<<<<<<<<
@@ -822,6 +818,14 @@ struct __pyx_obj_4cdec_2sa_3_sa_TrieNode {
PyObject *children;
};
+
+/* "/home/mdenkows/cdec/python/cdec/sa/data_array.pxi":74
+ * def read_bitext(self, char* filename, int side):
+ * with gzip_or_text(filename) as fp:
+ * data = (line.split(' ||| ')[side] for line in fp) # <<<<<<<<<<<<<<
+ * self.read_text_data(data)
+ *
+ */
struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr {
PyObject_HEAD
struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext *__pyx_outer_scope;
@@ -863,7 +867,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr {
};
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2168
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2128
* # (Used for EGivenFCoherent)
* # Return set of (fphrase, lex_i, lex_j)
* def get_f_phrases(self, f_words): # <<<<<<<<<<<<<<
@@ -880,7 +884,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases {
};
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":80
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":66
* self.children = {}
*
* cdef class ExtendedTrieNode(TrieNode): # <<<<<<<<<<<<<<
@@ -910,7 +914,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_Alignment {
};
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":981
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":967
* return sorted(result);
*
* def input(self, fwords, meta, ctx_name=None): # <<<<<<<<<<<<<<
@@ -1019,7 +1023,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words {
};
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2145
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2105
* f = Phrase(f_sym)
* e = Phrase(e_sym)
* a = tuple(self.alignment.link(i, j) for i, j in links) # <<<<<<<<<<<<<<
@@ -1054,7 +1058,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_Rule {
};
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1196
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1182
* if self.online:
* stats = self.online_stats[ctx_name]
* f_syms = tuple(word[0][0] for word in fwords) # <<<<<<<<<<<<<<
@@ -1108,7 +1112,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ {
};
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1894
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1880
* # Aggregate stats from a training instance
* # (Extract rules, update counts)
* def add_instance(self, f_words, e_words, alignment, ctx_name=None): # <<<<<<<<<<<<<<
@@ -1253,7 +1257,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ {
};
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":91
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":77
*
*
* cdef class TrieTable: # <<<<<<<<<<<<<<
@@ -1281,7 +1285,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words {
};
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2150
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2110
* # 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) # <<<<<<<<<<<<<<
@@ -1332,7 +1336,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr {
};
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2084
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2044
*
* # Create a rule from source, target, non-terminals, and alignments
* def form_rule(self, f_i, e_i, f_span, e_span, nt, al): # <<<<<<<<<<<<<<
@@ -1391,7 +1395,7 @@ struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice {
};
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":112
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":98
* # in the suffix array; if discontiguous, it is the set of
* # actual locations (packed into an array)
* cdef class PhraseLocation: # <<<<<<<<<<<<<<
@@ -1424,7 +1428,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_Scorer {
};
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":134
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":120
*
*
* cdef class Sampler: # <<<<<<<<<<<<<<
@@ -1510,7 +1514,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_BitSetIterator {
};
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":256
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":242
*
*
* cdef class HieroCachingRuleFactory: # <<<<<<<<<<<<<<
@@ -1829,7 +1833,7 @@ struct __pyx_vtabstruct_4cdec_2sa_3_sa_FloatList {
static struct __pyx_vtabstruct_4cdec_2sa_3_sa_FloatList *__pyx_vtabptr_4cdec_2sa_3_sa_FloatList;
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":256
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":242
*
*
* cdef class HieroCachingRuleFactory: # <<<<<<<<<<<<<<
@@ -1888,7 +1892,7 @@ struct __pyx_vtabstruct_4cdec_2sa_3_sa_Phrase {
static struct __pyx_vtabstruct_4cdec_2sa_3_sa_Phrase *__pyx_vtabptr_4cdec_2sa_3_sa_Phrase;
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":112
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":98
* # in the suffix array; if discontiguous, it is the set of
* # actual locations (packed into an array)
* cdef class PhraseLocation: # <<<<<<<<<<<<<<
@@ -2761,8 +2765,6 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_14write_enhanced(struct _
static PyObject *__pyx_pf_4cdec_2sa_3_sa_11SuffixArray_16lookup(struct __pyx_obj_4cdec_2sa_3_sa_SuffixArray *__pyx_v_self, PyObject *__pyx_v_word, int __pyx_v_offset, int __pyx_v_low, int __pyx_v_high); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda2(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_lambda_funcdef_lambda3(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_lambda_funcdef_lambda4(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats___cinit__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4cdec_2sa_3_sa_11OnlineStats_9samples_f___get__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self); /* proto */
static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_9samples_f_2__set__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
@@ -2779,18 +2781,6 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_10phrases_fe_4__del__(struct __
static PyObject *__pyx_pf_4cdec_2sa_3_sa_11OnlineStats_10phrases_al___get__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self); /* proto */
static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_10phrases_al_2__set__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_10phrases_al_4__del__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_f___get__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self); /* proto */
-static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_f_2__set__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
-static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_f_4__del__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_e___get__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self); /* proto */
-static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_e_2__set__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
-static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_e_4__del__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe___get__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self); /* proto */
-static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe_2__set__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
-static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe_4__del__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef___get__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self); /* proto */
-static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef_2__set__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
-static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef_4__del__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self); /* proto */
static int __pyx_pf_4cdec_2sa_3_sa_8TrieNode___cinit__(struct __pyx_obj_4cdec_2sa_3_sa_TrieNode *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4cdec_2sa_3_sa_8TrieNode_8children___get__(struct __pyx_obj_4cdec_2sa_3_sa_TrieNode *__pyx_v_self); /* proto */
static int __pyx_pf_4cdec_2sa_3_sa_8TrieNode_8children_2__set__(struct __pyx_obj_4cdec_2sa_3_sa_TrieNode *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
@@ -2827,15 +2817,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_fwords, PyObject *__pyx_v_ifrom, PyObject *__pyx_v_dist); /* proto */
static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_fwords, PyObject *__pyx_v_ifrom, PyObject *__pyx_v_ito); /* proto */
static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_states(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v__columns, PyObject *__pyx_v_curr_idx, PyObject *__pyx_v_min_dist); /* proto */
-static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_lambda_funcdef_lambda5(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
+static PyObject *__pyx_lambda_funcdef_lambda4(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
+static PyObject *__pyx_lambda_funcdef_lambda3(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
+static PyObject *__pyx_lambda_funcdef_lambda5(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_2genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_22input(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_fwords, PyObject *__pyx_v_meta, PyObject *__pyx_v_ctx_name); /* proto */
static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(PyObject *__pyx_self, PyObject *__pyx_v_f_i, PyObject *__pyx_v_f_j, PyObject *__pyx_v_e_i, PyObject *__pyx_v_e_j, PyObject *__pyx_v_min_bound, PyObject *__pyx_v_wc, PyObject *__pyx_v_links, PyObject *__pyx_v_nt, PyObject *__pyx_v_nt_open); /* proto */
static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instance(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_f_words, PyObject *__pyx_v_e_words, PyObject *__pyx_v_alignment, PyObject *__pyx_v_ctx_name); /* proto */
-static PyObject *__pyx_lambda_funcdef_lambda8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
-static PyObject *__pyx_lambda_funcdef_lambda9(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
+static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
+static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_2genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_f_i, PyObject *__pyx_v_e_i, PyObject *__pyx_v_f_span, PyObject *__pyx_v_e_span, PyObject *__pyx_v_nt, PyObject *__pyx_v_al); /* proto */
static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_genexpr(PyObject *__pyx_self); /* proto */
@@ -2996,7 +2986,7 @@ static char __pyx_k_120[] = "{";
static char __pyx_k_122[] = "}";
static char __pyx_k_123[] = "get_precomputed_collocation";
static char __pyx_k_124[] = "double binary";
-static char __pyx_k_125[] = "HieroCachingRuleFactory.input.<locals>.lambda5.<locals>.<lambda>";
+static char __pyx_k_125[] = "HieroCachingRuleFactory.input.<locals>.lambda3.<locals>.<lambda>";
static char __pyx_k_126[] = "Keyword trie error";
static char __pyx_k_128[] = "HieroCachingRuleFactory.input.<locals>.<lambda>";
static char __pyx_k_129[] = "get_all_nodes_isteps_away";
@@ -3127,8 +3117,6 @@ 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";
@@ -3155,8 +3143,6 @@ 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_ef[] = "bilex_ef";
-static char __pyx_k__bilex_fe[] = "bilex_fe";
static char __pyx_k__category[] = "category";
static char __pyx_k__children[] = "children";
static char __pyx_k__ctx_name[] = "ctx_name";
@@ -3409,10 +3395,6 @@ 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_ef;
-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;
@@ -37282,7 +37264,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9__cinit___lambda1(PyObje
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":58
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":50
* self.phrases_f = defaultdict(int)
* self.phrases_e = defaultdict(int)
* self.phrases_fe = defaultdict(lambda: defaultdict(int)) # <<<<<<<<<<<<<<
@@ -37301,14 +37283,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_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 50; __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 = 58; __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 = 50; __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 = 58; __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 = 50; __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;
@@ -37342,12 +37324,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9__cinit___1lambda2(PyObj
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":59
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":51
* self.phrases_e = defaultdict(int)
* self.phrases_fe = defaultdict(lambda: defaultdict(int))
* self.phrases_al = defaultdict(lambda: defaultdict(tuple)) # <<<<<<<<<<<<<<
*
- * # Bilexical counts
+ * cdef int PRECOMPUTE = 0
*/
static PyObject *__pyx_lambda_funcdef_lambda2(CYTHON_UNUSED PyObject *__pyx_self) {
@@ -37361,14 +37343,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_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 51; __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 = 59; __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 = 51; __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 = 59; __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 = 51; __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;
@@ -37390,128 +37372,8 @@ static PyObject *__pyx_lambda_funcdef_lambda2(CYTHON_UNUSED PyObject *__pyx_self
return __pyx_r;
}
-/* Python wrapper */
-static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9__cinit___2lambda3(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_11OnlineStats_9__cinit___2lambda3 = {__Pyx_NAMESTR("lambda3"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9__cinit___2lambda3, METH_NOARGS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9__cinit___2lambda3(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("lambda3 (wrapper)", 0);
- __pyx_r = __pyx_lambda_funcdef_lambda3(__pyx_self);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":64
- * self.bilex_f = defaultdict(int)
- * self.bilex_e = defaultdict(int)
- * self.bilex_fe = defaultdict(lambda: defaultdict(int)) # <<<<<<<<<<<<<<
- * self.bilex_ef = defaultdict(lambda: defaultdict(int))
- *
- */
-
-static PyObject *__pyx_lambda_funcdef_lambda3(CYTHON_UNUSED PyObject *__pyx_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("lambda3", 0);
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); 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_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 64; __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 = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("cdec.sa._sa.OnlineStats.__cinit__.lambda3", __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_4cdec_2sa_3_sa_11OnlineStats_9__cinit___3lambda4(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_11OnlineStats_9__cinit___3lambda4 = {__Pyx_NAMESTR("lambda4"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9__cinit___3lambda4, METH_NOARGS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9__cinit___3lambda4(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("lambda4 (wrapper)", 0);
- __pyx_r = __pyx_lambda_funcdef_lambda4(__pyx_self);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":65
- * self.bilex_e = defaultdict(int)
- * self.bilex_fe = defaultdict(lambda: defaultdict(int))
- * self.bilex_ef = defaultdict(lambda: defaultdict(int)) # <<<<<<<<<<<<<<
- *
- * cdef int PRECOMPUTE = 0
- */
-
-static PyObject *__pyx_lambda_funcdef_lambda4(CYTHON_UNUSED PyObject *__pyx_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("lambda4", 0);
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); 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_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 65; __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 = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("cdec.sa._sa.OnlineStats.__cinit__.lambda4", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":51
- * cdef public bilex_ef
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":43
+ * cdef public phrases_al
*
* def __cinit__(self): # <<<<<<<<<<<<<<
* # Keep track of everything that can be sampled:
@@ -37529,21 +37391,21 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats___cinit__(struct __pyx_obj_4cde
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":53
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":45
* def __cinit__(self):
* # Keep track of everything that can be sampled:
* self.samples_f = defaultdict(int) # <<<<<<<<<<<<<<
*
* # Phrase counts
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 45; __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 = 53; __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 = 45; __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 = 53; __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 = 45; __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;
@@ -37553,21 +37415,21 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats___cinit__(struct __pyx_obj_4cde
__pyx_v_self->samples_f = __pyx_t_3;
__pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":56
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":48
*
* # Phrase counts
* self.phrases_f = defaultdict(int) # <<<<<<<<<<<<<<
* self.phrases_e = defaultdict(int)
* self.phrases_fe = defaultdict(lambda: defaultdict(int))
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 48; __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 = 56; __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 = 48; __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_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 48; __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;
@@ -37577,21 +37439,21 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats___cinit__(struct __pyx_obj_4cde
__pyx_v_self->phrases_f = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":57
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":49
* # 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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 49; __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 = 57; __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 = 49; __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 = 57; __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 = 49; __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;
@@ -37601,23 +37463,23 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats___cinit__(struct __pyx_obj_4cde
__pyx_v_self->phrases_e = __pyx_t_3;
__pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":58
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":50
* 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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_11OnlineStats_9__cinit___lambda1, 0, __pyx_n_s_101, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_11OnlineStats_9__cinit___lambda1, 0, __pyx_n_s_101, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 50; __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 = 58; __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 = 50; __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_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 50; __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_1)); __pyx_t_1 = 0;
@@ -37627,23 +37489,23 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats___cinit__(struct __pyx_obj_4cde
__pyx_v_self->phrases_fe = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":59
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":51
* self.phrases_e = defaultdict(int)
* self.phrases_fe = defaultdict(lambda: defaultdict(int))
* self.phrases_al = defaultdict(lambda: defaultdict(tuple)) # <<<<<<<<<<<<<<
*
- * # Bilexical counts
+ * cdef int PRECOMPUTE = 0
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_11OnlineStats_9__cinit___1lambda2, 0, __pyx_n_s_101, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_11OnlineStats_9__cinit___1lambda2, 0, __pyx_n_s_101, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 51; __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 = 59; __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 = 51; __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(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 59; __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 = 51; __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;
@@ -37653,106 +37515,6 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats___cinit__(struct __pyx_obj_4cde
__pyx_v_self->phrases_al = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":62
- *
- * # Bilexical counts
- * self.bilex_f = defaultdict(int) # <<<<<<<<<<<<<<
- * self.bilex_e = defaultdict(int)
- * self.bilex_fe = defaultdict(lambda: defaultdict(int))
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 62; __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 = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)((PyObject*)(&PyInt_Type))));
- __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- __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 = 62; __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_GIVEREF(__pyx_t_2);
- __Pyx_GOTREF(__pyx_v_self->bilex_f);
- __Pyx_DECREF(__pyx_v_self->bilex_f);
- __pyx_v_self->bilex_f = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":63
- * # Bilexical counts
- * self.bilex_f = defaultdict(int)
- * self.bilex_e = defaultdict(int) # <<<<<<<<<<<<<<
- * self.bilex_fe = defaultdict(lambda: defaultdict(int))
- * self.bilex_ef = defaultdict(lambda: defaultdict(int))
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 63; __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 = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)((PyObject*)(&PyInt_Type))));
- __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- __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 = 63; __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;
- __Pyx_GIVEREF(__pyx_t_1);
- __Pyx_GOTREF(__pyx_v_self->bilex_e);
- __Pyx_DECREF(__pyx_v_self->bilex_e);
- __pyx_v_self->bilex_e = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":64
- * self.bilex_f = defaultdict(int)
- * self.bilex_e = defaultdict(int)
- * self.bilex_fe = defaultdict(lambda: defaultdict(int)) # <<<<<<<<<<<<<<
- * self.bilex_ef = defaultdict(lambda: defaultdict(int))
- *
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); 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_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_11OnlineStats_9__cinit___2lambda3, 0, __pyx_n_s_101, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 64; __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 = 64; __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(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 64; __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_GIVEREF(__pyx_t_3);
- __Pyx_GOTREF(__pyx_v_self->bilex_fe);
- __Pyx_DECREF(__pyx_v_self->bilex_fe);
- __pyx_v_self->bilex_fe = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":65
- * self.bilex_e = defaultdict(int)
- * self.bilex_fe = defaultdict(lambda: defaultdict(int))
- * self.bilex_ef = defaultdict(lambda: defaultdict(int)) # <<<<<<<<<<<<<<
- *
- * cdef int PRECOMPUTE = 0
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_11OnlineStats_9__cinit___3lambda4, 0, __pyx_n_s_101, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 65; __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 = 65; __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_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 65; __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_1)); __pyx_t_1 = 0;
- __Pyx_GIVEREF(__pyx_t_2);
- __Pyx_GOTREF(__pyx_v_self->bilex_ef);
- __Pyx_DECREF(__pyx_v_self->bilex_ef);
- __pyx_v_self->bilex_ef = __pyx_t_2;
- __pyx_t_2 = 0;
-
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
@@ -37777,7 +37539,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9samples_f_1__get__(PyObj
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":41
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":37
*
* cdef class OnlineStats:
* cdef public samples_f # <<<<<<<<<<<<<<
@@ -37864,7 +37626,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9phrases_f_1__get__(PyObj
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":42
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":38
* cdef class OnlineStats:
* cdef public samples_f
* cdef public phrases_f # <<<<<<<<<<<<<<
@@ -37951,7 +37713,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_9phrases_e_1__get__(PyObj
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":43
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":39
* cdef public samples_f
* cdef public phrases_f
* cdef public phrases_e # <<<<<<<<<<<<<<
@@ -38038,12 +37800,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_10phrases_fe_1__get__(PyO
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":44
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":40
* cdef public phrases_f
* cdef public phrases_e
* cdef public phrases_fe # <<<<<<<<<<<<<<
* cdef public phrases_al
- * cdef public bilex_f
+ *
*/
static PyObject *__pyx_pf_4cdec_2sa_3_sa_11OnlineStats_10phrases_fe___get__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self) {
@@ -38125,12 +37887,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_10phrases_al_1__get__(PyO
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":45
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":41
* cdef public phrases_e
* cdef public phrases_fe
* cdef public phrases_al # <<<<<<<<<<<<<<
- * cdef public bilex_f
- * cdef public bilex_e
+ *
+ * def __cinit__(self):
*/
static PyObject *__pyx_pf_4cdec_2sa_3_sa_11OnlineStats_10phrases_al___get__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self) {
@@ -38202,354 +37964,6 @@ static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_10phrases_al_4__del__(struct __
}
/* Python wrapper */
-static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_f_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_f_1__get__(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_f___get__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":46
- * cdef public phrases_fe
- * cdef public phrases_al
- * cdef public bilex_f # <<<<<<<<<<<<<<
- * cdef public bilex_e
- * cdef public bilex_fe
- */
-
-static PyObject *__pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_f___get__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__", 0);
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_self->bilex_f);
- __pyx_r = __pyx_v_self->bilex_f;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_f_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
-static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_f_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
- __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_f_2__set__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self), ((PyObject *)__pyx_v_value));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_f_2__set__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self, PyObject *__pyx_v_value) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__set__", 0);
- __Pyx_INCREF(__pyx_v_value);
- __Pyx_GIVEREF(__pyx_v_value);
- __Pyx_GOTREF(__pyx_v_self->bilex_f);
- __Pyx_DECREF(__pyx_v_self->bilex_f);
- __pyx_v_self->bilex_f = __pyx_v_value;
-
- __pyx_r = 0;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_f_5__del__(PyObject *__pyx_v_self); /*proto*/
-static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_f_5__del__(PyObject *__pyx_v_self) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
- __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_f_4__del__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_f_4__del__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__del__", 0);
- __Pyx_INCREF(Py_None);
- __Pyx_GIVEREF(Py_None);
- __Pyx_GOTREF(__pyx_v_self->bilex_f);
- __Pyx_DECREF(__pyx_v_self->bilex_f);
- __pyx_v_self->bilex_f = Py_None;
-
- __pyx_r = 0;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_e_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_e_1__get__(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_e___get__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":47
- * cdef public phrases_al
- * cdef public bilex_f
- * cdef public bilex_e # <<<<<<<<<<<<<<
- * cdef public bilex_fe
- * cdef public bilex_ef
- */
-
-static PyObject *__pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_e___get__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__", 0);
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_self->bilex_e);
- __pyx_r = __pyx_v_self->bilex_e;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_e_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
-static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_e_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
- __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_e_2__set__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self), ((PyObject *)__pyx_v_value));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_e_2__set__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self, PyObject *__pyx_v_value) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__set__", 0);
- __Pyx_INCREF(__pyx_v_value);
- __Pyx_GIVEREF(__pyx_v_value);
- __Pyx_GOTREF(__pyx_v_self->bilex_e);
- __Pyx_DECREF(__pyx_v_self->bilex_e);
- __pyx_v_self->bilex_e = __pyx_v_value;
-
- __pyx_r = 0;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_e_5__del__(PyObject *__pyx_v_self); /*proto*/
-static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_e_5__del__(PyObject *__pyx_v_self) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
- __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_e_4__del__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_7bilex_e_4__del__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__del__", 0);
- __Pyx_INCREF(Py_None);
- __Pyx_GIVEREF(Py_None);
- __Pyx_GOTREF(__pyx_v_self->bilex_e);
- __Pyx_DECREF(__pyx_v_self->bilex_e);
- __pyx_v_self->bilex_e = Py_None;
-
- __pyx_r = 0;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe_1__get__(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe___get__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":48
- * cdef public bilex_f
- * cdef public bilex_e
- * cdef public bilex_fe # <<<<<<<<<<<<<<
- * cdef public bilex_ef
- *
- */
-
-static PyObject *__pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe___get__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__", 0);
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_self->bilex_fe);
- __pyx_r = __pyx_v_self->bilex_fe;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
-static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
- __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe_2__set__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self), ((PyObject *)__pyx_v_value));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe_2__set__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self, PyObject *__pyx_v_value) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__set__", 0);
- __Pyx_INCREF(__pyx_v_value);
- __Pyx_GIVEREF(__pyx_v_value);
- __Pyx_GOTREF(__pyx_v_self->bilex_fe);
- __Pyx_DECREF(__pyx_v_self->bilex_fe);
- __pyx_v_self->bilex_fe = __pyx_v_value;
-
- __pyx_r = 0;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe_5__del__(PyObject *__pyx_v_self); /*proto*/
-static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe_5__del__(PyObject *__pyx_v_self) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
- __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe_4__del__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe_4__del__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__del__", 0);
- __Pyx_INCREF(Py_None);
- __Pyx_GIVEREF(Py_None);
- __Pyx_GOTREF(__pyx_v_self->bilex_fe);
- __Pyx_DECREF(__pyx_v_self->bilex_fe);
- __pyx_v_self->bilex_fe = Py_None;
-
- __pyx_r = 0;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef_1__get__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef_1__get__(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef___get__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":49
- * cdef public bilex_e
- * cdef public bilex_fe
- * cdef public bilex_ef # <<<<<<<<<<<<<<
- *
- * def __cinit__(self):
- */
-
-static PyObject *__pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef___get__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__", 0);
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_self->bilex_ef);
- __pyx_r = __pyx_v_self->bilex_ef;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
-static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
- __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef_2__set__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self), ((PyObject *)__pyx_v_value));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef_2__set__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self, PyObject *__pyx_v_value) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__set__", 0);
- __Pyx_INCREF(__pyx_v_value);
- __Pyx_GIVEREF(__pyx_v_value);
- __Pyx_GOTREF(__pyx_v_self->bilex_ef);
- __Pyx_DECREF(__pyx_v_self->bilex_ef);
- __pyx_v_self->bilex_ef = __pyx_v_value;
-
- __pyx_r = 0;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef_5__del__(PyObject *__pyx_v_self); /*proto*/
-static int __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef_5__del__(PyObject *__pyx_v_self) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
- __pyx_r = __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef_4__del__(((struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static int __pyx_pf_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef_4__del__(struct __pyx_obj_4cdec_2sa_3_sa_OnlineStats *__pyx_v_self) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__del__", 0);
- __Pyx_INCREF(Py_None);
- __Pyx_GIVEREF(Py_None);
- __Pyx_GOTREF(__pyx_v_self->bilex_ef);
- __Pyx_DECREF(__pyx_v_self->bilex_ef);
- __pyx_v_self->bilex_ef = Py_None;
-
- __pyx_r = 0;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
static int __pyx_pw_4cdec_2sa_3_sa_8TrieNode_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_4cdec_2sa_3_sa_8TrieNode_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_r;
@@ -38563,7 +37977,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_8TrieNode_1__cinit__(PyObject *__pyx_v_self,
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":77
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":63
* cdef public children
*
* def __cinit__(self): # <<<<<<<<<<<<<<
@@ -38580,14 +37994,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_8TrieNode___cinit__(struct __pyx_obj_4cdec_2s
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":78
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":64
*
* 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 = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 64; __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);
@@ -38617,7 +38031,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_8TrieNode_8children_1__get__(PyObject *
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":75
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":61
*
* cdef class TrieNode:
* cdef public children # <<<<<<<<<<<<<<
@@ -38709,7 +38123,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_1__cinit__(PyObject *__pyx
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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":85
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":71
* cdef public suffix_link
*
* def __cinit__(self, phrase=None, phrase_location=None, suffix_link=None): # <<<<<<<<<<<<<<
@@ -38748,7 +38162,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_1__cinit__(PyObject *__pyx
}
}
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 = 85; __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 = 71; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -38765,7 +38179,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_1__cinit__(PyObject *__pyx
}
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 = 85; __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 = 71; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("cdec.sa._sa.ExtendedTrieNode.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -38781,7 +38195,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode___cinit__(struct __pyx_obj
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":86
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":72
*
* def __cinit__(self, phrase=None, phrase_location=None, suffix_link=None):
* self.phrase = phrase # <<<<<<<<<<<<<<
@@ -38794,7 +38208,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode___cinit__(struct __pyx_obj
__Pyx_DECREF(__pyx_v_self->phrase);
__pyx_v_self->phrase = __pyx_v_phrase;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":87
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":73
* def __cinit__(self, phrase=None, phrase_location=None, suffix_link=None):
* self.phrase = phrase
* self.phrase_location = phrase_location # <<<<<<<<<<<<<<
@@ -38807,7 +38221,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_16ExtendedTrieNode___cinit__(struct __pyx_obj
__Pyx_DECREF(__pyx_v_self->phrase_location);
__pyx_v_self->phrase_location = __pyx_v_phrase_location;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":88
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":74
* self.phrase = phrase
* self.phrase_location = phrase_location
* self.suffix_link = suffix_link # <<<<<<<<<<<<<<
@@ -38836,7 +38250,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_6phrase_1__get__(PyO
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":81
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":67
*
* cdef class ExtendedTrieNode(TrieNode):
* cdef public phrase # <<<<<<<<<<<<<<
@@ -38923,7 +38337,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_15phrase_location_1_
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":82
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":68
* cdef class ExtendedTrieNode(TrieNode):
* cdef public phrase
* cdef public phrase_location # <<<<<<<<<<<<<<
@@ -39010,7 +38424,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_16ExtendedTrieNode_11suffix_link_1__get
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":83
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":69
* cdef public phrase
* cdef public phrase_location
* cdef public suffix_link # <<<<<<<<<<<<<<
@@ -39117,7 +38531,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_9TrieTable_1__cinit__(PyObject *__pyx_v_self,
}
}
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 = 95; __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 = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -39130,7 +38544,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_9TrieTable_1__cinit__(PyObject *__pyx_v_self,
}
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 = 95; __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 = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("cdec.sa._sa.TrieTable.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -39141,7 +38555,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_9TrieTable_1__cinit__(PyObject *__pyx_v_self,
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":95
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":81
* cdef public int count
* cdef public root
* def __cinit__(self, extended=False): # <<<<<<<<<<<<<<
@@ -39160,7 +38574,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable___cinit__(struct __pyx_obj_4cdec_2
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":96
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":82
* cdef public root
* def __cinit__(self, extended=False):
* self.count = 0 # <<<<<<<<<<<<<<
@@ -39169,34 +38583,34 @@ static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable___cinit__(struct __pyx_obj_4cdec_2
*/
__pyx_v_self->count = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":97
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":83
* 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 = 97; __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 = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->extended = __pyx_t_1;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":98
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":84
* 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 = 98; __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 = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_2) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":99
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":85
* self.extended = extended
* if extended:
* self.root = ExtendedTrieNode() # <<<<<<<<<<<<<<
* else:
* self.root = TrieNode()
*/
- __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__Pyx_GOTREF(__pyx_v_self->root);
@@ -39207,14 +38621,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable___cinit__(struct __pyx_obj_4cdec_2
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":101
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":87
* self.root = ExtendedTrieNode()
* else:
* self.root = TrieNode() # <<<<<<<<<<<<<<
*
* # linked list structure for storing matches in BaselineRuleFactory
*/
- __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_TrieNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_TrieNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__Pyx_GOTREF(__pyx_v_self->root);
@@ -39246,7 +38660,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9TrieTable_8extended_1__get__(PyObject
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":92
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":78
*
* cdef class TrieTable:
* cdef public int extended # <<<<<<<<<<<<<<
@@ -39263,7 +38677,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9TrieTable_8extended___get__(struct __p
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 = 92; __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 = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -39300,7 +38714,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable_8extended_2__set__(struct __pyx_ob
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 = 92; __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 = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->extended = __pyx_t_1;
__pyx_r = 0;
@@ -39324,7 +38738,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9TrieTable_5count_1__get__(PyObject *__
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":93
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":79
* cdef class TrieTable:
* cdef public int extended
* cdef public int count # <<<<<<<<<<<<<<
@@ -39341,7 +38755,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_9TrieTable_5count___get__(struct __pyx_
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 = 93; __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 = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -39378,7 +38792,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable_5count_2__set__(struct __pyx_obj_4
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 = 93; __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 = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->count = __pyx_t_1;
__pyx_r = 0;
@@ -39402,7 +38816,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_9TrieTable_4root_1__get__(PyObject *__p
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":94
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":80
* cdef public int extended
* cdef public int count
* cdef public root # <<<<<<<<<<<<<<
@@ -39478,7 +38892,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_9TrieTable_4root_4__del__(struct __pyx_obj_4c
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":121
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":107
*
* # returns true if sent_id is contained
* cdef int contains(self, int sent_id): # <<<<<<<<<<<<<<
@@ -39491,7 +38905,7 @@ static int __pyx_f_4cdec_2sa_3_sa_14PhraseLocation_contains(CYTHON_UNUSED struct
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("contains", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":122
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":108
* # returns true if sent_id is contained
* cdef int contains(self, int sent_id):
* return 1 # <<<<<<<<<<<<<<
@@ -39526,7 +38940,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__sa_low,&__pyx_n_s__sa_high,&__pyx_n_s__arr_low,&__pyx_n_s__arr_high,&__pyx_n_s__arr,&__pyx_n_s__num_subpatterns,0};
PyObject* values[6] = {0,0,0,0,0,0};
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":125
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":111
*
* 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): # <<<<<<<<<<<<<<
@@ -39581,7 +38995,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_14PhraseLocation_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 = 124; __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -39596,35 +39010,35 @@ static int __pyx_pw_4cdec_2sa_3_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v
}
}
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 = 124; __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 = 110; __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 = 124; __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 = 110; __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 = 124; __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 = 110; __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 = 124; __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 = 110; __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 = 125; __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 = 111; __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 = 124; __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("cdec.sa._sa.PhraseLocation.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -39635,7 +39049,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":124
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":110
* return 1
*
* def __cinit__(self, int sa_low=-1, int sa_high=-1, int arr_low=-1, int arr_high=-1, # <<<<<<<<<<<<<<
@@ -39651,7 +39065,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_4
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":126
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":112
* 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 # <<<<<<<<<<<<<<
@@ -39660,7 +39074,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_4
*/
__pyx_v_self->sa_low = __pyx_v_sa_low;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":127
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":113
* arr=None, int num_subpatterns=1):
* self.sa_low = sa_low
* self.sa_high = sa_high # <<<<<<<<<<<<<<
@@ -39669,7 +39083,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_4
*/
__pyx_v_self->sa_high = __pyx_v_sa_high;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":128
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":114
* self.sa_low = sa_low
* self.sa_high = sa_high
* self.arr_low = arr_low # <<<<<<<<<<<<<<
@@ -39678,7 +39092,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_4
*/
__pyx_v_self->arr_low = __pyx_v_arr_low;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":129
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":115
* self.sa_high = sa_high
* self.arr_low = arr_low
* self.arr_high = arr_high # <<<<<<<<<<<<<<
@@ -39687,21 +39101,21 @@ static int __pyx_pf_4cdec_2sa_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_4
*/
__pyx_v_self->arr_high = __pyx_v_arr_high;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":130
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":116
* 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_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 116; __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_4cdec_2sa_3_sa_IntList *)__pyx_v_arr);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":131
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":117
* self.arr_high = arr_high
* self.arr = arr
* self.num_subpatterns = num_subpatterns # <<<<<<<<<<<<<<
@@ -39751,11 +39165,11 @@ static int __pyx_pw_4cdec_2sa_3_sa_7Sampler_1__cinit__(PyObject *__pyx_v_self, P
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 = 141; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 127; __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 = 141; __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 = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
@@ -39763,18 +39177,18 @@ static int __pyx_pw_4cdec_2sa_3_sa_7Sampler_1__cinit__(PyObject *__pyx_v_self, P
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 = 141; __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 = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_v_fsarray = ((struct __pyx_obj_4cdec_2sa_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 = 141; __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 = 127; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("cdec.sa._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_4cdec_2sa_3_sa_SuffixArray, 1, "fsarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fsarray), __pyx_ptype_4cdec_2sa_3_sa_SuffixArray, 1, "fsarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_r = __pyx_pf_4cdec_2sa_3_sa_7Sampler___cinit__(((struct __pyx_obj_4cdec_2sa_3_sa_Sampler *)__pyx_v_self), __pyx_v_sample_size, __pyx_v_fsarray);
goto __pyx_L0;
__pyx_L1_error:;
@@ -39784,7 +39198,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_7Sampler_1__cinit__(PyObject *__pyx_v_self, P
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":141
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":127
* cdef IntList sa
*
* def __cinit__(self, int sample_size, SuffixArray fsarray): # <<<<<<<<<<<<<<
@@ -39804,7 +39218,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7Sampler___cinit__(struct __pyx_obj_4cdec_2sa
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":142
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":128
*
* def __cinit__(self, int sample_size, SuffixArray fsarray):
* self.sample_size = sample_size # <<<<<<<<<<<<<<
@@ -39813,7 +39227,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7Sampler___cinit__(struct __pyx_obj_4cdec_2sa
*/
__pyx_v_self->sample_size = __pyx_v_sample_size;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":143
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":129
* def __cinit__(self, int sample_size, SuffixArray fsarray):
* self.sample_size = sample_size
* self.sa = fsarray.sa # <<<<<<<<<<<<<<
@@ -39828,7 +39242,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7Sampler___cinit__(struct __pyx_obj_4cdec_2sa
__pyx_v_self->sa = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":144
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":130
* self.sample_size = sample_size
* self.sa = fsarray.sa
* if sample_size > 0: # <<<<<<<<<<<<<<
@@ -39838,21 +39252,21 @@ static int __pyx_pf_4cdec_2sa_3_sa_7Sampler___cinit__(struct __pyx_obj_4cdec_2sa
__pyx_t_2 = ((__pyx_v_sample_size > 0) != 0);
if (__pyx_t_2) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":145
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":131
* 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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyInt_FromLong(__pyx_v_sample_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_v_sample_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 145; __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 = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_104));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_104));
@@ -39860,7 +39274,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_7Sampler___cinit__(struct __pyx_obj_4cdec_2sa
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 131; __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_4)); __pyx_t_4 = 0;
@@ -39869,19 +39283,19 @@ static int __pyx_pf_4cdec_2sa_3_sa_7Sampler___cinit__(struct __pyx_obj_4cdec_2sa
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":147
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":133
* 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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 133; __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_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_106), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_106), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -39911,7 +39325,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7Sampler_3sample(PyObject *__pyx_v_self
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("sample (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_phrase_location), __pyx_ptype_4cdec_2sa_3_sa_PhraseLocation, 1, "phrase_location", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_phrase_location), __pyx_ptype_4cdec_2sa_3_sa_PhraseLocation, 1, "phrase_location", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_r = __pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(((struct __pyx_obj_4cdec_2sa_3_sa_Sampler *)__pyx_v_self), ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)__pyx_v_phrase_location));
goto __pyx_L0;
__pyx_L1_error:;
@@ -39921,7 +39335,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_7Sampler_3sample(PyObject *__pyx_v_self
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":149
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":135
* logger.info("Sampling strategy: no sampling")
*
* def sample(self, PhraseLocation phrase_location): # <<<<<<<<<<<<<<
@@ -39948,19 +39362,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("sample", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":162
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":148
* 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_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_sample = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":163
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":149
*
* sample = IntList()
* if phrase_location.arr is None: # <<<<<<<<<<<<<<
@@ -39971,7 +39385,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":164
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":150
* sample = IntList()
* if phrase_location.arr is None:
* num_locations = phrase_location.sa_high - phrase_location.sa_low # <<<<<<<<<<<<<<
@@ -39980,7 +39394,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
*/
__pyx_v_num_locations = (__pyx_v_phrase_location->sa_high - __pyx_v_phrase_location->sa_low);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":165
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":151
* 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: # <<<<<<<<<<<<<<
@@ -39996,7 +39410,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
}
if (__pyx_t_4) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":166
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":152
* 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) # <<<<<<<<<<<<<<
@@ -40008,7 +39422,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":168
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":154
* sample._extend_arr(self.sa.arr + phrase_location.sa_low, num_locations)
* else:
* stepsize = float(num_locations)/float(self.sample_size) # <<<<<<<<<<<<<<
@@ -40023,11 +39437,11 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
#ifdef WITH_THREAD
PyGILState_Release(__pyx_gilstate_save);
#endif
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_v_stepsize = (((double)__pyx_v_num_locations) / ((double)__pyx_v_self->sample_size));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":169
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":155
* else:
* stepsize = float(num_locations)/float(self.sample_size)
* i = phrase_location.sa_low # <<<<<<<<<<<<<<
@@ -40037,7 +39451,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
__pyx_t_5 = __pyx_v_phrase_location->sa_low;
__pyx_v_i = __pyx_t_5;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":170
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":156
* 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: # <<<<<<<<<<<<<<
@@ -40054,7 +39468,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
}
if (!__pyx_t_2) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":173
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":159
* '''Note: int(i) not guaranteed to have the desired
* effect, according to the python documentation'''
* if fmod(i,1.0) > 0.5: # <<<<<<<<<<<<<<
@@ -40064,7 +39478,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
__pyx_t_2 = ((fmod(__pyx_v_i, 1.0) > 0.5) != 0);
if (__pyx_t_2) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":174
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":160
* effect, according to the python documentation'''
* if fmod(i,1.0) > 0.5:
* val = int(ceil(i)) # <<<<<<<<<<<<<<
@@ -40076,7 +39490,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":176
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":162
* val = int(ceil(i))
* else:
* val = int(floor(i)) # <<<<<<<<<<<<<<
@@ -40087,7 +39501,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
}
__pyx_L7:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":177
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":163
* else:
* val = int(floor(i))
* sample._append(self.sa.arr[val]) # <<<<<<<<<<<<<<
@@ -40096,7 +39510,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_sample->__pyx_vtab)->_append(__pyx_v_sample, (__pyx_v_self->sa->arr[__pyx_v_val]));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":178
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":164
* val = int(floor(i))
* sample._append(self.sa.arr[val])
* i = i + stepsize # <<<<<<<<<<<<<<
@@ -40111,7 +39525,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":180
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":166
* i = i + stepsize
* else:
* num_locations = (phrase_location.arr_high - phrase_location.arr_low) / phrase_location.num_subpatterns # <<<<<<<<<<<<<<
@@ -40127,7 +39541,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
#ifdef WITH_THREAD
PyGILState_Release(__pyx_gilstate_save);
#endif
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 166; __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))) {
#ifdef WITH_THREAD
@@ -40137,11 +39551,11 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
#ifdef WITH_THREAD
PyGILState_Release(__pyx_gilstate_save);
#endif
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_v_num_locations = __Pyx_div_int(__pyx_t_5, __pyx_v_phrase_location->num_subpatterns);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":181
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":167
* 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: # <<<<<<<<<<<<<<
@@ -40157,7 +39571,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
}
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":182
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":168
* 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 # <<<<<<<<<<<<<<
@@ -40172,7 +39586,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":184
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":170
* sample = phrase_location.arr
* else:
* stepsize = float(num_locations)/float(self.sample_size) # <<<<<<<<<<<<<<
@@ -40187,11 +39601,11 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
#ifdef WITH_THREAD
PyGILState_Release(__pyx_gilstate_save);
#endif
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_v_stepsize = (((double)__pyx_v_num_locations) / ((double)__pyx_v_self->sample_size));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":185
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":171
* else:
* stepsize = float(num_locations)/float(self.sample_size)
* i = phrase_location.arr_low # <<<<<<<<<<<<<<
@@ -40201,7 +39615,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
__pyx_t_5 = __pyx_v_phrase_location->arr_low;
__pyx_v_i = __pyx_t_5;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":186
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":172
* 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: # <<<<<<<<<<<<<<
@@ -40218,7 +39632,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
}
if (!__pyx_t_4) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":189
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":175
* '''Note: int(i) not guaranteed to have the desired
* effect, according to the python documentation'''
* if fmod(i,1.0) > 0.5: # <<<<<<<<<<<<<<
@@ -40228,7 +39642,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
__pyx_t_4 = ((fmod(__pyx_v_i, 1.0) > 0.5) != 0);
if (__pyx_t_4) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":190
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":176
* effect, according to the python documentation'''
* if fmod(i,1.0) > 0.5:
* val = int(ceil(i)) # <<<<<<<<<<<<<<
@@ -40240,7 +39654,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":192
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":178
* val = int(ceil(i))
* else:
* val = int(floor(i)) # <<<<<<<<<<<<<<
@@ -40251,7 +39665,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
}
__pyx_L11:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":193
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":179
* else:
* val = int(floor(i))
* j = phrase_location.arr_low + (val*phrase_location.num_subpatterns) # <<<<<<<<<<<<<<
@@ -40260,7 +39674,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
*/
__pyx_v_j = (__pyx_v_phrase_location->arr_low + (__pyx_v_val * __pyx_v_phrase_location->num_subpatterns));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":194
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":180
* 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) # <<<<<<<<<<<<<<
@@ -40269,7 +39683,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_sample->__pyx_vtab)->_extend_arr(__pyx_v_sample, (__pyx_v_phrase_location->arr->arr + __pyx_v_j), __pyx_v_phrase_location->num_subpatterns);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":195
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":181
* 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 # <<<<<<<<<<<<<<
@@ -40283,7 +39697,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
}
__pyx_L3:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":196
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":182
* sample._extend_arr(phrase_location.arr.arr + j, phrase_location.num_subpatterns)
* i = i + stepsize
* return sample # <<<<<<<<<<<<<<
@@ -40308,7 +39722,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_7Sampler_2sample(struct __pyx_obj_4cdec
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":208
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":194
*
*
* cdef void assign_matching(Matching* m, int* arr, int start, int step, int* sent_id_arr): # <<<<<<<<<<<<<<
@@ -40320,7 +39734,7 @@ static void __pyx_f_4cdec_2sa_3_sa_assign_matching(struct __pyx_t_4cdec_2sa_3_sa
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("assign_matching", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":209
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":195
*
* cdef void assign_matching(Matching* m, int* arr, int start, int step, int* sent_id_arr):
* m.arr = arr # <<<<<<<<<<<<<<
@@ -40329,7 +39743,7 @@ static void __pyx_f_4cdec_2sa_3_sa_assign_matching(struct __pyx_t_4cdec_2sa_3_sa
*/
__pyx_v_m->arr = __pyx_v_arr;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":210
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":196
* cdef void assign_matching(Matching* m, int* arr, int start, int step, int* sent_id_arr):
* m.arr = arr
* m.start = start # <<<<<<<<<<<<<<
@@ -40338,7 +39752,7 @@ static void __pyx_f_4cdec_2sa_3_sa_assign_matching(struct __pyx_t_4cdec_2sa_3_sa
*/
__pyx_v_m->start = __pyx_v_start;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":211
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":197
* m.arr = arr
* m.start = start
* m.end = start + step # <<<<<<<<<<<<<<
@@ -40347,7 +39761,7 @@ static void __pyx_f_4cdec_2sa_3_sa_assign_matching(struct __pyx_t_4cdec_2sa_3_sa
*/
__pyx_v_m->end = (__pyx_v_start + __pyx_v_step);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":212
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":198
* m.start = start
* m.end = start + step
* m.sent_id = sent_id_arr[arr[start]] # <<<<<<<<<<<<<<
@@ -40356,7 +39770,7 @@ static void __pyx_f_4cdec_2sa_3_sa_assign_matching(struct __pyx_t_4cdec_2sa_3_sa
*/
__pyx_v_m->sent_id = (__pyx_v_sent_id_arr[(__pyx_v_arr[__pyx_v_start])]);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":213
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":199
* m.end = start + step
* m.sent_id = sent_id_arr[arr[start]]
* m.size = step # <<<<<<<<<<<<<<
@@ -40368,7 +39782,7 @@ static void __pyx_f_4cdec_2sa_3_sa_assign_matching(struct __pyx_t_4cdec_2sa_3_sa
__Pyx_RefNannyFinishContext();
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":216
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":202
*
*
* cdef int* append_combined_matching(int* arr, Matching* loc1, Matching* loc2, # <<<<<<<<<<<<<<
@@ -40385,7 +39799,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st
int __pyx_t_2;
__Pyx_RefNannySetupContext("append_combined_matching", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":220
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":206
* cdef int i, new_len
*
* new_len = result_len[0] + num_subpatterns # <<<<<<<<<<<<<<
@@ -40394,7 +39808,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st
*/
__pyx_v_new_len = ((__pyx_v_result_len[0]) + __pyx_v_num_subpatterns);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":221
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":207
*
* new_len = result_len[0] + num_subpatterns
* arr = <int*> realloc(arr, new_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -40403,7 +39817,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st
*/
__pyx_v_arr = ((int *)realloc(__pyx_v_arr, (__pyx_v_new_len * (sizeof(int)))));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":223
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":209
* arr = <int*> realloc(arr, new_len*sizeof(int))
*
* for i from 0 <= i < loc1.size: # <<<<<<<<<<<<<<
@@ -40413,7 +39827,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st
__pyx_t_1 = __pyx_v_loc1->size;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":224
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":210
*
* for i from 0 <= i < loc1.size:
* arr[result_len[0]+i] = loc1.arr[loc1.start+i] # <<<<<<<<<<<<<<
@@ -40423,7 +39837,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st
(__pyx_v_arr[((__pyx_v_result_len[0]) + __pyx_v_i)]) = (__pyx_v_loc1->arr[(__pyx_v_loc1->start + __pyx_v_i)]);
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":225
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":211
* for i from 0 <= i < loc1.size:
* arr[result_len[0]+i] = loc1.arr[loc1.start+i]
* if num_subpatterns > loc1.size: # <<<<<<<<<<<<<<
@@ -40433,7 +39847,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st
__pyx_t_2 = ((__pyx_v_num_subpatterns > __pyx_v_loc1->size) != 0);
if (__pyx_t_2) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":226
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":212
* arr[result_len[0]+i] = loc1.arr[loc1.start+i]
* if num_subpatterns > loc1.size:
* arr[new_len-1] = loc2.arr[loc2.end-1] # <<<<<<<<<<<<<<
@@ -40445,7 +39859,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st
}
__pyx_L5:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":227
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":213
* if num_subpatterns > loc1.size:
* arr[new_len-1] = loc2.arr[loc2.end-1]
* result_len[0] = new_len # <<<<<<<<<<<<<<
@@ -40454,7 +39868,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st
*/
(__pyx_v_result_len[0]) = __pyx_v_new_len;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":228
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":214
* arr[new_len-1] = loc2.arr[loc2.end-1]
* result_len[0] = new_len
* return arr # <<<<<<<<<<<<<<
@@ -40470,7 +39884,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_append_combined_matching(int *__pyx_v_arr, st
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":231
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":217
*
*
* cdef int* extend_arr(int* arr, int* arr_len, int* appendix, int appendix_len): # <<<<<<<<<<<<<<
@@ -40484,7 +39898,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("extend_arr", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":234
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":220
* cdef int new_len
*
* new_len = arr_len[0] + appendix_len # <<<<<<<<<<<<<<
@@ -40493,7 +39907,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr
*/
__pyx_v_new_len = ((__pyx_v_arr_len[0]) + __pyx_v_appendix_len);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":235
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":221
*
* new_len = arr_len[0] + appendix_len
* arr = <int*> realloc(arr, new_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -40502,7 +39916,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr
*/
__pyx_v_arr = ((int *)realloc(__pyx_v_arr, (__pyx_v_new_len * (sizeof(int)))));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":236
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":222
* 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)) # <<<<<<<<<<<<<<
@@ -40511,7 +39925,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr
*/
memcpy((__pyx_v_arr + (__pyx_v_arr_len[0])), __pyx_v_appendix, (__pyx_v_appendix_len * (sizeof(int))));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":237
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":223
* arr = <int*> realloc(arr, new_len*sizeof(int))
* memcpy(arr+arr_len[0], appendix, appendix_len*sizeof(int))
* arr_len[0] = new_len # <<<<<<<<<<<<<<
@@ -40520,7 +39934,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr
*/
(__pyx_v_arr_len[0]) = __pyx_v_new_len;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":238
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":224
* memcpy(arr+arr_len[0], appendix, appendix_len*sizeof(int))
* arr_len[0] = new_len
* return arr # <<<<<<<<<<<<<<
@@ -40536,7 +39950,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":240
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":226
* return arr
*
* cdef int median(int low, int high, int step): # <<<<<<<<<<<<<<
@@ -40553,7 +39967,7 @@ static int __pyx_f_4cdec_2sa_3_sa_median(int __pyx_v_low, int __pyx_v_high, int
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("median", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":241
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":227
*
* cdef int median(int low, int high, int step):
* return low + (((high - low)/step)/2)*step # <<<<<<<<<<<<<<
@@ -40569,7 +39983,7 @@ static int __pyx_f_4cdec_2sa_3_sa_median(int __pyx_v_low, int __pyx_v_high, int
#ifdef WITH_THREAD
PyGILState_Release(__pyx_gilstate_save);
#endif
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 227; __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))) {
#ifdef WITH_THREAD
@@ -40579,7 +39993,7 @@ static int __pyx_f_4cdec_2sa_3_sa_median(int __pyx_v_low, int __pyx_v_high, int
#ifdef WITH_THREAD
PyGILState_Release(__pyx_gilstate_save);
#endif
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 227; __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;
@@ -40594,7 +40008,7 @@ static int __pyx_f_4cdec_2sa_3_sa_median(int __pyx_v_low, int __pyx_v_high, int
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":244
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":230
*
*
* cdef void find_comparable_matchings(int low, int high, int* arr, int step, int loc, int* loc_minus, int* loc_plus): # <<<<<<<<<<<<<<
@@ -40609,7 +40023,7 @@ static void __pyx_f_4cdec_2sa_3_sa_find_comparable_matchings(int __pyx_v_low, in
int __pyx_t_3;
__Pyx_RefNannySetupContext("find_comparable_matchings", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":248
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":234
* # in which all matchings have the same first index as the one
* # starting at loc
* loc_plus[0] = loc + step # <<<<<<<<<<<<<<
@@ -40618,7 +40032,7 @@ static void __pyx_f_4cdec_2sa_3_sa_find_comparable_matchings(int __pyx_v_low, in
*/
(__pyx_v_loc_plus[0]) = (__pyx_v_loc + __pyx_v_step);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":249
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":235
* # starting at loc
* loc_plus[0] = loc + step
* while loc_plus[0] < high and arr[loc_plus[0]] == arr[loc]: # <<<<<<<<<<<<<<
@@ -40635,7 +40049,7 @@ static void __pyx_f_4cdec_2sa_3_sa_find_comparable_matchings(int __pyx_v_low, in
}
if (!__pyx_t_3) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":250
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":236
* loc_plus[0] = loc + step
* while loc_plus[0] < high and arr[loc_plus[0]] == arr[loc]:
* loc_plus[0] = loc_plus[0] + step # <<<<<<<<<<<<<<
@@ -40645,7 +40059,7 @@ static void __pyx_f_4cdec_2sa_3_sa_find_comparable_matchings(int __pyx_v_low, in
(__pyx_v_loc_plus[0]) = ((__pyx_v_loc_plus[0]) + __pyx_v_step);
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":251
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":237
* while loc_plus[0] < high and arr[loc_plus[0]] == arr[loc]:
* loc_plus[0] = loc_plus[0] + step
* loc_minus[0] = loc # <<<<<<<<<<<<<<
@@ -40654,7 +40068,7 @@ static void __pyx_f_4cdec_2sa_3_sa_find_comparable_matchings(int __pyx_v_low, in
*/
(__pyx_v_loc_minus[0]) = __pyx_v_loc;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":252
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":238
* 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]: # <<<<<<<<<<<<<<
@@ -40671,7 +40085,7 @@ static void __pyx_f_4cdec_2sa_3_sa_find_comparable_matchings(int __pyx_v_low, in
}
if (!__pyx_t_2) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":253
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":239
* 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 # <<<<<<<<<<<<<<
@@ -40718,7 +40132,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject
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_72,&__pyx_n_s__precompute_rank,&__pyx_n_s_107,&__pyx_n_s_108,&__pyx_n_s_73,&__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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":317
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":303
* 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, # <<<<<<<<<<<<<<
@@ -40727,7 +40141,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject
*/
values[3] = ((PyObject *)Py_None);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":325
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":311
* 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, # <<<<<<<<<<<<<<
@@ -40736,7 +40150,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject
*/
values[7] = ((PyObject *)Py_None);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":327
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":313
* 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, # <<<<<<<<<<<<<<
@@ -40745,7 +40159,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject
*/
values[8] = ((PyObject *)Py_None);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":331
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":317
* unsigned min_gap_size=2,
* # filename of file containing precomputed collocations
* precompute_file=None, # <<<<<<<<<<<<<<
@@ -40888,7 +40302,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(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 = 309; __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 = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -40919,10 +40333,10 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject
}
__pyx_v_alignment = ((struct __pyx_obj_4cdec_2sa_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 = 313; __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 = 299; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":313
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":299
* Alignment alignment,
* # parameter for double-binary search; doesn't seem to matter much
* float by_slack_factor=1.0, # <<<<<<<<<<<<<<
@@ -40932,49 +40346,49 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject
__pyx_v_by_slack_factor = ((float)1.0);
}
if (values[2]) {
- __pyx_v_category = __Pyx_PyObject_AsString(values[2]); if (unlikely((!__pyx_v_category) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_category = __Pyx_PyObject_AsString(values[2]); if (unlikely((!__pyx_v_category) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_category = ((char *)__pyx_k_109);
}
__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 = 319; __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 = 305; __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 = 321; __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 = 307; __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 = 323; __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 = 309; __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 = 329; __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 = 315; __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 = 333; __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 = 319; __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 = 335; __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 = 321; __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 = 337; __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":337
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":323
* unsigned precompute_rank=100,
* # require extracted rules to have at least one aligned word
* bint require_aligned_terminal=True, # <<<<<<<<<<<<<<
@@ -40984,10 +40398,10 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject
__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 = 339; __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 = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":339
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":325
* bint require_aligned_terminal=True,
* # require each contiguous chunk of extracted rules to have at least one aligned word
* bint require_aligned_chunks=False, # <<<<<<<<<<<<<<
@@ -40997,20 +40411,20 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject
__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 = 341; __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 = 327; __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 = 343; __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 = 329; __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 = 345; __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 = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":345
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":331
* unsigned train_min_gap_size=2,
* # False if phrases should be loose (better but slower), True otherwise
* bint tight_phrases=True, # <<<<<<<<<<<<<<
@@ -41020,10 +40434,10 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject
__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 = 347; __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 = 333; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":347
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":333
* bint tight_phrases=True,
* # True to require use of double-binary alg, false otherwise
* bint use_baeza_yates=True, # <<<<<<<<<<<<<<
@@ -41033,10 +40447,10 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject
__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 = 349; __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 = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":349
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":335
* bint use_baeza_yates=True,
* # True to enable used of precomputed collocations
* bint use_collocations=True, # <<<<<<<<<<<<<<
@@ -41046,10 +40460,10 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject
__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 = 351; __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 = 337; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":351
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":337
* bint use_collocations=True,
* # True to enable use of precomputed inverted indices
* bint use_index=True): # <<<<<<<<<<<<<<
@@ -41061,13 +40475,13 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject
}
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 = 309; __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 = 295; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("cdec.sa._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_4cdec_2sa_3_sa_Alignment, 1, "alignment", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_alignment), __pyx_ptype_4cdec_2sa_3_sa_Alignment, 1, "alignment", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_r = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(((struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_alignment, __pyx_v_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:;
@@ -41077,7 +40491,7 @@ static int __pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":309
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":295
* cdef online_stats
*
* def __cinit__(self, # <<<<<<<<<<<<<<
@@ -41099,21 +40513,21 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":357
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":343
* 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 = 357; __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 = 343; __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 = 357; __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 = 343; __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_4cdec_2sa_3_sa_TrieTable)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_TrieTable)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 343; __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);
@@ -41122,20 +40536,20 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
__pyx_v_self->rules = ((struct __pyx_obj_4cdec_2sa_3_sa_TrieTable *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":358
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":344
* 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 = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 344; __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 = 358; __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 = 344; __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_4cdec_2sa_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 344; __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);
@@ -41144,7 +40558,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
__pyx_v_self->rules->root = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":359
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":345
* self.rules = TrieTable(True) # cache
* self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation())
* if alignment is None: # <<<<<<<<<<<<<<
@@ -41155,23 +40569,23 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":360
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":346
* 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_111), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_111), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 346; __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 = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L3;
}
__pyx_L3:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":361
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":347
* if alignment is None:
* raise Exception("Must specify an alignment object")
* self.alignment = alignment # <<<<<<<<<<<<<<
@@ -41184,7 +40598,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
__Pyx_DECREF(((PyObject *)__pyx_v_self->alignment));
__pyx_v_self->alignment = __pyx_v_alignment;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":365
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":351
* # grammar parameters and settings
* # NOTE: setting max_nonterminals > 2 is not currently supported in Hiero
* self.max_length = max_length # <<<<<<<<<<<<<<
@@ -41193,7 +40607,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
*/
__pyx_v_self->max_length = __pyx_v_max_length;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":366
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":352
* # NOTE: setting max_nonterminals > 2 is not currently supported in Hiero
* self.max_length = max_length
* self.max_nonterminals = max_nonterminals # <<<<<<<<<<<<<<
@@ -41202,7 +40616,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
*/
__pyx_v_self->max_nonterminals = __pyx_v_max_nonterminals;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":367
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":353
* self.max_length = max_length
* self.max_nonterminals = max_nonterminals
* self.max_initial_size = max_initial_size # <<<<<<<<<<<<<<
@@ -41211,7 +40625,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
*/
__pyx_v_self->max_initial_size = __pyx_v_max_initial_size;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":368
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":354
* self.max_nonterminals = max_nonterminals
* self.max_initial_size = max_initial_size
* self.train_max_initial_size = train_max_initial_size # <<<<<<<<<<<<<<
@@ -41220,7 +40634,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
*/
__pyx_v_self->train_max_initial_size = __pyx_v_train_max_initial_size;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":369
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":355
* self.max_initial_size = max_initial_size
* self.train_max_initial_size = train_max_initial_size
* self.min_gap_size = min_gap_size # <<<<<<<<<<<<<<
@@ -41229,7 +40643,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
*/
__pyx_v_self->min_gap_size = __pyx_v_min_gap_size;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":370
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":356
* 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 # <<<<<<<<<<<<<<
@@ -41238,7 +40652,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
*/
__pyx_v_self->train_min_gap_size = __pyx_v_train_min_gap_size;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":371
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":357
* self.min_gap_size = min_gap_size
* self.train_min_gap_size = train_min_gap_size
* self.category = sym_fromstring(category, False) # <<<<<<<<<<<<<<
@@ -41247,7 +40661,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
*/
__pyx_v_self->category = __pyx_f_4cdec_2sa_3_sa_sym_fromstring(__pyx_v_category, 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":373
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":359
* self.category = sym_fromstring(category, False)
*
* if max_chunks is None: # <<<<<<<<<<<<<<
@@ -41258,7 +40672,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
__pyx_t_3 = (__pyx_t_4 != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":374
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":360
*
* if max_chunks is None:
* self.max_chunks = self.max_nonterminals + 1 # <<<<<<<<<<<<<<
@@ -41270,19 +40684,19 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":376
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":362
* self.max_chunks = self.max_nonterminals + 1
* else:
* self.max_chunks = max_chunks # <<<<<<<<<<<<<<
*
* if max_target_chunks is None:
*/
- __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_max_chunks); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_max_chunks); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->max_chunks = __pyx_t_5;
}
__pyx_L4:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":378
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":364
* self.max_chunks = max_chunks
*
* if max_target_chunks is None: # <<<<<<<<<<<<<<
@@ -41293,7 +40707,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":379
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":365
*
* if max_target_chunks is None:
* self.max_target_chunks = self.max_nonterminals + 1 # <<<<<<<<<<<<<<
@@ -41305,19 +40719,19 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":381
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":367
* self.max_target_chunks = self.max_nonterminals + 1
* else:
* self.max_target_chunks = max_target_chunks # <<<<<<<<<<<<<<
*
* if max_target_length is None:
*/
- __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_max_target_chunks); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_max_target_chunks); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->max_target_chunks = __pyx_t_5;
}
__pyx_L5:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":383
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":369
* self.max_target_chunks = max_target_chunks
*
* if max_target_length is None: # <<<<<<<<<<<<<<
@@ -41328,7 +40742,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
__pyx_t_3 = (__pyx_t_4 != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":384
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":370
*
* if max_target_length is None:
* self.max_target_length = max_initial_size # <<<<<<<<<<<<<<
@@ -41340,26 +40754,26 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":386
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":372
* self.max_target_length = max_initial_size
* else:
* self.max_target_length = max_target_length # <<<<<<<<<<<<<<
*
* # algorithmic parameters and settings
*/
- __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_max_target_length); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_max_target_length); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->max_target_length = __pyx_t_5;
}
__pyx_L6:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":389
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":375
*
* # 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 = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 375; __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);
@@ -41367,14 +40781,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
__pyx_v_self->precomputed_collocations = ((PyObject *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":390
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":376
* # 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 = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 376; __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);
@@ -41382,7 +40796,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
__pyx_v_self->precomputed_index = ((PyObject *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":391
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":377
* self.precomputed_collocations = {}
* self.precomputed_index = {}
* self.use_index = use_index # <<<<<<<<<<<<<<
@@ -41391,7 +40805,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
*/
__pyx_v_self->use_index = __pyx_v_use_index;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":392
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":378
* self.precomputed_index = {}
* self.use_index = use_index
* self.use_collocations = use_collocations # <<<<<<<<<<<<<<
@@ -41400,14 +40814,14 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
*/
__pyx_v_self->use_collocations = __pyx_v_use_collocations;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":393
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":379
* 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 = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_GOTREF(((PyObject *)__pyx_t_2));
__Pyx_GIVEREF(((PyObject *)__pyx_t_2));
__Pyx_GOTREF(__pyx_v_self->max_rank);
@@ -41415,7 +40829,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
__pyx_v_self->max_rank = ((PyObject *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":394
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":380
* self.use_collocations = use_collocations
* self.max_rank = {}
* self.precompute_file = precompute_file # <<<<<<<<<<<<<<
@@ -41428,7 +40842,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
__Pyx_DECREF(__pyx_v_self->precompute_file);
__pyx_v_self->precompute_file = __pyx_v_precompute_file;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":395
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":381
* self.max_rank = {}
* self.precompute_file = precompute_file
* self.precompute_rank = precompute_rank # <<<<<<<<<<<<<<
@@ -41437,7 +40851,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
*/
__pyx_v_self->precompute_rank = __pyx_v_precompute_rank;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":396
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":382
* self.precompute_file = precompute_file
* self.precompute_rank = precompute_rank
* self.precompute_secondary_rank = precompute_secondary_rank # <<<<<<<<<<<<<<
@@ -41446,7 +40860,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
*/
__pyx_v_self->precompute_secondary_rank = __pyx_v_precompute_secondary_rank;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":397
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":383
* self.precompute_rank = precompute_rank
* self.precompute_secondary_rank = precompute_secondary_rank
* self.use_baeza_yates = use_baeza_yates # <<<<<<<<<<<<<<
@@ -41455,7 +40869,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
*/
__pyx_v_self->use_baeza_yates = __pyx_v_use_baeza_yates;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":398
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":384
* self.precompute_secondary_rank = precompute_secondary_rank
* self.use_baeza_yates = use_baeza_yates
* self.by_slack_factor = by_slack_factor # <<<<<<<<<<<<<<
@@ -41464,7 +40878,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
*/
__pyx_v_self->by_slack_factor = __pyx_v_by_slack_factor;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":399
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":385
* self.use_baeza_yates = use_baeza_yates
* self.by_slack_factor = by_slack_factor
* self.tight_phrases = tight_phrases # <<<<<<<<<<<<<<
@@ -41473,7 +40887,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
*/
__pyx_v_self->tight_phrases = __pyx_v_tight_phrases;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":401
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":387
* self.tight_phrases = tight_phrases
*
* if require_aligned_chunks: # <<<<<<<<<<<<<<
@@ -41483,7 +40897,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
__pyx_t_3 = (__pyx_v_require_aligned_chunks != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":403
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":389
* if require_aligned_chunks:
* # one condition is a stronger version of the other.
* self.require_aligned_chunks = self.require_aligned_terminal = True # <<<<<<<<<<<<<<
@@ -41495,7 +40909,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
goto __pyx_L7;
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":404
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":390
* # one condition is a stronger version of the other.
* self.require_aligned_chunks = self.require_aligned_terminal = True
* elif require_aligned_terminal: # <<<<<<<<<<<<<<
@@ -41505,7 +40919,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
__pyx_t_3 = (__pyx_v_require_aligned_terminal != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":405
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":391
* self.require_aligned_chunks = self.require_aligned_terminal = True
* elif require_aligned_terminal:
* self.require_aligned_chunks = False # <<<<<<<<<<<<<<
@@ -41514,7 +40928,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
*/
__pyx_v_self->require_aligned_chunks = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":406
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":392
* elif require_aligned_terminal:
* self.require_aligned_chunks = False
* self.require_aligned_terminal = True # <<<<<<<<<<<<<<
@@ -41526,7 +40940,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":408
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":394
* self.require_aligned_terminal = True
* else:
* self.require_aligned_chunks = self.require_aligned_terminal = False # <<<<<<<<<<<<<<
@@ -41538,7 +40952,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
}
__pyx_L7:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":411
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":397
*
* # diagnostics
* self.prev_norm_prefix = () # <<<<<<<<<<<<<<
@@ -41551,17 +40965,17 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
__Pyx_DECREF(__pyx_v_self->prev_norm_prefix);
__pyx_v_self->prev_norm_prefix = ((PyObject *)__pyx_empty_tuple);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":413
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":399
* 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 = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 399; __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 = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 413; __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 = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__Pyx_GIVEREF(__pyx_t_1);
@@ -41570,17 +40984,17 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
__pyx_v_self->findexes = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":414
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":400
*
* 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 = 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 = 400; __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 = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__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_int_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); 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_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_GIVEREF(__pyx_t_2);
@@ -41589,7 +41003,7 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
__pyx_v_self->findexes1 = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":419
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":405
*
* # True after data is added
* self.online = False # <<<<<<<<<<<<<<
@@ -41598,21 +41012,21 @@ static int __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory___cinit__(struct __
*/
__pyx_v_self->online = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":420
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":406
* # True after data is added
* self.online = False
* self.online_stats = defaultdict(OnlineStats) # <<<<<<<<<<<<<<
*
* def configure(self, SuffixArray fsarray, DataArray edarray,
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); 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_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 420; __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 = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_OnlineStats)));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_OnlineStats)));
__Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_OnlineStats)));
- __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
@@ -41671,21 +41085,21 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_3configure(Py
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 = 422; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 408; __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 = 422; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 408; __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 = 422; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 408; __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 = 422; __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 = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
goto __pyx_L5_argtuple_error;
@@ -41702,16 +41116,16 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_3configure(Py
}
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 = 422; __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 = 408; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("cdec.sa._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_4cdec_2sa_3_sa_SuffixArray, 1, "fsarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edarray), __pyx_ptype_4cdec_2sa_3_sa_DataArray, 1, "edarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sampler), __pyx_ptype_4cdec_2sa_3_sa_Sampler, 1, "sampler", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_scorer), __pyx_ptype_4cdec_2sa_3_sa_Scorer, 1, "scorer", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fsarray), __pyx_ptype_4cdec_2sa_3_sa_SuffixArray, 1, "fsarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edarray), __pyx_ptype_4cdec_2sa_3_sa_DataArray, 1, "edarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sampler), __pyx_ptype_4cdec_2sa_3_sa_Sampler, 1, "sampler", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_scorer), __pyx_ptype_4cdec_2sa_3_sa_Scorer, 1, "scorer", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_r = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(((struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_fsarray, __pyx_v_edarray, __pyx_v_sampler, __pyx_v_scorer);
goto __pyx_L0;
__pyx_L1_error:;
@@ -41721,7 +41135,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_3configure(Py
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":422
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":408
* self.online_stats = defaultdict(OnlineStats)
*
* def configure(self, SuffixArray fsarray, DataArray edarray, # <<<<<<<<<<<<<<
@@ -41739,7 +41153,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(st
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("configure", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":427
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":413
* Here we also use it to precompute the most expensive intersections
* in the corpus quickly.'''
* self.fsa = fsarray # <<<<<<<<<<<<<<
@@ -41752,7 +41166,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(st
__Pyx_DECREF(((PyObject *)__pyx_v_self->fsa));
__pyx_v_self->fsa = __pyx_v_fsarray;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":428
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":414
* in the corpus quickly.'''
* self.fsa = fsarray
* self.fda = fsarray.darray # <<<<<<<<<<<<<<
@@ -41767,7 +41181,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(st
__pyx_v_self->fda = ((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":429
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":415
* self.fsa = fsarray
* self.fda = fsarray.darray
* self.eda = edarray # <<<<<<<<<<<<<<
@@ -41780,7 +41194,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(st
__Pyx_DECREF(((PyObject *)__pyx_v_self->eda));
__pyx_v_self->eda = __pyx_v_edarray;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":430
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":416
* self.fda = fsarray.darray
* self.eda = edarray
* self.fid2symid = self.set_idmap(self.fda) # <<<<<<<<<<<<<<
@@ -41789,17 +41203,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(st
*/
__pyx_t_1 = ((PyObject *)__pyx_v_self->fda);
__Pyx_INCREF(__pyx_t_1);
- __pyx_t_2 = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->set_idmap(__pyx_v_self, ((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->set_idmap(__pyx_v_self, ((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 416; __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_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 416; __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_4cdec_2sa_3_sa_IntList *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":431
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":417
* self.eda = edarray
* self.fid2symid = self.set_idmap(self.fda)
* self.eid2symid = self.set_idmap(self.eda) # <<<<<<<<<<<<<<
@@ -41808,31 +41222,31 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(st
*/
__pyx_t_2 = ((PyObject *)__pyx_v_self->eda);
__Pyx_INCREF(__pyx_t_2);
- __pyx_t_1 = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->set_idmap(__pyx_v_self, ((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->set_idmap(__pyx_v_self, ((struct __pyx_obj_4cdec_2sa_3_sa_DataArray *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 417; __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_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 417; __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_4cdec_2sa_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":432
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":418
* 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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__precompute); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__precompute); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 432; __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 = 418; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":433
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":419
* self.eid2symid = self.set_idmap(self.eda)
* self.precompute()
* self.sampler = sampler # <<<<<<<<<<<<<<
@@ -41845,7 +41259,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(st
__Pyx_DECREF(((PyObject *)__pyx_v_self->sampler));
__pyx_v_self->sampler = __pyx_v_sampler;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":434
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":420
* self.precompute()
* self.sampler = sampler
* self.scorer = scorer # <<<<<<<<<<<<<<
@@ -41871,7 +41285,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_2configure(st
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":436
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":422
* self.scorer = scorer
*
* cdef set_idmap(self, DataArray darray): # <<<<<<<<<<<<<<
@@ -41896,7 +41310,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_set_idmap(CYTH
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("set_idmap", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":440
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":426
* cdef IntList idmap
*
* N = len(darray.id2word) # <<<<<<<<<<<<<<
@@ -41905,30 +41319,30 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_set_idmap(CYTH
*/
__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 = 440; __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 = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_N = __pyx_t_2;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":441
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":427
*
* 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 = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 427; __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 = 441; __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 = 427; __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 = 441; __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 = 427; __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_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 427; __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_4cdec_2sa_3_sa_IntList *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":442
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":428
* N = len(darray.id2word)
* idmap = IntList(initial_len=N)
* for word_id from 0 <= word_id < N: # <<<<<<<<<<<<<<
@@ -41938,20 +41352,20 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_set_idmap(CYTH
__pyx_t_4 = __pyx_v_N;
for (__pyx_v_word_id = 0; __pyx_v_word_id < __pyx_t_4; __pyx_v_word_id++) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":443
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":429
* 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, 0, 1, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_darray->id2word, __pyx_v_word_id, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_new_word_id = __pyx_f_4cdec_2sa_3_sa_sym_fromstring(__pyx_t_5, 1);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":444
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":430
* 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 # <<<<<<<<<<<<<<
@@ -41961,7 +41375,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_set_idmap(CYTH
(__pyx_v_idmap->arr[__pyx_v_word_id]) = __pyx_v_new_word_id;
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":445
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":431
* new_word_id = sym_fromstring(darray.id2word[word_id], True)
* idmap.arr[word_id] = new_word_id
* return idmap # <<<<<<<<<<<<<<
@@ -41998,7 +41412,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5pattern2phra
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":448
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":434
*
*
* def pattern2phrase(self, pattern): # <<<<<<<<<<<<<<
@@ -42026,7 +41440,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phra
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("pattern2phrase", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":450
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":436
* def pattern2phrase(self, pattern):
* # pattern is a tuple, which we must convert to a hiero Phrase
* result = () # <<<<<<<<<<<<<<
@@ -42036,7 +41450,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phra
__Pyx_INCREF(((PyObject *)__pyx_empty_tuple));
__pyx_v_result = __pyx_empty_tuple;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":451
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":437
* # pattern is a tuple, which we must convert to a hiero Phrase
* result = ()
* arity = 0 # <<<<<<<<<<<<<<
@@ -42046,7 +41460,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phra
__Pyx_INCREF(__pyx_int_0);
__pyx_v_arity = __pyx_int_0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":452
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":438
* result = ()
* arity = 0
* for word_id in pattern: # <<<<<<<<<<<<<<
@@ -42057,7 +41471,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phra
__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 = 452; __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 = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -42065,23 +41479,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phra
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 = 452; __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 = 438; __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 = 452; __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 = 438; __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 = 452; __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 = 438; __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 = 452; __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 = 438; __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 = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -42090,73 +41504,73 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phra
__Pyx_XDECREF_SET(__pyx_v_word_id, __pyx_t_4);
__pyx_t_4 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":453
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":439
* 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 = 453; __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 = 453; __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 = 439; __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 = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_5) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":454
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":440
* 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 = 454; __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 = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF_SET(__pyx_v_arity, __pyx_t_4);
__pyx_t_4 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":455
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":441
* 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 = 455; __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 = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_new_id = __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_t_6);
goto __pyx_L5;
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":457
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":443
* 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 = 457; __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 = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_new_id = __pyx_f_4cdec_2sa_3_sa_sym_fromstring(__pyx_t_7, 1);
}
__pyx_L5:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":458
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":444
* 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 = 458; __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 = 444; __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 = 458; __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 = 444; __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 = 458; __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 = 444; __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_SET(__pyx_v_result, ((PyObject*)__pyx_t_4));
@@ -42164,7 +41578,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phra
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":459
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":445
* new_id = sym_fromstring(self.fda.id2word[word_id], True)
* result = result + (new_id,)
* return Phrase(result) # <<<<<<<<<<<<<<
@@ -42172,12 +41586,12 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_4pattern2phra
* 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 = 459; __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 = 445; __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_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); 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(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__pyx_r = __pyx_t_4;
@@ -42212,7 +41626,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_7pattern2phra
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":461
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":447
* return Phrase(result)
*
* def pattern2phrase_plus(self, pattern): # <<<<<<<<<<<<<<
@@ -42242,19 +41656,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("pattern2phrase_plus", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":464
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":450
* # 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 = 464; __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 = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_patterns = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":465
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":451
* # suffixed/prefixed with the NT category.
* patterns = []
* result = () # <<<<<<<<<<<<<<
@@ -42264,7 +41678,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra
__Pyx_INCREF(((PyObject *)__pyx_empty_tuple));
__pyx_v_result = __pyx_empty_tuple;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":466
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":452
* patterns = []
* result = ()
* arity = 0 # <<<<<<<<<<<<<<
@@ -42274,7 +41688,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra
__Pyx_INCREF(__pyx_int_0);
__pyx_v_arity = __pyx_int_0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":467
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":453
* result = ()
* arity = 0
* for word_id in pattern: # <<<<<<<<<<<<<<
@@ -42285,7 +41699,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra
__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 = 467; __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 = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -42293,23 +41707,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra
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 = 467; __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 = 453; __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 = 467; __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 = 453; __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 = 467; __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 = 453; __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 = 467; __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 = 453; __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 = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -42318,73 +41732,73 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra
__Pyx_XDECREF_SET(__pyx_v_word_id, __pyx_t_4);
__pyx_t_4 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":468
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":454
* 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 = 468; __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 = 468; __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 = 454; __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 = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_5) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":469
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":455
* 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 = 469; __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 = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF_SET(__pyx_v_arity, __pyx_t_4);
__pyx_t_4 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":470
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":456
* 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 = 470; __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 = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_new_id = __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_t_6);
goto __pyx_L5;
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":472
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":458
* 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 = 472; __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 = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_new_id = __pyx_f_4cdec_2sa_3_sa_sym_fromstring(__pyx_t_7, 1);
}
__pyx_L5:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":473
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":459
* 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 = 473; __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 = 459; __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 = 473; __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 = 459; __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 = 473; __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 = 459; __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_SET(__pyx_v_result, ((PyObject*)__pyx_t_4));
@@ -42392,81 +41806,81 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_6pattern2phra
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":474
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":460
* 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 = 474; __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 = 460; __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_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); 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(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_patterns, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_patterns, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":475
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":461
* 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_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
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 = 475; __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 = 461; __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 = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
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_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_patterns, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_patterns, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":476
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":462
* 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_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_v_result)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __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 = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_4));
__Pyx_GIVEREF(((PyObject *)__pyx_t_4));
__pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_patterns, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_patterns, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":477
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":463
* patterns.append(Phrase(result + (sym_setindex(self.category, 1),)))
* patterns.append(Phrase((sym_setindex(self.category, 1),) + result))
* return patterns # <<<<<<<<<<<<<<
@@ -42507,7 +41921,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9precompute(P
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":479
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":465
* return patterns
*
* def precompute(self): # <<<<<<<<<<<<<<
@@ -42542,7 +41956,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("precompute", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":482
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":468
* cdef Precomputation pre
*
* if self.precompute_file is not None: # <<<<<<<<<<<<<<
@@ -42553,34 +41967,34 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":483
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":469
*
* 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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_start_time = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":484
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":470
* if self.precompute_file is not None:
* start_time = monitor_cpu()
* logger.info("Reading precomputed data from file %s... ", self.precompute_file) # <<<<<<<<<<<<<<
* pre = Precomputation(from_binary=self.precompute_file)
* # check parameters of precomputation -- some are critical and some are not
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __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 = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_112));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_112));
@@ -42588,29 +42002,29 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__Pyx_INCREF(__pyx_v_self->precompute_file);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_self->precompute_file);
__Pyx_GIVEREF(__pyx_v_self->precompute_file);
- __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 470; __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_4)); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":485
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":471
* 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_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_5));
- if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__from_binary), __pyx_v_self->precompute_file) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Precomputation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__from_binary), __pyx_v_self->precompute_file) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Precomputation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
__pyx_v_pre = ((struct __pyx_obj_4cdec_2sa_3_sa_Precomputation *)__pyx_t_4);
__pyx_t_4 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":487
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":473
* 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: # <<<<<<<<<<<<<<
@@ -42620,23 +42034,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__pyx_t_2 = ((__pyx_v_pre->max_nonterminals != __pyx_v_self->max_nonterminals) != 0);
if (__pyx_t_2) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":488
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":474
* # 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_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__warn); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__warn); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyInt_FromLong(__pyx_v_pre->max_nonterminals); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_v_pre->max_nonterminals); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = PyInt_FromLong(__pyx_v_self->max_nonterminals); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __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 = 474; __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 = 488; __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 = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_113));
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_kp_s_113));
@@ -42647,7 +42061,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_4 = 0;
__pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
@@ -42656,7 +42070,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
}
__pyx_L4:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":489
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":475
* 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: # <<<<<<<<<<<<<<
@@ -42666,23 +42080,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__pyx_t_2 = ((__pyx_v_pre->max_length != __pyx_v_self->max_length) != 0);
if (__pyx_t_2) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":490
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":476
* 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_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__warn); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__warn); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__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 = 490; __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 = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyInt_FromLong(__pyx_v_self->max_length); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyInt_FromLong(__pyx_v_self->max_length); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __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 = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_114));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_114));
@@ -42693,7 +42107,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__Pyx_GIVEREF(__pyx_t_5);
__pyx_t_3 = 0;
__pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
@@ -42702,7 +42116,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
}
__pyx_L5:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":491
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":477
* 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: # <<<<<<<<<<<<<<
@@ -42712,18 +42126,18 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__pyx_t_2 = ((__pyx_v_pre->train_max_initial_size != __pyx_v_self->train_max_initial_size) != 0);
if (__pyx_t_2) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":492
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":478
* 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_5 = PyInt_FromLong(__pyx_v_pre->train_max_initial_size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyInt_FromLong(__pyx_v_pre->train_max_initial_size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = PyInt_FromLong(__pyx_v_self->train_max_initial_size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_v_self->train_max_initial_size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
@@ -42731,25 +42145,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_5 = 0;
__pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_115), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_115), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
__Pyx_DECREF(((PyObject *)__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 = 492; __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 = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_4));
__Pyx_GIVEREF(((PyObject *)__pyx_t_4));
__pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L6;
}
__pyx_L6:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":493
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":479
* 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: # <<<<<<<<<<<<<<
@@ -42759,18 +42173,18 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__pyx_t_2 = ((__pyx_v_pre->train_min_gap_size != __pyx_v_self->train_min_gap_size) != 0);
if (__pyx_t_2) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":494
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":480
* 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_4 = PyInt_FromLong(__pyx_v_pre->train_min_gap_size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_v_pre->train_min_gap_size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = PyInt_FromLong(__pyx_v_self->train_min_gap_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyInt_FromLong(__pyx_v_self->train_min_gap_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __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 = 480; __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);
@@ -42778,25 +42192,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__Pyx_GIVEREF(__pyx_t_6);
__pyx_t_4 = 0;
__pyx_t_6 = 0;
- __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_116), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_116), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_6));
__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 = 494; __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 = 480; __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));
__pyx_t_6 = 0;
- __pyx_t_6 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L7;
}
__pyx_L7:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":495
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":481
* 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: # <<<<<<<<<<<<<<
@@ -42806,25 +42220,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__pyx_t_2 = (__pyx_v_self->use_index != 0);
if (__pyx_t_2) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":496
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":482
* 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_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__info); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__info); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 482; __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_v_pre->precomputed_index;
__Pyx_INCREF(__pyx_t_6);
- __pyx_t_7 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 496; __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 = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_117));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_117));
@@ -42832,13 +42246,13 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_6);
__pyx_t_6 = 0;
- __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":497
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":483
* 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(): # <<<<<<<<<<<<<<
@@ -42848,9 +42262,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__pyx_t_7 = 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 = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_t_4 = __Pyx_dict_iterator(__pyx_v_pre->precomputed_index, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_dict_iterator(__pyx_v_pre->precomputed_index, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_8), (&__pyx_t_9)); 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_XDECREF(__pyx_t_6);
__pyx_t_6 = __pyx_t_4;
@@ -42858,7 +42272,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
while (1) {
__pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_6, __pyx_t_8, &__pyx_t_7, &__pyx_t_4, &__pyx_t_5, NULL, __pyx_t_9);
if (unlikely(__pyx_t_10 == 0)) break;
- if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_t_5);
__Pyx_XDECREF_SET(__pyx_v_pattern, __pyx_t_4);
@@ -42866,28 +42280,28 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__Pyx_XDECREF_SET(__pyx_v_arr, __pyx_t_5);
__pyx_t_5 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":498
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":484
* 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_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__pattern2phrase_plus); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__pattern2phrase_plus); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 498; __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 = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_pattern);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_pattern);
__Pyx_GIVEREF(__pyx_v_pattern);
- __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_XDECREF_SET(__pyx_v_phrases, __pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":499
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":485
* for pattern, arr in pre.precomputed_index.iteritems():
* phrases = self.pattern2phrase_plus(pattern)
* for phrase in phrases: # <<<<<<<<<<<<<<
@@ -42898,7 +42312,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__pyx_t_3 = __pyx_v_phrases; __Pyx_INCREF(__pyx_t_3); __pyx_t_11 = 0;
__pyx_t_12 = NULL;
} else {
- __pyx_t_11 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_phrases); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_phrases); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_12 = Py_TYPE(__pyx_t_3)->tp_iternext;
}
@@ -42906,23 +42320,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_3)) {
if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_3)) {
if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_12(__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 = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -42931,14 +42345,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__Pyx_XDECREF_SET(__pyx_v_phrase, __pyx_t_4);
__pyx_t_4 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":500
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":486
* 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 = 500; __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 = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
@@ -42947,7 +42361,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
}
__pyx_L8:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":501
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":487
* for phrase in phrases:
* self.precomputed_index[phrase] = arr
* if self.use_collocations: # <<<<<<<<<<<<<<
@@ -42957,25 +42371,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__pyx_t_2 = (__pyx_v_self->use_collocations != 0);
if (__pyx_t_2) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":502
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":488
* 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_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = __pyx_v_pre->precomputed_collocations;
__Pyx_INCREF(__pyx_t_6);
- __pyx_t_8 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 502; __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 = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_118));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_118));
@@ -42983,13 +42397,13 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_6);
__pyx_t_6 = 0;
- __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":503
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":489
* 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(): # <<<<<<<<<<<<<<
@@ -42999,9 +42413,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__pyx_t_8 = 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 = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_t_4 = __Pyx_dict_iterator(__pyx_v_pre->precomputed_collocations, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_7), (&__pyx_t_9)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_dict_iterator(__pyx_v_pre->precomputed_collocations, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_7), (&__pyx_t_9)); 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_XDECREF(__pyx_t_6);
__pyx_t_6 = __pyx_t_4;
@@ -43009,7 +42423,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
while (1) {
__pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_6, __pyx_t_7, &__pyx_t_8, &__pyx_t_4, &__pyx_t_3, NULL, __pyx_t_9);
if (unlikely(__pyx_t_10 == 0)) break;
- if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_t_3);
__Pyx_XDECREF_SET(__pyx_v_pattern, __pyx_t_4);
@@ -43017,71 +42431,71 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
__Pyx_XDECREF_SET(__pyx_v_arr, __pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":504
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":490
* 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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__pattern2phrase); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__pattern2phrase); 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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 504; __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 = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_pattern);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_pattern);
__Pyx_GIVEREF(__pyx_v_pattern);
- __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __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_4)); __pyx_t_4 = 0;
__Pyx_XDECREF_SET(__pyx_v_phrase, __pyx_t_5);
__pyx_t_5 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":505
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":491
* 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 = 505; __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 = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
goto __pyx_L13;
}
__pyx_L13:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":506
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":492
* 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_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_v_stop_time = __pyx_t_5;
__pyx_t_5 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":507
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":493
* self.precomputed_collocations[phrase] = arr
* stop_time = monitor_cpu()
* logger.info("Processing precomputations took %f seconds", stop_time - start_time) # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__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_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__info); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__info); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__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 = 507; __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 = 493; __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 = 507; __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 = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_119));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_119));
@@ -43089,7 +42503,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8precompute(s
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
__pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_4), 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_6); __pyx_t_6 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
@@ -43131,7 +42545,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_11get_precomp
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":510
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":496
*
*
* def get_precomputed_collocation(self, phrase): # <<<<<<<<<<<<<<
@@ -43154,30 +42568,30 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_10get_precomp
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_precomputed_collocation", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":511
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":497
*
* 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 = 511; __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 = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":512
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":498
* def get_precomputed_collocation(self, phrase):
* if phrase in self.precomputed_collocations:
* arr = self.precomputed_collocations[phrase] # <<<<<<<<<<<<<<
* return PhraseLocation(arr=arr, arr_low=0, arr_high=len(arr), num_subpatterns=phrase.arity()+1)
* return None
*/
- __pyx_t_3 = PyObject_GetItem(__pyx_v_self->precomputed_collocations, __pyx_v_phrase); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_v_self->precomputed_collocations, __pyx_v_phrase); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_arr = __pyx_t_3;
__pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":513
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":499
* 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) # <<<<<<<<<<<<<<
@@ -43185,26 +42599,26 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_10get_precomp
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
- if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__arr), __pyx_v_arr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__arr_low), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__arr), __pyx_v_arr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__arr_low), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__arr_high), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__arr_high), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_phrase, __pyx_n_s__arity); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_phrase, __pyx_n_s__arity); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__num_subpatterns), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__num_subpatterns), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__pyx_r = __pyx_t_5;
@@ -43214,7 +42628,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_10get_precomp
}
__pyx_L3:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":514
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":500
* arr = self.precomputed_collocations[phrase]
* return PhraseLocation(arr=arr, arr_low=0, arr_high=len(arr), num_subpatterns=phrase.arity()+1)
* return None # <<<<<<<<<<<<<<
@@ -43241,7 +42655,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_10get_precomp
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":517
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":503
*
*
* cdef int* baeza_yates_helper(self, int low1, int high1, int* arr1, int step1, # <<<<<<<<<<<<<<
@@ -43287,7 +42701,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("baeza_yates_helper", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":530
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":516
* cdef Matching loc1, loc2
*
* result = <int*> malloc(0*sizeof(int*)) # <<<<<<<<<<<<<<
@@ -43296,7 +42710,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_result = ((int *)malloc((0 * (sizeof(int *)))));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":532
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":518
* result = <int*> malloc(0*sizeof(int*))
*
* d_first = 0 # <<<<<<<<<<<<<<
@@ -43305,7 +42719,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_d_first = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":533
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":519
*
* d_first = 0
* if high1 - low1 > high2 - low2: # <<<<<<<<<<<<<<
@@ -43315,7 +42729,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_1 = (((__pyx_v_high1 - __pyx_v_low1) > (__pyx_v_high2 - __pyx_v_low2)) != 0);
if (__pyx_t_1) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":534
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":520
* d_first = 0
* if high1 - low1 > high2 - low2:
* d_first = 1 # <<<<<<<<<<<<<<
@@ -43327,7 +42741,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
}
__pyx_L3:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":538
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":524
* # 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: # <<<<<<<<<<<<<<
@@ -43343,7 +42757,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
}
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":539
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":525
* # Case 1: one of the sets is empty
* if low1 >= high1 or low2 >= high2:
* return result # <<<<<<<<<<<<<<
@@ -43356,7 +42770,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
}
__pyx_L4:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":542
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":528
*
* # Case 2: sets are non-overlapping
* assign_matching(&loc1, arr1, high1-step1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -43365,7 +42779,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, (__pyx_v_high1 - __pyx_v_step1), __pyx_v_step1, __pyx_v_self->fda->sent_id->arr);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":543
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":529
* # 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) # <<<<<<<<<<<<<<
@@ -43374,7 +42788,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_low2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":544
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":530
* 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: # <<<<<<<<<<<<<<
@@ -43384,7 +42798,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_3 = ((((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last) == -1) != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":545
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":531
* 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 # <<<<<<<<<<<<<<
@@ -43397,7 +42811,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
}
__pyx_L5:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":547
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":533
* return result
*
* assign_matching(&loc1, arr1, low1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -43406,7 +42820,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_low1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":548
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":534
*
* assign_matching(&loc1, arr1, low1, step1, self.fda.sent_id.arr)
* assign_matching(&loc2, arr2, high2-step2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -43415,7 +42829,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, (__pyx_v_high2 - __pyx_v_step2), __pyx_v_step2, __pyx_v_self->fda->sent_id->arr);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":549
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":535
* assign_matching(&loc1, arr1, low1, step1, self.fda.sent_id.arr)
* assign_matching(&loc2, arr2, high2-step2, step2, self.fda.sent_id.arr)
* if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) == 1: # <<<<<<<<<<<<<<
@@ -43425,7 +42839,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_3 = ((((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last) == 1) != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":550
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":536
* 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 # <<<<<<<<<<<<<<
@@ -43438,7 +42852,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
}
__pyx_L6:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":554
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":540
* # Case 3: query set and data set do not meet size mismatch constraints;
* # We use mergesort instead in this case
* qsetsize = (high1-low1) / step1 # <<<<<<<<<<<<<<
@@ -43454,7 +42868,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
#ifdef WITH_THREAD
PyGILState_Release(__pyx_gilstate_save);
#endif
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 540; __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))) {
#ifdef WITH_THREAD
@@ -43464,11 +42878,11 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
#ifdef WITH_THREAD
PyGILState_Release(__pyx_gilstate_save);
#endif
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_v_qsetsize = __Pyx_div_int(__pyx_t_4, __pyx_v_step1);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":555
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":541
* # We use mergesort instead in this case
* qsetsize = (high1-low1) / step1
* dsetsize = (high2-low2) / step2 # <<<<<<<<<<<<<<
@@ -43484,7 +42898,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
#ifdef WITH_THREAD
PyGILState_Release(__pyx_gilstate_save);
#endif
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
else if (sizeof(int) == sizeof(long) && unlikely(__pyx_v_step2 == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_4))) {
#ifdef WITH_THREAD
@@ -43494,11 +42908,11 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
#ifdef WITH_THREAD
PyGILState_Release(__pyx_gilstate_save);
#endif
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_v_dsetsize = __Pyx_div_int(__pyx_t_4, __pyx_v_step2);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":556
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":542
* qsetsize = (high1-low1) / step1
* dsetsize = (high2-low2) / step2
* if d_first: # <<<<<<<<<<<<<<
@@ -43508,7 +42922,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_3 = (__pyx_v_d_first != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":557
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":543
* dsetsize = (high2-low2) / step2
* if d_first:
* tmp = qsetsize # <<<<<<<<<<<<<<
@@ -43517,7 +42931,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_tmp = __pyx_v_qsetsize;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":558
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":544
* if d_first:
* tmp = qsetsize
* qsetsize = dsetsize # <<<<<<<<<<<<<<
@@ -43526,7 +42940,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_qsetsize = __pyx_v_dsetsize;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":559
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":545
* tmp = qsetsize
* qsetsize = dsetsize
* dsetsize = tmp # <<<<<<<<<<<<<<
@@ -43538,7 +42952,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
}
__pyx_L7:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":561
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":547
* dsetsize = tmp
*
* if self.by_slack_factor * qsetsize * log(dsetsize) / log(2) > dsetsize: # <<<<<<<<<<<<<<
@@ -43555,12 +42969,12 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
#ifdef WITH_THREAD
PyGILState_Release(__pyx_gilstate_save);
#endif
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_t_3 = (((__pyx_t_5 / __pyx_t_6) > __pyx_v_dsetsize) != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":562
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":548
*
* if self.by_slack_factor * qsetsize * log(dsetsize) / log(2) > dsetsize:
* free(result) # <<<<<<<<<<<<<<
@@ -43569,7 +42983,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
free(__pyx_v_result);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":563
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":549
* 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) # <<<<<<<<<<<<<<
@@ -43582,7 +42996,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
}
__pyx_L8:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":567
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":553
* # binary search. There are two flavors, depending on
* # whether the queryset or dataset is first
* if d_first: # <<<<<<<<<<<<<<
@@ -43592,7 +43006,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_3 = (__pyx_v_d_first != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":568
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":554
* # whether the queryset or dataset is first
* if d_first:
* med2 = median(low2, high2, step2) # <<<<<<<<<<<<<<
@@ -43601,7 +43015,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_med2 = __pyx_f_4cdec_2sa_3_sa_median(__pyx_v_low2, __pyx_v_high2, __pyx_v_step2);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":569
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":555
* if d_first:
* med2 = median(low2, high2, step2)
* assign_matching(&loc2, arr2, med2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -43610,7 +43024,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_med2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":571
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":557
* assign_matching(&loc2, arr2, med2, step2, self.fda.sent_id.arr)
*
* search_low = low1 # <<<<<<<<<<<<<<
@@ -43619,7 +43033,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_search_low = __pyx_v_low1;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":572
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":558
*
* search_low = low1
* search_high = high1 # <<<<<<<<<<<<<<
@@ -43628,7 +43042,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_search_high = __pyx_v_high1;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":573
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":559
* search_low = low1
* search_high = high1
* while search_low < search_high: # <<<<<<<<<<<<<<
@@ -43639,7 +43053,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_3 = ((__pyx_v_search_low < __pyx_v_search_high) != 0);
if (!__pyx_t_3) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":574
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":560
* search_high = high1
* while search_low < search_high:
* med1 = median(search_low, search_high, step1) # <<<<<<<<<<<<<<
@@ -43648,7 +43062,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_med1 = __pyx_f_4cdec_2sa_3_sa_median(__pyx_v_search_low, __pyx_v_search_high, __pyx_v_step1);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":575
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":561
* while search_low < search_high:
* med1 = median(search_low, search_high, step1)
* find_comparable_matchings(low1, high1, arr1, step1, med1, &med1_minus, &med1_plus) # <<<<<<<<<<<<<<
@@ -43657,7 +43071,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_f_4cdec_2sa_3_sa_find_comparable_matchings(__pyx_v_low1, __pyx_v_high1, __pyx_v_arr1, __pyx_v_step1, __pyx_v_med1, (&__pyx_v_med1_minus), (&__pyx_v_med1_plus));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":576
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":562
* 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) # <<<<<<<<<<<<<<
@@ -43666,7 +43080,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_comparison = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings_set(__pyx_v_self, __pyx_v_med1_minus, __pyx_v_med1_plus, __pyx_v_arr1, __pyx_v_step1, (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":579
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":565
* if comparison == -1:
* search_low = med1_plus
* elif comparison == 1: # <<<<<<<<<<<<<<
@@ -43675,7 +43089,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
switch (__pyx_v_comparison) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":577
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":563
* 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: # <<<<<<<<<<<<<<
@@ -43684,7 +43098,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
case -1:
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":578
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":564
* comparison = self.compare_matchings_set(med1_minus, med1_plus, arr1, step1, &loc2, offset_by_one, len_last)
* if comparison == -1:
* search_low = med1_plus # <<<<<<<<<<<<<<
@@ -43694,7 +43108,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_v_search_low = __pyx_v_med1_plus;
break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":579
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":565
* if comparison == -1:
* search_low = med1_plus
* elif comparison == 1: # <<<<<<<<<<<<<<
@@ -43703,7 +43117,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
case 1:
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":580
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":566
* search_low = med1_plus
* elif comparison == 1:
* search_high = med1_minus # <<<<<<<<<<<<<<
@@ -43714,7 +43128,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
break;
default:
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":582
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":568
* search_high = med1_minus
* else:
* break # <<<<<<<<<<<<<<
@@ -43730,7 +43144,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":584
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":570
* break
* else:
* med1 = median(low1, high1, step1) # <<<<<<<<<<<<<<
@@ -43739,7 +43153,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_med1 = __pyx_f_4cdec_2sa_3_sa_median(__pyx_v_low1, __pyx_v_high1, __pyx_v_step1);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":585
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":571
* else:
* med1 = median(low1, high1, step1)
* find_comparable_matchings(low1, high1, arr1, step1, med1, &med1_minus, &med1_plus) # <<<<<<<<<<<<<<
@@ -43748,7 +43162,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_f_4cdec_2sa_3_sa_find_comparable_matchings(__pyx_v_low1, __pyx_v_high1, __pyx_v_arr1, __pyx_v_step1, __pyx_v_med1, (&__pyx_v_med1_minus), (&__pyx_v_med1_plus));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":587
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":573
* find_comparable_matchings(low1, high1, arr1, step1, med1, &med1_minus, &med1_plus)
*
* search_low = low2 # <<<<<<<<<<<<<<
@@ -43757,7 +43171,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_search_low = __pyx_v_low2;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":588
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":574
*
* search_low = low2
* search_high = high2 # <<<<<<<<<<<<<<
@@ -43766,7 +43180,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_search_high = __pyx_v_high2;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":589
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":575
* search_low = low2
* search_high = high2
* while search_low < search_high: # <<<<<<<<<<<<<<
@@ -43777,7 +43191,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_3 = ((__pyx_v_search_low < __pyx_v_search_high) != 0);
if (!__pyx_t_3) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":590
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":576
* search_high = high2
* while search_low < search_high:
* med2 = median(search_low, search_high, step2) # <<<<<<<<<<<<<<
@@ -43786,7 +43200,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_med2 = __pyx_f_4cdec_2sa_3_sa_median(__pyx_v_search_low, __pyx_v_search_high, __pyx_v_step2);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":591
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":577
* while search_low < search_high:
* med2 = median(search_low, search_high, step2)
* assign_matching(&loc2, arr2, med2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -43795,7 +43209,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_med2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":592
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":578
* 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) # <<<<<<<<<<<<<<
@@ -43804,7 +43218,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_comparison = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings_set(__pyx_v_self, __pyx_v_med1_minus, __pyx_v_med1_plus, __pyx_v_arr1, __pyx_v_step1, (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":595
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":581
* if comparison == -1:
* search_high = med2
* elif comparison == 1: # <<<<<<<<<<<<<<
@@ -43813,7 +43227,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
switch (__pyx_v_comparison) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":593
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":579
* 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: # <<<<<<<<<<<<<<
@@ -43822,7 +43236,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
case -1:
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":594
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":580
* comparison = self.compare_matchings_set(med1_minus, med1_plus, arr1, step1, &loc2, offset_by_one, len_last)
* if comparison == -1:
* search_high = med2 # <<<<<<<<<<<<<<
@@ -43832,7 +43246,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_v_search_high = __pyx_v_med2;
break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":595
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":581
* if comparison == -1:
* search_high = med2
* elif comparison == 1: # <<<<<<<<<<<<<<
@@ -43841,7 +43255,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
case 1:
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":596
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":582
* search_high = med2
* elif comparison == 1:
* search_low = med2 + step2 # <<<<<<<<<<<<<<
@@ -43852,7 +43266,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
break;
default:
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":598
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":584
* search_low = med2 + step2
* else:
* break # <<<<<<<<<<<<<<
@@ -43867,7 +43281,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
}
__pyx_L9:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":600
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":586
* break
*
* med_result_len = 0 # <<<<<<<<<<<<<<
@@ -43876,7 +43290,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_med_result_len = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":601
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":587
*
* med_result_len = 0
* med_result = <int*> malloc(0*sizeof(int*)) # <<<<<<<<<<<<<<
@@ -43885,7 +43299,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_med_result = ((int *)malloc((0 * (sizeof(int *)))));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":602
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":588
* med_result_len = 0
* med_result = <int*> malloc(0*sizeof(int*))
* if search_high > search_low: # <<<<<<<<<<<<<<
@@ -43895,7 +43309,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_3 = ((__pyx_v_search_high > __pyx_v_search_low) != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":608
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":594
* # want to store the bindings for all of those elements. We can
* # subsequently throw all of them away.
* med2_minus = med2 # <<<<<<<<<<<<<<
@@ -43904,7 +43318,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_med2_minus = __pyx_v_med2;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":609
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":595
* # subsequently throw all of them away.
* med2_minus = med2
* med2_plus = med2 + step2 # <<<<<<<<<<<<<<
@@ -43913,7 +43327,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_med2_plus = (__pyx_v_med2 + __pyx_v_step2);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":610
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":596
* med2_minus = med2
* med2_plus = med2 + step2
* i1 = med1_minus # <<<<<<<<<<<<<<
@@ -43922,7 +43336,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_i1 = __pyx_v_med1_minus;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":611
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":597
* med2_plus = med2 + step2
* i1 = med1_minus
* while i1 < med1_plus: # <<<<<<<<<<<<<<
@@ -43933,7 +43347,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_3 = ((__pyx_v_i1 < __pyx_v_med1_plus) != 0);
if (!__pyx_t_3) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":612
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":598
* i1 = med1_minus
* while i1 < med1_plus:
* assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -43942,7 +43356,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":613
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":599
* while i1 < med1_plus:
* assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr)
* while med2_minus-step2 >= low2: # <<<<<<<<<<<<<<
@@ -43953,7 +43367,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_3 = (((__pyx_v_med2_minus - __pyx_v_step2) >= __pyx_v_low2) != 0);
if (!__pyx_t_3) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":614
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":600
* 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) # <<<<<<<<<<<<<<
@@ -43962,7 +43376,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, (__pyx_v_med2_minus - __pyx_v_step2), __pyx_v_step2, __pyx_v_self->fda->sent_id->arr);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":615
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":601
* 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: # <<<<<<<<<<<<<<
@@ -43972,7 +43386,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_3 = ((((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last) < 1) != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":616
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":602
* 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 # <<<<<<<<<<<<<<
@@ -43984,7 +43398,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":618
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":604
* med2_minus = med2_minus - step2
* else:
* break # <<<<<<<<<<<<<<
@@ -43997,7 +43411,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
}
__pyx_L18_break:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":619
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":605
* else:
* break
* i2 = med2_minus # <<<<<<<<<<<<<<
@@ -44006,7 +43420,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_i2 = __pyx_v_med2_minus;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":620
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":606
* break
* i2 = med2_minus
* while i2 < high2: # <<<<<<<<<<<<<<
@@ -44017,7 +43431,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_3 = ((__pyx_v_i2 < __pyx_v_high2) != 0);
if (!__pyx_t_3) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":621
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":607
* i2 = med2_minus
* while i2 < high2:
* assign_matching(&loc2, arr2, i2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -44026,7 +43440,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_i2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":622
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":608
* 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) # <<<<<<<<<<<<<<
@@ -44035,7 +43449,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_comparison = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":623
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":609
* 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: # <<<<<<<<<<<<<<
@@ -44045,7 +43459,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_3 = ((__pyx_v_comparison == 0) != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":625
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":611
* if comparison == 0:
* pass
* med_result = append_combined_matching(med_result, &loc1, &loc2, offset_by_one, num_subpatterns, &med_result_len) # <<<<<<<<<<<<<<
@@ -44057,7 +43471,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
}
__pyx_L22:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":626
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":612
* pass
* med_result = append_combined_matching(med_result, &loc1, &loc2, offset_by_one, num_subpatterns, &med_result_len)
* if comparison == -1: # <<<<<<<<<<<<<<
@@ -44067,7 +43481,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_3 = ((__pyx_v_comparison == -1) != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":627
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":613
* med_result = append_combined_matching(med_result, &loc1, &loc2, offset_by_one, num_subpatterns, &med_result_len)
* if comparison == -1:
* break # <<<<<<<<<<<<<<
@@ -44079,7 +43493,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
}
__pyx_L23:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":628
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":614
* if comparison == -1:
* break
* i2 = i2 + step2 # <<<<<<<<<<<<<<
@@ -44090,7 +43504,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
}
__pyx_L21_break:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":629
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":615
* break
* i2 = i2 + step2
* if i2 > med2_plus: # <<<<<<<<<<<<<<
@@ -44100,7 +43514,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_3 = ((__pyx_v_i2 > __pyx_v_med2_plus) != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":630
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":616
* i2 = i2 + step2
* if i2 > med2_plus:
* med2_plus = i2 # <<<<<<<<<<<<<<
@@ -44112,7 +43526,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
}
__pyx_L24:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":631
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":617
* if i2 > med2_plus:
* med2_plus = i2
* i1 = i1 + step1 # <<<<<<<<<<<<<<
@@ -44122,7 +43536,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_v_i1 = (__pyx_v_i1 + __pyx_v_step1);
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":633
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":619
* i1 = i1 + step1
*
* tmp = med1_minus # <<<<<<<<<<<<<<
@@ -44131,7 +43545,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_tmp = __pyx_v_med1_minus;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":634
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":620
*
* tmp = med1_minus
* med1_minus = med1_plus # <<<<<<<<<<<<<<
@@ -44140,7 +43554,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_med1_minus = __pyx_v_med1_plus;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":635
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":621
* tmp = med1_minus
* med1_minus = med1_plus
* med1_plus = tmp # <<<<<<<<<<<<<<
@@ -44152,7 +43566,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":638
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":624
* else:
* # No match; need to figure out the point of division in D and Q
* med2_minus = med2 # <<<<<<<<<<<<<<
@@ -44161,7 +43575,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_med2_minus = __pyx_v_med2;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":639
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":625
* # No match; need to figure out the point of division in D and Q
* med2_minus = med2
* med2_plus = med2 # <<<<<<<<<<<<<<
@@ -44170,7 +43584,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_med2_plus = __pyx_v_med2;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":640
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":626
* med2_minus = med2
* med2_plus = med2
* if d_first: # <<<<<<<<<<<<<<
@@ -44180,7 +43594,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_3 = (__pyx_v_d_first != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":641
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":627
* med2_plus = med2
* if d_first:
* med2_minus = med2_minus + step2 # <<<<<<<<<<<<<<
@@ -44189,7 +43603,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_med2_minus = (__pyx_v_med2_minus + __pyx_v_step2);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":642
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":628
* if d_first:
* med2_minus = med2_minus + step2
* if comparison == -1: # <<<<<<<<<<<<<<
@@ -44199,7 +43613,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_3 = ((__pyx_v_comparison == -1) != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":643
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":629
* med2_minus = med2_minus + step2
* if comparison == -1:
* med1_minus = med1_plus # <<<<<<<<<<<<<<
@@ -44211,7 +43625,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
}
__pyx_L26:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":644
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":630
* if comparison == -1:
* med1_minus = med1_plus
* if comparison == 1: # <<<<<<<<<<<<<<
@@ -44221,7 +43635,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_3 = ((__pyx_v_comparison == 1) != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":645
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":631
* med1_minus = med1_plus
* if comparison == 1:
* med1_plus = med1_minus # <<<<<<<<<<<<<<
@@ -44236,7 +43650,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":647
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":633
* med1_plus = med1_minus
* else:
* tmp = med1_minus # <<<<<<<<<<<<<<
@@ -44245,7 +43659,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_tmp = __pyx_v_med1_minus;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":648
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":634
* else:
* tmp = med1_minus
* med1_minus = med1_plus # <<<<<<<<<<<<<<
@@ -44254,7 +43668,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_med1_minus = __pyx_v_med1_plus;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":649
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":635
* tmp = med1_minus
* med1_minus = med1_plus
* med1_plus = tmp # <<<<<<<<<<<<<<
@@ -44263,7 +43677,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_med1_plus = __pyx_v_tmp;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":650
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":636
* med1_minus = med1_plus
* med1_plus = tmp
* if comparison == 1: # <<<<<<<<<<<<<<
@@ -44273,7 +43687,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
__pyx_t_3 = ((__pyx_v_comparison == 1) != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":651
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":637
* med1_plus = tmp
* if comparison == 1:
* med2_minus = med2_minus + step2 # <<<<<<<<<<<<<<
@@ -44282,7 +43696,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_med2_minus = (__pyx_v_med2_minus + __pyx_v_step2);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":652
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":638
* if comparison == 1:
* med2_minus = med2_minus + step2
* med2_plus = med2_plus + step2 # <<<<<<<<<<<<<<
@@ -44298,7 +43712,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
}
__pyx_L14:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":654
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":640
* med2_plus = med2_plus + step2
*
* low_result_len = 0 # <<<<<<<<<<<<<<
@@ -44307,7 +43721,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_low_result_len = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":655
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":641
*
* 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) # <<<<<<<<<<<<<<
@@ -44316,7 +43730,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_low_result = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->baeza_yates_helper(__pyx_v_self, __pyx_v_low1, __pyx_v_med1_plus, __pyx_v_arr1, __pyx_v_step1, __pyx_v_low2, __pyx_v_med2_plus, __pyx_v_arr2, __pyx_v_step2, __pyx_v_offset_by_one, __pyx_v_len_last, __pyx_v_num_subpatterns, (&__pyx_v_low_result_len));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":656
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":642
* low_result_len = 0
* low_result = self.baeza_yates_helper(low1, med1_plus, arr1, step1, low2, med2_plus, arr2, step2, offset_by_one, len_last, num_subpatterns, &low_result_len)
* high_result_len = 0 # <<<<<<<<<<<<<<
@@ -44325,7 +43739,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_high_result_len = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":657
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":643
* 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) # <<<<<<<<<<<<<<
@@ -44334,7 +43748,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_high_result = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->baeza_yates_helper(__pyx_v_self, __pyx_v_med1_minus, __pyx_v_high1, __pyx_v_arr1, __pyx_v_step1, __pyx_v_med2_minus, __pyx_v_high2, __pyx_v_arr2, __pyx_v_step2, __pyx_v_offset_by_one, __pyx_v_len_last, __pyx_v_num_subpatterns, (&__pyx_v_high_result_len));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":659
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":645
* 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) # <<<<<<<<<<<<<<
@@ -44343,7 +43757,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_result = __pyx_f_4cdec_2sa_3_sa_extend_arr(__pyx_v_result, __pyx_v_result_len, __pyx_v_low_result, __pyx_v_low_result_len);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":660
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":646
*
* result = extend_arr(result, result_len, low_result, low_result_len)
* result = extend_arr(result, result_len, med_result, med_result_len) # <<<<<<<<<<<<<<
@@ -44352,7 +43766,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_result = __pyx_f_4cdec_2sa_3_sa_extend_arr(__pyx_v_result, __pyx_v_result_len, __pyx_v_med_result, __pyx_v_med_result_len);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":661
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":647
* result = extend_arr(result, result_len, low_result, low_result_len)
* result = extend_arr(result, result_len, med_result, med_result_len)
* result = extend_arr(result, result_len, high_result, high_result_len) # <<<<<<<<<<<<<<
@@ -44361,7 +43775,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
__pyx_v_result = __pyx_f_4cdec_2sa_3_sa_extend_arr(__pyx_v_result, __pyx_v_result_len, __pyx_v_high_result, __pyx_v_high_result_len);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":662
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":648
* 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) # <<<<<<<<<<<<<<
@@ -44370,7 +43784,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
free(__pyx_v_low_result);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":663
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":649
* result = extend_arr(result, result_len, high_result, high_result_len)
* free(low_result)
* free(med_result) # <<<<<<<<<<<<<<
@@ -44379,7 +43793,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
free(__pyx_v_med_result);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":664
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":650
* free(low_result)
* free(med_result)
* free(high_result) # <<<<<<<<<<<<<<
@@ -44388,7 +43802,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
*/
free(__pyx_v_high_result);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":666
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":652
* free(high_result)
*
* return result # <<<<<<<<<<<<<<
@@ -44408,7 +43822,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":670
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":656
*
*
* cdef long compare_matchings_set(self, int i1_minus, int i1_plus, int* arr1, int step1, # <<<<<<<<<<<<<<
@@ -44427,7 +43841,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s
int __pyx_t_1;
__Pyx_RefNannySetupContext("compare_matchings_set", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":681
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":667
* cdef Matching* loc1
*
* loc1 = &l1_stack # <<<<<<<<<<<<<<
@@ -44436,7 +43850,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s
*/
__pyx_v_loc1 = (&__pyx_v_l1_stack);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":683
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":669
* loc1 = &l1_stack
*
* i1 = i1_minus # <<<<<<<<<<<<<<
@@ -44445,7 +43859,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s
*/
__pyx_v_i1 = __pyx_v_i1_minus;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":684
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":670
*
* i1 = i1_minus
* while i1 < i1_plus: # <<<<<<<<<<<<<<
@@ -44456,7 +43870,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s
__pyx_t_1 = ((__pyx_v_i1 < __pyx_v_i1_plus) != 0);
if (!__pyx_t_1) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":685
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":671
* i1 = i1_minus
* while i1 < i1_plus:
* assign_matching(loc1, arr1, i1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -44465,7 +43879,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s
*/
__pyx_f_4cdec_2sa_3_sa_assign_matching(__pyx_v_loc1, __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":686
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":672
* 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) # <<<<<<<<<<<<<<
@@ -44474,7 +43888,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s
*/
__pyx_v_comparison = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, __pyx_v_loc1, __pyx_v_loc2, __pyx_v_offset_by_one, __pyx_v_len_last);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":687
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":673
* 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: # <<<<<<<<<<<<<<
@@ -44484,7 +43898,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s
__pyx_t_1 = ((__pyx_v_comparison == 0) != 0);
if (__pyx_t_1) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":688
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":674
* comparison = self.compare_matchings(loc1, loc2, offset_by_one, len_last)
* if comparison == 0:
* prev_comparison = 0 # <<<<<<<<<<<<<<
@@ -44493,7 +43907,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s
*/
__pyx_v_prev_comparison = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":689
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":675
* if comparison == 0:
* prev_comparison = 0
* break # <<<<<<<<<<<<<<
@@ -44504,7 +43918,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s
goto __pyx_L5;
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":690
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":676
* prev_comparison = 0
* break
* elif i1 == i1_minus: # <<<<<<<<<<<<<<
@@ -44514,7 +43928,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s
__pyx_t_1 = ((__pyx_v_i1 == __pyx_v_i1_minus) != 0);
if (__pyx_t_1) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":691
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":677
* break
* elif i1 == i1_minus:
* prev_comparison = comparison # <<<<<<<<<<<<<<
@@ -44526,7 +43940,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":693
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":679
* prev_comparison = comparison
* else:
* if comparison != prev_comparison: # <<<<<<<<<<<<<<
@@ -44536,7 +43950,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s
__pyx_t_1 = ((__pyx_v_comparison != __pyx_v_prev_comparison) != 0);
if (__pyx_t_1) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":694
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":680
* else:
* if comparison != prev_comparison:
* prev_comparison = 0 # <<<<<<<<<<<<<<
@@ -44545,7 +43959,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s
*/
__pyx_v_prev_comparison = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":695
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":681
* if comparison != prev_comparison:
* prev_comparison = 0
* break # <<<<<<<<<<<<<<
@@ -44559,7 +43973,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s
}
__pyx_L5:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":696
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":682
* prev_comparison = 0
* break
* i1 = i1 + step1 # <<<<<<<<<<<<<<
@@ -44570,7 +43984,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s
}
__pyx_L4_break:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":697
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":683
* break
* i1 = i1 + step1
* return prev_comparison # <<<<<<<<<<<<<<
@@ -44586,7 +44000,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings_s
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":700
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":686
*
*
* cdef long compare_matchings(self, Matching* loc1, Matching* loc2, int offset_by_one, int len_last): # <<<<<<<<<<<<<<
@@ -44604,7 +44018,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
int __pyx_t_4;
__Pyx_RefNannySetupContext("compare_matchings", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":703
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":689
* cdef int i
*
* if loc1.sent_id > loc2.sent_id: # <<<<<<<<<<<<<<
@@ -44614,7 +44028,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
__pyx_t_1 = ((__pyx_v_loc1->sent_id > __pyx_v_loc2->sent_id) != 0);
if (__pyx_t_1) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":704
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":690
*
* if loc1.sent_id > loc2.sent_id:
* return 1 # <<<<<<<<<<<<<<
@@ -44627,7 +44041,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
}
__pyx_L3:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":705
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":691
* if loc1.sent_id > loc2.sent_id:
* return 1
* if loc2.sent_id > loc1.sent_id: # <<<<<<<<<<<<<<
@@ -44637,7 +44051,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
__pyx_t_1 = ((__pyx_v_loc2->sent_id > __pyx_v_loc1->sent_id) != 0);
if (__pyx_t_1) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":706
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":692
* return 1
* if loc2.sent_id > loc1.sent_id:
* return -1 # <<<<<<<<<<<<<<
@@ -44650,7 +44064,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
}
__pyx_L4:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":708
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":694
* return -1
*
* if loc1.size == 1 and loc2.size == 1: # <<<<<<<<<<<<<<
@@ -44666,7 +44080,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
}
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":709
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":695
*
* if loc1.size == 1 and loc2.size == 1:
* if loc2.arr[loc2.start] - loc1.arr[loc1.start] <= self.train_min_gap_size: # <<<<<<<<<<<<<<
@@ -44676,7 +44090,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
__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) != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":710
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":696
* if loc1.size == 1 and loc2.size == 1:
* if loc2.arr[loc2.start] - loc1.arr[loc1.start] <= self.train_min_gap_size:
* return 1 # <<<<<<<<<<<<<<
@@ -44691,7 +44105,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
goto __pyx_L5;
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":712
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":698
* return 1
*
* elif offset_by_one: # <<<<<<<<<<<<<<
@@ -44701,7 +44115,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
__pyx_t_3 = (__pyx_v_offset_by_one != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":713
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":699
*
* elif offset_by_one:
* for i from 1 <= i < loc1.size: # <<<<<<<<<<<<<<
@@ -44711,7 +44125,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
__pyx_t_4 = __pyx_v_loc1->size;
for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":714
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":700
* elif offset_by_one:
* for i from 1 <= i < loc1.size:
* if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i-1]: # <<<<<<<<<<<<<<
@@ -44721,7 +44135,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
__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)])) != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":715
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":701
* for i from 1 <= i < loc1.size:
* if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i-1]:
* return 1 # <<<<<<<<<<<<<<
@@ -44734,7 +44148,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
}
__pyx_L9:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":716
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":702
* 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]: # <<<<<<<<<<<<<<
@@ -44744,7 +44158,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
__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)])) != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":717
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":703
* return 1
* if loc1.arr[loc1.start+i] < loc2.arr[loc2.start+i-1]:
* return -1 # <<<<<<<<<<<<<<
@@ -44761,7 +44175,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":720
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":706
*
* else:
* if loc1.arr[loc1.start]+1 > loc2.arr[loc2.start]: # <<<<<<<<<<<<<<
@@ -44771,7 +44185,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
__pyx_t_3 = ((((__pyx_v_loc1->arr[__pyx_v_loc1->start]) + 1) > (__pyx_v_loc2->arr[__pyx_v_loc2->start])) != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":721
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":707
* else:
* if loc1.arr[loc1.start]+1 > loc2.arr[loc2.start]:
* return 1 # <<<<<<<<<<<<<<
@@ -44784,7 +44198,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
}
__pyx_L11:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":722
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":708
* if loc1.arr[loc1.start]+1 > loc2.arr[loc2.start]:
* return 1
* if loc1.arr[loc1.start]+1 < loc2.arr[loc2.start]: # <<<<<<<<<<<<<<
@@ -44794,7 +44208,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
__pyx_t_3 = ((((__pyx_v_loc1->arr[__pyx_v_loc1->start]) + 1) < (__pyx_v_loc2->arr[__pyx_v_loc2->start])) != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":723
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":709
* return 1
* if loc1.arr[loc1.start]+1 < loc2.arr[loc2.start]:
* return -1 # <<<<<<<<<<<<<<
@@ -44807,7 +44221,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
}
__pyx_L12:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":725
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":711
* return -1
*
* for i from 1 <= i < loc1.size: # <<<<<<<<<<<<<<
@@ -44817,7 +44231,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
__pyx_t_4 = __pyx_v_loc1->size;
for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":726
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":712
*
* for i from 1 <= i < loc1.size:
* if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i]: # <<<<<<<<<<<<<<
@@ -44827,7 +44241,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
__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)])) != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":727
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":713
* for i from 1 <= i < loc1.size:
* if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i]:
* return 1 # <<<<<<<<<<<<<<
@@ -44840,7 +44254,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
}
__pyx_L15:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":728
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":714
* if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i]:
* return 1
* if loc1.arr[loc1.start+i] < loc2.arr[loc2.start+i]: # <<<<<<<<<<<<<<
@@ -44850,7 +44264,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
__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)])) != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":729
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":715
* return 1
* if loc1.arr[loc1.start+i] < loc2.arr[loc2.start+i]:
* return -1 # <<<<<<<<<<<<<<
@@ -44866,7 +44280,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
}
__pyx_L5:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":731
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":717
* return -1
*
* if loc2.arr[loc2.end-1] + len_last - loc1.arr[loc1.start] > self.train_max_initial_size: # <<<<<<<<<<<<<<
@@ -44876,7 +44290,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
__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) != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":732
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":718
*
* if loc2.arr[loc2.end-1] + len_last - loc1.arr[loc1.start] > self.train_max_initial_size:
* return -1 # <<<<<<<<<<<<<<
@@ -44889,7 +44303,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
}
__pyx_L17:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":733
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":719
* if loc2.arr[loc2.end-1] + len_last - loc1.arr[loc1.start] > self.train_max_initial_size:
* return -1
* return 0 # <<<<<<<<<<<<<<
@@ -44905,7 +44319,7 @@ static long __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_compare_matchings(s
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":736
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":722
*
*
* cdef int* merge_helper(self, int low1, int high1, int* arr1, int step1, # <<<<<<<<<<<<<<
@@ -44929,7 +44343,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
int __pyx_t_3;
__Pyx_RefNannySetupContext("merge_helper", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":744
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":730
* cdef Matching loc1, loc2
*
* result_len[0] = 0 # <<<<<<<<<<<<<<
@@ -44938,7 +44352,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
*/
(__pyx_v_result_len[0]) = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":745
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":731
*
* result_len[0] = 0
* result = <int*> malloc(0*sizeof(int)) # <<<<<<<<<<<<<<
@@ -44947,7 +44361,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
*/
__pyx_v_result = ((int *)malloc((0 * (sizeof(int)))));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":747
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":733
* result = <int*> malloc(0*sizeof(int))
*
* i1 = low1 # <<<<<<<<<<<<<<
@@ -44956,7 +44370,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
*/
__pyx_v_i1 = __pyx_v_low1;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":748
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":734
*
* i1 = low1
* i2 = low2 # <<<<<<<<<<<<<<
@@ -44965,7 +44379,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
*/
__pyx_v_i2 = __pyx_v_low2;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":749
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":735
* i1 = low1
* i2 = low2
* while i1 < high1 and i2 < high2: # <<<<<<<<<<<<<<
@@ -44982,7 +44396,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
}
if (!__pyx_t_3) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":752
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":738
*
* # First, pop all unneeded loc2's off the stack
* assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -44991,7 +44405,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
*/
__pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":753
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":739
* # First, pop all unneeded loc2's off the stack
* assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr)
* while i2 < high2: # <<<<<<<<<<<<<<
@@ -45002,7 +44416,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
__pyx_t_3 = ((__pyx_v_i2 < __pyx_v_high2) != 0);
if (!__pyx_t_3) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":754
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":740
* 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) # <<<<<<<<<<<<<<
@@ -45011,7 +44425,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
*/
__pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_i2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":755
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":741
* 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: # <<<<<<<<<<<<<<
@@ -45021,7 +44435,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
__pyx_t_3 = ((((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last) == 1) != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":756
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":742
* 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 # <<<<<<<<<<<<<<
@@ -45033,7 +44447,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":758
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":744
* i2 = i2 + step2
* else:
* break # <<<<<<<<<<<<<<
@@ -45046,7 +44460,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
}
__pyx_L6_break:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":761
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":747
*
* # Next: process all loc1's with the same starting val
* j1 = i1 # <<<<<<<<<<<<<<
@@ -45055,7 +44469,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
*/
__pyx_v_j1 = __pyx_v_i1;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":762
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":748
* # Next: process all loc1's with the same starting val
* j1 = i1
* while i1 < high1 and arr1[j1] == arr1[i1]: # <<<<<<<<<<<<<<
@@ -45072,7 +44486,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
}
if (!__pyx_t_2) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":763
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":749
* j1 = i1
* while i1 < high1 and arr1[j1] == arr1[i1]:
* assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -45081,7 +44495,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
*/
__pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":764
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":750
* while i1 < high1 and arr1[j1] == arr1[i1]:
* assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr)
* j2 = i2 # <<<<<<<<<<<<<<
@@ -45090,7 +44504,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
*/
__pyx_v_j2 = __pyx_v_i2;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":765
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":751
* assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr)
* j2 = i2
* while j2 < high2: # <<<<<<<<<<<<<<
@@ -45101,7 +44515,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
__pyx_t_2 = ((__pyx_v_j2 < __pyx_v_high2) != 0);
if (!__pyx_t_2) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":766
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":752
* j2 = i2
* while j2 < high2:
* assign_matching(&loc2, arr2, j2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -45110,7 +44524,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
*/
__pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_j2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":767
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":753
* 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) # <<<<<<<<<<<<<<
@@ -45119,7 +44533,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
*/
__pyx_v_comparison = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":768
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":754
* 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: # <<<<<<<<<<<<<<
@@ -45129,7 +44543,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
__pyx_t_2 = ((__pyx_v_comparison == 0) != 0);
if (__pyx_t_2) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":769
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":755
* 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) # <<<<<<<<<<<<<<
@@ -45141,7 +44555,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
}
__pyx_L12:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":770
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":756
* if comparison == 0:
* result = append_combined_matching(result, &loc1, &loc2, offset_by_one, num_subpatterns, result_len)
* if comparison == 1: # <<<<<<<<<<<<<<
@@ -45154,7 +44568,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
}
__pyx_L13:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":772
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":758
* if comparison == 1:
* pass
* if comparison == -1: # <<<<<<<<<<<<<<
@@ -45164,7 +44578,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
__pyx_t_2 = ((__pyx_v_comparison == -1) != 0);
if (__pyx_t_2) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":773
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":759
* pass
* if comparison == -1:
* break # <<<<<<<<<<<<<<
@@ -45176,7 +44590,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":775
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":761
* break
* else:
* j2 = j2 + step2 # <<<<<<<<<<<<<<
@@ -45189,7 +44603,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
}
__pyx_L11_break:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":776
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":762
* else:
* j2 = j2 + step2
* i1 = i1 + step1 # <<<<<<<<<<<<<<
@@ -45200,7 +44614,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
}
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":777
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":763
* j2 = j2 + step2
* i1 = i1 + step1
* return result # <<<<<<<<<<<<<<
@@ -45216,7 +44630,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_merge_helper(struct
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":780
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":766
*
*
* cdef void sort_phrase_loc(self, IntList arr, PhraseLocation loc, Phrase phrase): # <<<<<<<<<<<<<<
@@ -45239,27 +44653,27 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("sort_phrase_loc", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":785
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":771
* 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 = 785; __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 = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":786
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":772
*
* 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_3 = PyObject_GetItem(__pyx_v_self->precomputed_index, ((PyObject *)__pyx_v_phrase)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_v_self->precomputed_index, ((PyObject *)__pyx_v_phrase)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 772; __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_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GIVEREF(__pyx_t_3);
__Pyx_GOTREF(__pyx_v_loc->arr);
__Pyx_DECREF(((PyObject *)__pyx_v_loc->arr));
@@ -45269,20 +44683,20 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":788
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":774
* 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_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
- __pyx_t_4 = PyInt_FromLong((__pyx_v_loc->sa_high - __pyx_v_loc->sa_low)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong((__pyx_v_loc->sa_high - __pyx_v_loc->sa_low)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 774; __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_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__Pyx_GIVEREF(__pyx_t_4);
@@ -45291,27 +44705,27 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str
__pyx_v_loc->arr = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_4);
__pyx_t_4 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":789
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":775
* 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_4 = PyInt_FromLong(__pyx_v_arr->len); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_v_arr->len); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 789; __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 = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_VEB)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_VEB)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__pyx_v_veb = ((struct __pyx_obj_4cdec_2sa_3_sa_VEB *)__pyx_t_4);
__pyx_t_4 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":790
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":776
* 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: # <<<<<<<<<<<<<<
@@ -45321,7 +44735,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str
__pyx_t_5 = __pyx_v_loc->sa_high;
for (__pyx_v_i = __pyx_v_loc->sa_low; __pyx_v_i < __pyx_t_5; __pyx_v_i++) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":791
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":777
* veb = VEB(arr.len)
* for i from loc.sa_low <= i < loc.sa_high:
* veb._insert(arr.arr[i]) # <<<<<<<<<<<<<<
@@ -45331,7 +44745,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_VEB *)__pyx_v_veb->__pyx_vtab)->_insert(__pyx_v_veb, (__pyx_v_arr->arr[__pyx_v_i]));
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":792
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":778
* for i from loc.sa_low <= i < loc.sa_high:
* veb._insert(arr.arr[i])
* i = veb.veb.min_val # <<<<<<<<<<<<<<
@@ -45341,7 +44755,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str
__pyx_t_5 = __pyx_v_veb->veb->min_val;
__pyx_v_i = __pyx_t_5;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":793
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":779
* veb._insert(arr.arr[i])
* i = veb.veb.min_val
* for j from 0 <= j < loc.sa_high-loc.sa_low: # <<<<<<<<<<<<<<
@@ -45351,7 +44765,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str
__pyx_t_5 = (__pyx_v_loc->sa_high - __pyx_v_loc->sa_low);
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_5; __pyx_v_j++) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":794
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":780
* i = veb.veb.min_val
* for j from 0 <= j < loc.sa_high-loc.sa_low:
* loc.arr.arr[j] = i # <<<<<<<<<<<<<<
@@ -45360,7 +44774,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str
*/
(__pyx_v_loc->arr->arr[__pyx_v_j]) = __pyx_v_i;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":795
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":781
* for j from 0 <= j < loc.sa_high-loc.sa_low:
* loc.arr.arr[j] = i
* i = veb._findsucc(i) # <<<<<<<<<<<<<<
@@ -45372,7 +44786,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str
}
__pyx_L3:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":796
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":782
* loc.arr.arr[j] = i
* i = veb._findsucc(i)
* loc.arr_low = 0 # <<<<<<<<<<<<<<
@@ -45381,7 +44795,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str
*/
__pyx_v_loc->arr_low = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":797
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":783
* i = veb._findsucc(i)
* loc.arr_low = 0
* loc.arr_high = loc.arr.len # <<<<<<<<<<<<<<
@@ -45401,7 +44815,7 @@ static void __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(str
__Pyx_RefNannyFinishContext();
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":800
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":786
*
*
* cdef intersect_helper(self, Phrase prefix, Phrase suffix, # <<<<<<<<<<<<<<
@@ -45438,7 +44852,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("intersect_helper", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":807
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":793
* cdef int* result_ptr
*
* result_len = 0 # <<<<<<<<<<<<<<
@@ -45447,21 +44861,21 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
*/
__pyx_v_result_len = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":809
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":795
* 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, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_suffix), 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 795; __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 = 809; __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 = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_3 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar(__pyx_t_2) != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":810
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":796
*
* if sym_isvar(suffix[0]):
* offset_by_one = 1 # <<<<<<<<<<<<<<
@@ -45473,7 +44887,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":812
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":798
* offset_by_one = 1
* else:
* offset_by_one = 0 # <<<<<<<<<<<<<<
@@ -45484,34 +44898,34 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
}
__pyx_L3:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":814
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":800
* offset_by_one = 0
*
* len_last = len(suffix.getchunk(suffix.arity())) # <<<<<<<<<<<<<<
*
* if prefix_loc.arr is None:
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_suffix), __pyx_n_s__getchunk); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_suffix), __pyx_n_s__getchunk); if (unlikely(!__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_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_suffix), __pyx_n_s__arity); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_suffix), __pyx_n_s__arity); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 800; __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 = 814; __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 = 800; __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 = 814; __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 = 800; __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 = 814; __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 = 800; __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 = 814; __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 = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_len_last = __pyx_t_6;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":816
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":802
* len_last = len(suffix.getchunk(suffix.arity()))
*
* if prefix_loc.arr is None: # <<<<<<<<<<<<<<
@@ -45522,7 +44936,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
__pyx_t_7 = (__pyx_t_3 != 0);
if (__pyx_t_7) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":817
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":803
*
* if prefix_loc.arr is None:
* self.sort_phrase_loc(self.fsa.sa, prefix_loc, prefix) # <<<<<<<<<<<<<<
@@ -45537,7 +44951,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
}
__pyx_L4:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":818
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":804
* if prefix_loc.arr is None:
* self.sort_phrase_loc(self.fsa.sa, prefix_loc, prefix)
* arr1 = prefix_loc.arr # <<<<<<<<<<<<<<
@@ -45549,7 +44963,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
__pyx_v_arr1 = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_5);
__pyx_t_5 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":819
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":805
* self.sort_phrase_loc(self.fsa.sa, prefix_loc, prefix)
* arr1 = prefix_loc.arr
* low1 = prefix_loc.arr_low # <<<<<<<<<<<<<<
@@ -45559,7 +44973,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
__pyx_t_2 = __pyx_v_prefix_loc->arr_low;
__pyx_v_low1 = __pyx_t_2;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":820
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":806
* arr1 = prefix_loc.arr
* low1 = prefix_loc.arr_low
* high1 = prefix_loc.arr_high # <<<<<<<<<<<<<<
@@ -45569,7 +44983,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
__pyx_t_2 = __pyx_v_prefix_loc->arr_high;
__pyx_v_high1 = __pyx_t_2;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":821
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":807
* low1 = prefix_loc.arr_low
* high1 = prefix_loc.arr_high
* step1 = prefix_loc.num_subpatterns # <<<<<<<<<<<<<<
@@ -45579,7 +44993,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
__pyx_t_2 = __pyx_v_prefix_loc->num_subpatterns;
__pyx_v_step1 = __pyx_t_2;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":823
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":809
* step1 = prefix_loc.num_subpatterns
*
* if suffix_loc.arr is None: # <<<<<<<<<<<<<<
@@ -45590,7 +45004,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
__pyx_t_3 = (__pyx_t_7 != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":824
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":810
*
* if suffix_loc.arr is None:
* self.sort_phrase_loc(self.fsa.sa, suffix_loc, suffix) # <<<<<<<<<<<<<<
@@ -45605,7 +45019,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
}
__pyx_L5:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":825
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":811
* if suffix_loc.arr is None:
* self.sort_phrase_loc(self.fsa.sa, suffix_loc, suffix)
* arr2 = suffix_loc.arr # <<<<<<<<<<<<<<
@@ -45617,7 +45031,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
__pyx_v_arr2 = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_5);
__pyx_t_5 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":826
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":812
* self.sort_phrase_loc(self.fsa.sa, suffix_loc, suffix)
* arr2 = suffix_loc.arr
* low2 = suffix_loc.arr_low # <<<<<<<<<<<<<<
@@ -45627,7 +45041,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
__pyx_t_2 = __pyx_v_suffix_loc->arr_low;
__pyx_v_low2 = __pyx_t_2;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":827
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":813
* arr2 = suffix_loc.arr
* low2 = suffix_loc.arr_low
* high2 = suffix_loc.arr_high # <<<<<<<<<<<<<<
@@ -45637,7 +45051,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
__pyx_t_2 = __pyx_v_suffix_loc->arr_high;
__pyx_v_high2 = __pyx_t_2;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":828
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":814
* low2 = suffix_loc.arr_low
* high2 = suffix_loc.arr_high
* step2 = suffix_loc.num_subpatterns # <<<<<<<<<<<<<<
@@ -45647,26 +45061,26 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
__pyx_t_2 = __pyx_v_suffix_loc->num_subpatterns;
__pyx_v_step2 = __pyx_t_2;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":830
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":816
* step2 = suffix_loc.num_subpatterns
*
* num_subpatterns = prefix.arity()+1 # <<<<<<<<<<<<<<
*
* if algorithm == MERGE:
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_prefix), __pyx_n_s__arity); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_prefix), __pyx_n_s__arity); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 816; __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 = 830; __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 = 816; __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 = 830; __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 = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_num_subpatterns = __pyx_t_2;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":832
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":818
* num_subpatterns = prefix.arity()+1
*
* if algorithm == MERGE: # <<<<<<<<<<<<<<
@@ -45676,7 +45090,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
__pyx_t_3 = ((__pyx_v_algorithm == __pyx_v_4cdec_2sa_3_sa_MERGE) != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":835
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":821
* result_ptr = self.merge_helper(low1, high1, arr1.arr, step1,
* low2, high2, arr2.arr, step2,
* offset_by_one, len_last, num_subpatterns, &result_len) # <<<<<<<<<<<<<<
@@ -45688,7 +45102,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":839
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":825
* 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) # <<<<<<<<<<<<<<
@@ -45699,7 +45113,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
}
__pyx_L6:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":841
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":827
* offset_by_one, len_last, num_subpatterns, &result_len)
*
* if result_len == 0: # <<<<<<<<<<<<<<
@@ -45709,7 +45123,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
__pyx_t_3 = ((__pyx_v_result_len == 0) != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":842
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":828
*
* if result_len == 0:
* free(result_ptr) # <<<<<<<<<<<<<<
@@ -45718,7 +45132,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
*/
free(__pyx_v_result_ptr);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":843
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":829
* if result_len == 0:
* free(result_ptr)
* return None # <<<<<<<<<<<<<<
@@ -45733,19 +45147,19 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":845
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":831
* return None
* else:
* result = IntList() # <<<<<<<<<<<<<<
* free(result.arr)
* result.arr = result_ptr
*/
- __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_v_result = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_5);
__pyx_t_5 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":846
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":832
* else:
* result = IntList()
* free(result.arr) # <<<<<<<<<<<<<<
@@ -45754,7 +45168,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
*/
free(__pyx_v_result->arr);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":847
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":833
* result = IntList()
* free(result.arr)
* result.arr = result_ptr # <<<<<<<<<<<<<<
@@ -45763,7 +45177,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
*/
__pyx_v_result->arr = __pyx_v_result_ptr;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":848
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":834
* free(result.arr)
* result.arr = result_ptr
* result.len = result_len # <<<<<<<<<<<<<<
@@ -45772,7 +45186,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
*/
__pyx_v_result->len = __pyx_v_result_len;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":849
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":835
* result.arr = result_ptr
* result.len = result_len
* result.size = result_len # <<<<<<<<<<<<<<
@@ -45781,7 +45195,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
*/
__pyx_v_result->size = __pyx_v_result_len;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":850
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":836
* result.len = result_len
* result.size = result_len
* return PhraseLocation(arr_low=0, arr_high=result_len, arr=result, num_subpatterns=num_subpatterns) # <<<<<<<<<<<<<<
@@ -45789,19 +45203,19 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
* 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 = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 836; __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 = 850; __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 = 850; __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 = 836; __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 = 836; __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 = 850; __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 = 836; __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 = 850; __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 = 850; __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 = 836; __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 = 836; __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 = 850; __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 = 836; __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_4cdec_2sa_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 836; __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;
@@ -45827,7 +45241,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_intersect_help
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":852
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":838
* return PhraseLocation(arr_low=0, arr_high=result_len, arr=result, num_subpatterns=num_subpatterns)
*
* cdef loc2str(self, PhraseLocation loc): # <<<<<<<<<<<<<<
@@ -45850,7 +45264,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("loc2str", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":854
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":840
* cdef loc2str(self, PhraseLocation loc):
* cdef int i, j
* result = "{" # <<<<<<<<<<<<<<
@@ -45860,7 +45274,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON
__Pyx_INCREF(((PyObject *)__pyx_kp_s_120));
__pyx_v_result = ((PyObject *)__pyx_kp_s_120);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":855
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":841
* cdef int i, j
* result = "{"
* i = 0 # <<<<<<<<<<<<<<
@@ -45869,7 +45283,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON
*/
__pyx_v_i = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":856
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":842
* result = "{"
* i = 0
* while i < loc.arr_high: # <<<<<<<<<<<<<<
@@ -45880,19 +45294,19 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON
__pyx_t_1 = ((__pyx_v_i < __pyx_v_loc->arr_high) != 0);
if (!__pyx_t_1) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":857
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":843
* 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_121)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_121)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF_SET(__pyx_v_result, __pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":858
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":844
* while i < loc.arr_high:
* result = result + "("
* for j from i <= j < i + loc.num_subpatterns: # <<<<<<<<<<<<<<
@@ -45902,38 +45316,38 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON
__pyx_t_3 = (__pyx_v_i + __pyx_v_loc->num_subpatterns);
for (__pyx_v_j = __pyx_v_i; __pyx_v_j < __pyx_t_3; __pyx_v_j++) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":859
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":845
* 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, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_loc->arr), __pyx_v_j, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_23), __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_23), __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 845; __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 = 859; __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 = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_DECREF_SET(__pyx_v_result, __pyx_t_2);
__pyx_t_2 = 0;
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":860
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":846
* 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_61)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_61)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF_SET(__pyx_v_result, __pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":861
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":847
* result = result + ("%d " %loc.arr[j])
* result = result + ")"
* i = i + loc.num_subpatterns # <<<<<<<<<<<<<<
@@ -45943,19 +45357,19 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON
__pyx_v_i = (__pyx_v_i + __pyx_v_loc->num_subpatterns);
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":862
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":848
* result = result + ")"
* i = i + loc.num_subpatterns
* result = result + "}" # <<<<<<<<<<<<<<
* return result
*
*/
- __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_122)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_122)); 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_SET(__pyx_v_result, __pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":863
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":849
* i = i + loc.num_subpatterns
* result = result + "}"
* return result # <<<<<<<<<<<<<<
@@ -45981,7 +45395,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":865
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":851
* return result
*
* cdef PhraseLocation intersect(self, prefix_node, suffix_node, Phrase phrase): # <<<<<<<<<<<<<<
@@ -46008,81 +45422,81 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("intersect", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":869
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":855
* cdef PhraseLocation prefix_loc, suffix_loc, result
*
* prefix = prefix_node.phrase # <<<<<<<<<<<<<<
* suffix = suffix_node.phrase
* prefix_loc = prefix_node.phrase_location
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_prefix_node, __pyx_n_s__phrase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_prefix_node, __pyx_n_s__phrase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 855; __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_4cdec_2sa_3_sa_Phrase))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4cdec_2sa_3_sa_Phrase))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_prefix = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":870
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":856
*
* prefix = prefix_node.phrase
* suffix = suffix_node.phrase # <<<<<<<<<<<<<<
* prefix_loc = prefix_node.phrase_location
* suffix_loc = suffix_node.phrase_location
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_suffix_node, __pyx_n_s__phrase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_suffix_node, __pyx_n_s__phrase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4cdec_2sa_3_sa_Phrase))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4cdec_2sa_3_sa_Phrase))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_suffix = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":871
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":857
* prefix = prefix_node.phrase
* suffix = suffix_node.phrase
* prefix_loc = prefix_node.phrase_location # <<<<<<<<<<<<<<
* suffix_loc = suffix_node.phrase_location
*
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_prefix_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_prefix_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_prefix_loc = ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":872
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":858
* 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 = __Pyx_PyObject_GetAttrStr(__pyx_v_suffix_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_suffix_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_suffix_loc = ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":874
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":860
* suffix_loc = suffix_node.phrase_location
*
* result = self.get_precomputed_collocation(phrase) # <<<<<<<<<<<<<<
* if result is not None:
* intersect_method = "precomputed"
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_123); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_123); 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);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 874; __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 = 860; __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 = 874; __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 = 860; __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_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_result = ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":875
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":861
*
* result = self.get_precomputed_collocation(phrase)
* if result is not None: # <<<<<<<<<<<<<<
@@ -46093,7 +45507,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23
__pyx_t_5 = (__pyx_t_4 != 0);
if (__pyx_t_5) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":876
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":862
* result = self.get_precomputed_collocation(phrase)
* if result is not None:
* intersect_method = "precomputed" # <<<<<<<<<<<<<<
@@ -46106,7 +45520,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23
}
__pyx_L3:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":878
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":864
* intersect_method = "precomputed"
*
* if result is None: # <<<<<<<<<<<<<<
@@ -46117,7 +45531,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23
__pyx_t_4 = (__pyx_t_5 != 0);
if (__pyx_t_4) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":879
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":865
*
* if result is None:
* if self.use_baeza_yates: # <<<<<<<<<<<<<<
@@ -46127,20 +45541,20 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23
__pyx_t_4 = (__pyx_v_self->use_baeza_yates != 0);
if (__pyx_t_4) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":880
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":866
* 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_4cdec_2sa_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_4cdec_2sa_3_sa_BAEZA_YATES); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = ((struct __pyx_vtabstruct_4cdec_2sa_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_4cdec_2sa_3_sa_BAEZA_YATES); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 866; __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_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF_SET(__pyx_v_result, ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)__pyx_t_3));
__pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":881
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":867
* if self.use_baeza_yates:
* result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, BAEZA_YATES)
* intersect_method="double binary" # <<<<<<<<<<<<<<
@@ -46153,20 +45567,20 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":883
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":869
* 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_4cdec_2sa_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_4cdec_2sa_3_sa_MERGE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = ((struct __pyx_vtabstruct_4cdec_2sa_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_4cdec_2sa_3_sa_MERGE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 869; __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_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF_SET(__pyx_v_result, ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)__pyx_t_3));
__pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":884
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":870
* else:
* result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, MERGE)
* intersect_method="merge" # <<<<<<<<<<<<<<
@@ -46181,7 +45595,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *__pyx_f_4cdec_2sa_3_sa_23
}
__pyx_L4:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":885
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":871
* result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, MERGE)
* intersect_method="merge"
* return result # <<<<<<<<<<<<<<
@@ -46246,16 +45660,16 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13advance(PyO
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 = 887; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("advance", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 873; __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 = 887; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("advance", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 873; __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 = 887; __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 = 873; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
@@ -46270,7 +45684,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13advance(PyO
}
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 = 887; __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 = 873; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.advance", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -46281,7 +45695,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13advance(PyO
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":887
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":873
* return result
*
* def advance(self, frontier, res, fwords): # <<<<<<<<<<<<<<
@@ -46322,19 +45736,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("advance", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":889
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":875
* 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 = 889; __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 = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_nf = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":890
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":876
* cdef unsigned na
* nf = []
* for toskip, (i, alt, pathlen) in frontier: # <<<<<<<<<<<<<<
@@ -46345,7 +45759,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
__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 = 890; __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 = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -46353,23 +45767,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
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 = 890; __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 = 876; __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 = 890; __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 = 876; __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 = 890; __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 = 876; __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 = 890; __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 = 876; __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 = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -46385,7 +45799,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -46398,16 +45812,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
__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 = 890; __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 = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 890; __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 = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
#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 = 890; __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 = 876; __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;
@@ -46415,7 +45829,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
__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 = 890; __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 = 876; __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;
@@ -46423,7 +45837,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
__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 = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L6_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_v_toskip, __pyx_t_5);
@@ -46438,7 +45852,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -46454,18 +45868,18 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
__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 = 890; __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 = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 890; __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 = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 890; __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 = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
#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 = 890; __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 = 876; __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;
@@ -46475,7 +45889,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
__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 = 890; __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 = 876; __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;
@@ -46483,7 +45897,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
__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 = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L8_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_7);
@@ -46493,44 +45907,44 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
__Pyx_XDECREF_SET(__pyx_v_pathlen, __pyx_t_10);
__pyx_t_10 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":891
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":877
* 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 = 891; __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 = 877; __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 = 891; __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 = 877; __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, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF_SET(__pyx_v_spanlen, __pyx_t_4);
__pyx_t_4 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":892
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":878
* 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 = 892; __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 = 892; __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 = 878; __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 = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_12) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":893
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":879
* 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 = 893; __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 = 879; __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);
@@ -46541,7 +45955,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
__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 = 893; __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 = 879; __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;
@@ -46549,41 +45963,41 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
}
__pyx_L9:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":894
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":880
* 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 = 894; __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 = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_XDECREF_SET(__pyx_v_ni, __pyx_t_6);
__pyx_t_6 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":895
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":881
* 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 = 895; __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 = 895; __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 = 881; __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 = 881; __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 = 895; __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 = 881; __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 = 895; __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 = 881; __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 = 895; __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 = 881; __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 = 895; __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 = 881; __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 = 895; __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 = 881; __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 = 895; __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 = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_15 = __pyx_t_14;
} else {
@@ -46591,34 +46005,34 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
}
if (__pyx_t_15) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":896
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":882
* 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 = 896; __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 = 882; __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 = 896; __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 = 882; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":897
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":883
* 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 = 897; __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 = 883; __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 = 897; __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 = 883; __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 = 897; __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 = 883; __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 = 897; __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 = 883; __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);
@@ -46629,7 +46043,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
__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 = 897; __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 = 883; __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);
@@ -46637,7 +46051,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
__Pyx_GIVEREF(((PyObject *)__pyx_t_10));
__pyx_t_5 = 0;
__pyx_t_10 = 0;
- __pyx_t_17 = __Pyx_PyList_Append(__pyx_v_nf, ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = __Pyx_PyList_Append(__pyx_v_nf, ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
}
goto __pyx_L10;
@@ -46646,18 +46060,18 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":898
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":884
* 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 = 898; __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 = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_15 = ((__pyx_t_2 > 0) != 0);
if (__pyx_t_15) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":899
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":885
* nf.append((toskip - 1, (ni, na, pathlen + 1)))
* if len(nf) > 0:
* return self.advance(nf, res, fwords) # <<<<<<<<<<<<<<
@@ -46665,9 +46079,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
* return res
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__advance); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__advance); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 885; __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 = 899; __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 = 885; __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));
@@ -46678,7 +46092,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
__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 = 899; __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 = 885; __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;
@@ -46689,7 +46103,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12advance(str
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":901
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":887
* return self.advance(nf, res, fwords)
* else:
* return res # <<<<<<<<<<<<<<
@@ -46770,36 +46184,36 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_15get_all_nod
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 = 903; __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 = 889; __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 = 903; __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 = 889; __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 = 903; __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 = 889; __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 = 903; __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 = 889; __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 = 903; __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 = 889; __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 = 903; __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 = 889; __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 = 903; __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 = 889; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
goto __pyx_L5_argtuple_error;
@@ -46822,7 +46236,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_15get_all_nod
}
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 = 903; __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 = 889; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.get_all_nodes_isteps_away", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -46833,7 +46247,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_15get_all_nod
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":903
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":889
* return res
*
* def get_all_nodes_isteps_away(self, skip, i, spanlen, pathlen, fwords, next_states, reachable_buffer): # <<<<<<<<<<<<<<
@@ -46872,41 +46286,41 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_all_nodes_isteps_away", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":905
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":891
* 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 = 905; __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 = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_frontier = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":906
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":892
* 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 = 906; __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 = 892; __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 = 906; __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 = 892; __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 = 906; __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 = 906; __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 = 892; __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 = 892; __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 = 906; __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 = 892; __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 = 906; __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 = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_5) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":907
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":893
* frontier = []
* if i+spanlen+skip >= len(next_states):
* return frontier # <<<<<<<<<<<<<<
@@ -46921,14 +46335,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
}
__pyx_L3:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":908
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":894
* 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 = 908; __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 = 894; __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);
@@ -46936,43 +46350,43 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
__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(((PyObject*)__pyx_t_4))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = ((PyObject *)PyList_AsTuple(((PyObject*)__pyx_t_4))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __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 = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":909
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":895
* 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 = 909; __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 = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_reachable = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":910
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":896
* 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 = 910; __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 = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_6 = (__pyx_t_5 != 0);
if (__pyx_t_6) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":911
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":897
* 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 = 911; __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 = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_reachable, __pyx_t_1);
__pyx_t_1 = 0;
@@ -46980,16 +46394,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":913
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":899
* reachable = reachable_buffer[key]
* else:
* reachable = self.reachable(fwords, i, spanlen) # <<<<<<<<<<<<<<
* reachable_buffer[key] = reachable
* for nextreachable in reachable:
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__reachable); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__reachable); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 899; __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 = 913; __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 = 899; __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);
@@ -47000,25 +46414,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
__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 = 913; __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 = 899; __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;
__Pyx_DECREF_SET(__pyx_v_reachable, __pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":914
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":900
* 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 = 914; __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 = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_L4:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":915
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":901
* reachable = self.reachable(fwords, i, spanlen)
* reachable_buffer[key] = reachable
* for nextreachable in reachable: # <<<<<<<<<<<<<<
@@ -47029,7 +46443,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
__pyx_t_2 = __pyx_v_reachable; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
__pyx_t_7 = 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 = 915; __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 = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext;
}
@@ -47037,23 +46451,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
if (!__pyx_t_7 && 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 = 915; __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 = 901; __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 = 915; __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 = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_7 && 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 = 915; __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 = 901; __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 = 915; __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 = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_7(__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 = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -47062,20 +46476,20 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
__Pyx_XDECREF_SET(__pyx_v_nextreachable, __pyx_t_4);
__pyx_t_4 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":916
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":902
* 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 = 916; __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 = 902; __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_8 = 0;
__pyx_t_9 = NULL;
} else {
- __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -47084,23 +46498,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_9(__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 = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -47109,16 +46523,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
__Pyx_XDECREF_SET(__pyx_v_next_id, __pyx_t_4);
__pyx_t_4 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":917
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":903
* 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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__shortest); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__shortest); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 903; __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 = 917; __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 = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_INCREF(__pyx_v_fwords);
PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_fwords);
@@ -47129,26 +46543,26 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
__Pyx_INCREF(__pyx_v_next_id);
PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_next_id);
__Pyx_GIVEREF(__pyx_v_next_id);
- __pyx_t_11 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
__Pyx_XDECREF_SET(__pyx_v_jump, __pyx_t_11);
__pyx_t_11 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":918
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":904
* 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_11 = PyObject_RichCompare(__pyx_v_jump, __pyx_v_skip, Py_LT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_RichCompare(__pyx_v_jump, __pyx_v_skip, Py_LT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
if (__pyx_t_6) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":919
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":905
* jump = self.shortest(fwords,i,next_id)
* if jump < skip:
* continue # <<<<<<<<<<<<<<
@@ -47160,50 +46574,50 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
}
__pyx_L9:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":920
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":906
* 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_11 = PyNumber_Add(__pyx_v_pathlen, __pyx_v_jump); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyNumber_Add(__pyx_v_pathlen, __pyx_v_jump); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_10 = PyInt_FromLong(__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyInt_FromLong(__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_4 = PyObject_RichCompare(__pyx_t_11, __pyx_t_10, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_t_11, __pyx_t_10, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __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 = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_6) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":921
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":907
* 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 = 921; __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 = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_12 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
__pyx_t_10 = __pyx_t_4; __Pyx_INCREF(__pyx_t_10); __pyx_t_12 = 0;
__pyx_t_13 = NULL;
} else {
- __pyx_t_12 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_13 = Py_TYPE(__pyx_t_10)->tp_iternext;
}
@@ -47212,23 +46626,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
if (!__pyx_t_13 && PyList_CheckExact(__pyx_t_10)) {
if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_10)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; 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_10, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_10, __pyx_t_12); __pyx_t_12++; 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_13 && PyTuple_CheckExact(__pyx_t_10)) {
if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_10)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; 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_10, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_10, __pyx_t_12); __pyx_t_12++; 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_13(__pyx_t_10);
if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -47237,40 +46651,40 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
__Pyx_XDECREF_SET(__pyx_v_alt_id, __pyx_t_4);
__pyx_t_4 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":922
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":908
* 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 = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_next_id); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_11 = PyObject_GetItem(__pyx_t_4, __pyx_v_alt_id); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_GetItem(__pyx_t_4, __pyx_v_alt_id); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_11, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_11, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = PyInt_FromLong(__pyx_v_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyInt_FromLong(__pyx_v_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_14 = PyObject_RichCompare(__pyx_t_4, __pyx_t_11, Py_NE); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyObject_RichCompare(__pyx_t_4, __pyx_t_11, Py_NE); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
if (__pyx_t_6) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":923
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":909
* 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_14 = PyNumber_Add(__pyx_v_pathlen, __pyx_v_jump); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyNumber_Add(__pyx_v_pathlen, __pyx_v_jump); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
- __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_INCREF(__pyx_v_next_id);
PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_next_id);
@@ -47284,27 +46698,27 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
__Pyx_XDECREF_SET(__pyx_v_newel, ((PyObject*)__pyx_t_11));
__pyx_t_11 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":924
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":910
* 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_6 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_v_newel), ((PyObject *)__pyx_v_frontier), Py_NE)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_v_newel), ((PyObject *)__pyx_v_frontier), Py_NE)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_5 = (__pyx_t_6 != 0);
if (__pyx_t_5) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":925
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":911
* newel = (next_id,alt_id,pathlen+jump)
* if newel not in frontier:
* frontier.append((next_id,alt_id,pathlen+jump)) # <<<<<<<<<<<<<<
* return frontier
*
*/
- __pyx_t_11 = PyNumber_Add(__pyx_v_pathlen, __pyx_v_jump); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyNumber_Add(__pyx_v_pathlen, __pyx_v_jump); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyTuple_New(3); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_INCREF(__pyx_v_next_id);
PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_next_id);
@@ -47315,7 +46729,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_11);
__Pyx_GIVEREF(__pyx_t_11);
__pyx_t_11 = 0;
- __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_frontier, ((PyObject *)__pyx_t_14)); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_frontier, ((PyObject *)__pyx_t_14)); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
goto __pyx_L14;
}
@@ -47334,7 +46748,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_14get_all_nod
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":926
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":912
* if newel not in frontier:
* frontier.append((next_id,alt_id,pathlen+jump))
* return frontier # <<<<<<<<<<<<<<
@@ -47404,16 +46818,16 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_17reachable(P
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 = 928; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("reachable", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 914; __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 = 928; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("reachable", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 914; __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 = 928; __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 = 914; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
@@ -47428,7 +46842,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_17reachable(P
}
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 = 928; __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 = 914; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.reachable", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -47439,7 +46853,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_17reachable(P
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":928
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":914
* return frontier
*
* def reachable(self, fwords, ifrom, dist): # <<<<<<<<<<<<<<
@@ -47470,35 +46884,35 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("reachable", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":929
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":915
*
* 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 = 929; __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 = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ret = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":930
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":916
* 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 = 930; __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 = 930; __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 = 916; __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 = 916; __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 = 930; __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 = 916; __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 = 930; __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 = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_4) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":931
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":917
* ret = []
* if ifrom >= len(fwords):
* return ret # <<<<<<<<<<<<<<
@@ -47513,32 +46927,32 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s
}
__pyx_L3:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":932
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":918
* 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 = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 918; __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 = 932; __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 = 918; __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 = 932; __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 = 918; __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 = 932; __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 = 918; __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 = 932; __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 = 918; __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 = 932; __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 = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -47547,23 +46961,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s
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 = 932; __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 = 918; __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 = 932; __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 = 918; __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 = 932; __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 = 918; __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 = 932; __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 = 918; __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 = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -47572,53 +46986,53 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s
__Pyx_XDECREF_SET(__pyx_v_alt_id, __pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":933
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":919
* 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 = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = PyObject_GetItem(__pyx_t_3, __pyx_v_alt_id); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 933; __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 = 919; __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, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyInt_FromLong(__pyx_v_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyInt_FromLong(__pyx_v_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 919; __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 = 933; __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 = 919; __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 = 933; __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 = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (__pyx_t_4) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":934
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":920
* 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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ret), __pyx_n_s__extend); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ret), __pyx_n_s__extend); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__reachable); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__reachable); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_8 = PyObject_GetItem(__pyx_t_3, __pyx_v_alt_id); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 934; __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 = 920; __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, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_8, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_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 = 934; __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 = 920; __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 = 934; __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 = 920; __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);
@@ -47629,16 +47043,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s
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 = 934; __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 = 920; __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 = 934; __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 = 920; __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 = 934; __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 = 920; __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;
@@ -47647,37 +47061,37 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":936
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":922
* 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 = 936; __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 = 936; __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 = 922; __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 = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (__pyx_t_4) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":937
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":923
* 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 = 937; __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 = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_9 = (__pyx_t_4 != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":938
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":924
* 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_10 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_v_ifrom); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_v_ifrom); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L8;
}
__pyx_L8:;
@@ -47685,29 +47099,29 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":940
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":926
* 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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__reachable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__reachable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __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 = 940; __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 = 926; __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 = 940; __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 = 926; __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, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_7, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __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 = 940; __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 = 926; __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 = 940; __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 = 926; __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 = 940; __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 = 926; __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);
@@ -47718,7 +47132,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s
__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 = 940; __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 = 926; __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;
@@ -47726,7 +47140,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s
__pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6); __pyx_t_11 = 0;
__pyx_t_12 = NULL;
} else {
- __pyx_t_11 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_12 = Py_TYPE(__pyx_t_6)->tp_iternext;
}
@@ -47735,23 +47149,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s
if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_6)) {
if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_6)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_6)) {
if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_3 = __pyx_t_12(__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 = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -47760,25 +47174,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s
__Pyx_XDECREF_SET(__pyx_v_ifromchild, __pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":941
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":927
* 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_9 = (__Pyx_PySequence_Contains(__pyx_v_ifromchild, ((PyObject *)__pyx_v_ret), Py_NE)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = (__Pyx_PySequence_Contains(__pyx_v_ifromchild, ((PyObject *)__pyx_v_ret), Py_NE)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_4 = (__pyx_t_9 != 0);
if (__pyx_t_4) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":942
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":928
* 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_10 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_v_ifromchild); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_v_ifromchild); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L11;
}
__pyx_L11:;
@@ -47791,7 +47205,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_16reachable(s
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":944
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":930
* ret.append(ifromchild)
*
* return ret # <<<<<<<<<<<<<<
@@ -47855,16 +47269,16 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_19shortest(Py
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 = 946; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("shortest", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __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 = 946; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("shortest", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __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 = 946; __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 = 932; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
@@ -47879,7 +47293,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_19shortest(Py
}
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 = 946; __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 = 932; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.shortest", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -47890,7 +47304,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_19shortest(Py
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":946
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":932
* return ret
*
* def shortest(self, fwords, ifrom, ito): # <<<<<<<<<<<<<<
@@ -47915,7 +47329,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("shortest", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":948
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":934
* def shortest(self, fwords, ifrom, ito):
* cdef unsigned alt_id
* min = 1000 # <<<<<<<<<<<<<<
@@ -47925,19 +47339,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st
__Pyx_INCREF(__pyx_int_1000);
__pyx_v_min = __pyx_int_1000;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":949
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":935
* 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 = 949; __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 = 949; __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 = 935; __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 = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":950
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":936
* min = 1000
* if ifrom > ito:
* return min # <<<<<<<<<<<<<<
@@ -47952,19 +47366,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st
}
__pyx_L3:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":951
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":937
* 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 = 951; __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 = 951; __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 = 937; __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 = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":952
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":938
* return min
* if ifrom == ito:
* return 0 # <<<<<<<<<<<<<<
@@ -47979,41 +47393,41 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st
}
__pyx_L4:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":953
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":939
* 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 = 953; __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 = 939; __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 = 953; __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 = 939; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":954
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":940
* 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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__shortest); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__shortest); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 954; __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 = 940; __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, 0, 0, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 954; __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, 0, 0, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __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, 0, 0, 1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __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 = 954; __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 = 940; __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 = 954; __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 = 940; __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);
@@ -48024,45 +47438,45 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st
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 = 954; __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 = 940; __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;
__Pyx_XDECREF_SET(__pyx_v_currmin, __pyx_t_6);
__pyx_t_6 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":955
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":941
* 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 = 955; __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 = 941; __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, 0, 0, 1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 955; __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, 0, 0, 1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyInt_FromLong(__pyx_v_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyInt_FromLong(__pyx_v_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_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 = 955; __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 = 941; __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 = 955; __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 = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":956
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":942
* 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 = 956; __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 = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_currmin, __pyx_t_1);
__pyx_t_1 = 0;
@@ -48070,19 +47484,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st
}
__pyx_L7:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":957
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":943
* 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 = 957; __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 = 957; __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 = 943; __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 = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":958
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":944
* currmin += 1
* if currmin < min:
* min = currmin # <<<<<<<<<<<<<<
@@ -48096,7 +47510,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_18shortest(st
__pyx_L8:;
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":959
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":945
* if currmin < min:
* min = currmin
* return min # <<<<<<<<<<<<<<
@@ -48158,7 +47572,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_21get_next_st
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 = 961; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("get_next_states", 0, 2, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (kw_args > 0) {
@@ -48167,7 +47581,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_21get_next_st
}
}
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 = 961; __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 = 947; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -48184,7 +47598,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_21get_next_st
}
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 = 961; __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 = 947; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.get_next_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -48195,7 +47609,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_21get_next_st
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":961
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":947
* return min
*
* def get_next_states(self, _columns, curr_idx, min_dist=2): # <<<<<<<<<<<<<<
@@ -48228,26 +47642,26 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_next_states", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":962
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":948
*
* 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 = 962; __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 = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_result = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":963
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":949
* 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 = 963; __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 = 949; __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);
@@ -48255,7 +47669,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st
__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 = 963; __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 = 949; __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));
@@ -48263,7 +47677,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st
__pyx_v_candidate = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":965
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":951
* candidate = [[curr_idx,0]]
*
* while len(candidate) > 0: # <<<<<<<<<<<<<<
@@ -48271,42 +47685,42 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st
* 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 = 965; __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 = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_4 = ((__pyx_t_3 > 0) != 0);
if (!__pyx_t_4) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":966
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":952
*
* 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 = 966; __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 = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_XDECREF_SET(__pyx_v_curr, __pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":967
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":953
* 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, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 953; __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 = 967; __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 = 967; __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 = 953; __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 = 953; __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 = 967; __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 = 953; __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 = 967; __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 = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_4) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":968
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":954
* curr = candidate.pop()
* if curr[0] >= len(_columns):
* continue # <<<<<<<<<<<<<<
@@ -48318,30 +47732,30 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st
}
__pyx_L5:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":969
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":955
* 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, 0, 0, 1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 955; __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 = 969; __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 = 955; __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, 0, 0, 1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_curr, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 955; __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 = 969; __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 = 955; __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 = 969; __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 = 955; __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 = 969; __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 = 955; __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 = 969; __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 = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_7 = __pyx_t_6;
} else {
@@ -48349,37 +47763,37 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st
}
if (__pyx_t_7) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":970
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":956
* 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, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L6;
}
__pyx_L6:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":971
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":957
* 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, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyObject_GetItem(__pyx_v__columns, __pyx_t_1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 971; __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 = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF_SET(__pyx_v_curr_col, __pyx_t_5);
__pyx_t_5 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":972
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":958
* result.append(curr[0]);
* curr_col = _columns[curr[0]]
* for alt in curr_col: # <<<<<<<<<<<<<<
@@ -48390,7 +47804,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st
__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 = 972; __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 = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext;
}
@@ -48398,23 +47812,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st
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 = 972; __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 = 958; __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 = 972; __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 = 958; __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 = 972; __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 = 958; __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 = 972; __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 = 958; __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 = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -48423,25 +47837,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st
__Pyx_XDECREF_SET(__pyx_v_alt, __pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":973
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":959
* 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, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_alt, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_alt, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 959; __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 = 973; __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 = 959; __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;
__Pyx_XDECREF_SET(__pyx_v_next_id, __pyx_t_10);
__pyx_t_10 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":974
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":960
* for alt in curr_col:
* next_id = curr[0]+alt[2]
* jump = 1 # <<<<<<<<<<<<<<
@@ -48451,25 +47865,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st
__Pyx_INCREF(__pyx_int_1);
__Pyx_XDECREF_SET(__pyx_v_jump, __pyx_int_1);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":975
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":961
* 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, 0, 0, 1); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_alt, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_2 = PyInt_FromLong(__pyx_v_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong(__pyx_v_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_10, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 975; __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 = 961; __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 = 975; __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 = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_7) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":976
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":962
* jump = 1
* if alt[0] == EPSILON:
* jump = 0 # <<<<<<<<<<<<<<
@@ -48482,30 +47896,30 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st
}
__pyx_L9:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":977
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":963
* 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 = 977; __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 = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_7) {
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 963; __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 = 977; __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 = 963; __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 = 977; __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 = 963; __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 = 977; __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 = 963; __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 = 977; __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 = 963; __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 = 977; __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 = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_6 = __pyx_t_4;
} else {
@@ -48513,19 +47927,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st
}
if (__pyx_t_6) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":978
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":964
* 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, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_jump); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_jump); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 978; __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 = 964; __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);
@@ -48533,7 +47947,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st
PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_2 = 0;
- __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_candidate, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_candidate, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
goto __pyx_L10;
}
@@ -48543,7 +47957,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st
__pyx_L3_continue:;
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":979
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":965
* 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); # <<<<<<<<<<<<<<
@@ -48551,12 +47965,12 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_20get_next_st
* def input(self, fwords, meta, ctx_name=None):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 979; __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 = 965; __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 = 979; __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 = 965; __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;
@@ -48603,7 +48017,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_23input(PyObj
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fwords,&__pyx_n_s__meta,&__pyx_n_s__ctx_name,0};
PyObject* values[3] = {0,0,0};
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":981
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":967
* return sorted(result);
*
* def input(self, fwords, meta, ctx_name=None): # <<<<<<<<<<<<<<
@@ -48629,7 +48043,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_23input(PyObj
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__meta)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("input", 0, 2, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("input", 0, 2, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (kw_args > 0) {
@@ -48638,7 +48052,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_23input(PyObj
}
}
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 = 981; __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 = 967; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -48655,7 +48069,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_23input(PyObj
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("input", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("input", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.input", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -48667,30 +48081,30 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_23input(PyObj
}
/* Python wrapper */
-static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda5(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda5 = {__Pyx_NAMESTR("lambda5"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda5, METH_NOARGS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda5(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda3(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda3 = {__Pyx_NAMESTR("lambda3"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda3, METH_NOARGS, __Pyx_DOCSTR(0)};
+static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda3(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("lambda5 (wrapper)", 0);
- __pyx_r = __pyx_lambda_funcdef_lambda5(__pyx_self);
+ __Pyx_RefNannySetupContext("lambda3 (wrapper)", 0);
+ __pyx_r = __pyx_lambda_funcdef_lambda3(__pyx_self);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
-static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_7lambda5_lambda6(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_7lambda5_lambda6 = {__Pyx_NAMESTR("lambda6"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_7lambda5_lambda6, METH_NOARGS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_7lambda5_lambda6(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_7lambda3_lambda4(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_7lambda3_lambda4 = {__Pyx_NAMESTR("lambda4"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_7lambda3_lambda4, METH_NOARGS, __Pyx_DOCSTR(0)};
+static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_7lambda3_lambda4(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("lambda6 (wrapper)", 0);
- __pyx_r = __pyx_lambda_funcdef_lambda6(__pyx_self);
+ __Pyx_RefNannySetupContext("lambda4 (wrapper)", 0);
+ __pyx_r = __pyx_lambda_funcdef_lambda4(__pyx_self);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1150
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1136
* if len(extracts) > 0:
* fcount = Counter()
* fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list))) # <<<<<<<<<<<<<<
@@ -48698,7 +48112,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_7lambd
* fcount[f] += count
*/
-static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self) {
+static PyObject *__pyx_lambda_funcdef_lambda4(CYTHON_UNUSED PyObject *__pyx_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
@@ -48707,16 +48121,16 @@ static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("lambda6", 0);
+ __Pyx_RefNannySetupContext("lambda4", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1136; __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 = 1150; __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 = 1136; __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 = 1150; __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 = 1136; __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;
@@ -48730,7 +48144,7 @@ static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.input.lambda5.lambda6", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.input.lambda3.lambda4", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -48738,7 +48152,7 @@ static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self
return __pyx_r;
}
-static PyObject *__pyx_lambda_funcdef_lambda5(CYTHON_UNUSED PyObject *__pyx_self) {
+static PyObject *__pyx_lambda_funcdef_lambda3(CYTHON_UNUSED PyObject *__pyx_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
@@ -48747,18 +48161,18 @@ static PyObject *__pyx_lambda_funcdef_lambda5(CYTHON_UNUSED PyObject *__pyx_self
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("lambda5", 0);
+ __Pyx_RefNannySetupContext("lambda3", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_7lambda5_lambda6, 0, __pyx_n_s_125, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_7lambda3_lambda4, 0, __pyx_n_s_125, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1136; __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 = 1150; __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 = 1136; __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 = 1150; __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 = 1136; __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;
@@ -48772,7 +48186,7 @@ static PyObject *__pyx_lambda_funcdef_lambda5(CYTHON_UNUSED PyObject *__pyx_self
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.input.lambda5", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.input.lambda3", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -48781,18 +48195,18 @@ static PyObject *__pyx_lambda_funcdef_lambda5(CYTHON_UNUSED PyObject *__pyx_self
}
/* Python wrapper */
-static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambda7(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
-static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambda7 = {__Pyx_NAMESTR("lambda7"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambda7, METH_O, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambda7(PyObject *__pyx_self, PyObject *__pyx_v_x) {
+static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambda5(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
+static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambda5 = {__Pyx_NAMESTR("lambda5"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambda5, METH_O, __Pyx_DOCSTR(0)};
+static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambda5(PyObject *__pyx_self, PyObject *__pyx_v_x) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("lambda7 (wrapper)", 0);
- __pyx_r = __pyx_lambda_funcdef_lambda7(__pyx_self, ((PyObject *)__pyx_v_x));
+ __Pyx_RefNannySetupContext("lambda5 (wrapper)", 0);
+ __pyx_r = __pyx_lambda_funcdef_lambda5(__pyx_self, ((PyObject *)__pyx_v_x));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1156
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1142
* for f, elist in fphrases.iteritems():
* for e, alslist in elist.iteritems():
* alignment, max_locs = max(alslist.iteritems(), key=lambda x: len(x[1])) # <<<<<<<<<<<<<<
@@ -48800,7 +48214,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambd
* count = len(locs)
*/
-static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
+static PyObject *__pyx_lambda_funcdef_lambda5(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
@@ -48808,13 +48222,13 @@ static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("lambda7", 0);
+ __Pyx_RefNannySetupContext("lambda5", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __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 = 1156; __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 = 1142; __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 = 1156; __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 = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -48824,7 +48238,7 @@ static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.input.lambda7", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.input.lambda5", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -48833,7 +48247,7 @@ static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self
}
static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_4generator14(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1196
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1182
* if self.online:
* stats = self.online_stats[ctx_name]
* f_syms = tuple(word[0][0] for word in fwords) # <<<<<<<<<<<<<<
@@ -48859,7 +48273,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_2genex
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_4generator14, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_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;
@@ -48899,13 +48313,13 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_4gener
return NULL;
}
__pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1196; __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 = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ 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 = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_fwords); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -48913,23 +48327,23 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_4gener
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 = 1196; __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 = 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 = 1196; __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 = 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 = 1196; __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 = 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 = 1196; __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 = 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 = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -48939,9 +48353,9 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_4gener
__Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_word, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_word, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_word, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); 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, 0, 0, 1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); 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;
@@ -48961,7 +48375,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_4gener
__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 = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ 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);
@@ -48979,7 +48393,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_4gener
return NULL;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":981
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":967
* return sorted(result);
*
* def input(self, fwords, meta, ctx_name=None): # <<<<<<<<<<<<<<
@@ -49014,7 +48428,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_22input(struc
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_ctx_name);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ctx_name);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -49079,9 +48493,9 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
return NULL;
}
__pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":992
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":978
* cdef Phrase hiero_phrase
*
* flen = len(fwords) # <<<<<<<<<<<<<<
@@ -49090,27 +48504,27 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
*/
__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 = 992; __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 = 978; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":993
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":979
*
* flen = len(fwords)
* start_time = monitor_cpu() # <<<<<<<<<<<<<<
* self.extract_time = 0.0
* self.intersect_time = 0.0
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_cur_scope->__pyx_v_start_time = __pyx_t_4;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":994
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":980
* flen = len(fwords)
* start_time = monitor_cpu()
* self.extract_time = 0.0 # <<<<<<<<<<<<<<
@@ -49119,7 +48533,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
*/
__pyx_cur_scope->__pyx_v_self->extract_time = 0.0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":995
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":981
* start_time = monitor_cpu()
* self.extract_time = 0.0
* self.intersect_time = 0.0 # <<<<<<<<<<<<<<
@@ -49128,20 +48542,20 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
*/
__pyx_cur_scope->__pyx_v_self->intersect_time = 0.0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":996
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":982
* self.extract_time = 0.0
* self.intersect_time = 0.0
* nodes_isteps_away_buffer = {} # <<<<<<<<<<<<<<
* hit = 0
* reachable_buffer = {}
*/
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
__Pyx_GIVEREF(((PyObject *)__pyx_t_3));
__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":997
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":983
* self.intersect_time = 0.0
* nodes_isteps_away_buffer = {}
* hit = 0 # <<<<<<<<<<<<<<
@@ -49150,46 +48564,46 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
*/
__pyx_cur_scope->__pyx_v_hit = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":998
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":984
* nodes_isteps_away_buffer = {}
* hit = 0
* reachable_buffer = {} # <<<<<<<<<<<<<<
*
* # Phrase pairs processed by suffix array extractor. Do not re-extract
*/
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
__Pyx_GIVEREF(((PyObject *)__pyx_t_3));
__pyx_cur_scope->__pyx_v_reachable_buffer = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1003
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":989
* # during online extraction. This is probably the hackiest part of
* # online grammar extraction.
* seen_phrases = set() # <<<<<<<<<<<<<<
*
* # Do not cache between sentences
*/
- __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
__Pyx_GIVEREF(((PyObject *)__pyx_t_3));
__pyx_cur_scope->__pyx_v_seen_phrases = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1006
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":992
*
* # Do not cache between sentences
* self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation()) # <<<<<<<<<<<<<<
*
* frontier = []
*/
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__Pyx_GIVEREF(__pyx_t_1);
@@ -49198,20 +48612,20 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_cur_scope->__pyx_v_self->rules->root = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1008
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":994
* self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation())
*
* frontier = [] # <<<<<<<<<<<<<<
* for i in range(len(fwords)):
* for alt in range(0, len(fwords[i])):
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1008; __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 = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(((PyObject *)__pyx_t_1));
__pyx_cur_scope->__pyx_v_frontier = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1009
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":995
*
* frontier = []
* for i in range(len(fwords)): # <<<<<<<<<<<<<<
@@ -49220,72 +48634,72 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
*/
__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 = 1009; __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 = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_2; __pyx_t_5+=1) {
__pyx_cur_scope->__pyx_v_i = __pyx_t_5;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1010
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":996
* frontier = []
* for i in range(len(fwords)):
* for alt in range(0, len(fwords[i])): # <<<<<<<<<<<<<<
* if fwords[i][alt][0] != EPSILON:
* frontier.append((i, i, (i,), alt, 0, self.rules.root, (), False))
*/
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1010; __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, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
__pyx_cur_scope->__pyx_v_alt = __pyx_t_7;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1011
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":997
* for i in range(len(fwords)):
* for alt in range(0, len(fwords[i])):
* if fwords[i][alt][0] != EPSILON: # <<<<<<<<<<<<<<
* frontier.append((i, i, (i,), alt, 0, self.rules.root, (), False))
*
*/
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __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, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyInt_FromLong(__pyx_v_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong(__pyx_v_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1012
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":998
* for alt in range(0, len(fwords[i])):
* if fwords[i][alt][0] != EPSILON:
* frontier.append((i, i, (i,), alt, 0, self.rules.root, (), False)) # <<<<<<<<<<<<<<
*
* xroot = None
*/
- __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __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 = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __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 = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_11 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_12 = PyTuple_New(8); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyTuple_New(8); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_8);
@@ -49311,7 +48725,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_10 = 0;
__pyx_t_1 = 0;
__pyx_t_11 = 0;
- __pyx_t_13 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_frontier, ((PyObject *)__pyx_t_12)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_frontier, ((PyObject *)__pyx_t_12)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
goto __pyx_L8;
}
@@ -49319,7 +48733,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1014
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1000
* frontier.append((i, i, (i,), alt, 0, self.rules.root, (), False))
*
* xroot = None # <<<<<<<<<<<<<<
@@ -49330,7 +48744,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(Py_None);
__pyx_cur_scope->__pyx_v_xroot = Py_None;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1015
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1001
*
* xroot = None
* x1 = sym_setindex(self.category, 1) # <<<<<<<<<<<<<<
@@ -49339,33 +48753,33 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
*/
__pyx_cur_scope->__pyx_v_x1 = __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, 1);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1016
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1002
* xroot = None
* x1 = sym_setindex(self.category, 1)
* if x1 in self.rules.root.children: # <<<<<<<<<<<<<<
* xroot = self.rules.root.children[x1]
* else:
*/
- __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_x1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_x1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
- __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s__children); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s__children); 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);
- __pyx_t_9 = (__Pyx_PySequence_Contains(__pyx_t_12, __pyx_t_11, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = (__Pyx_PySequence_Contains(__pyx_t_12, __pyx_t_11, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_t_14 = (__pyx_t_9 != 0);
if (__pyx_t_14) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1017
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1003
* x1 = sym_setindex(self.category, 1)
* if x1 in self.rules.root.children:
* xroot = self.rules.root.children[x1] # <<<<<<<<<<<<<<
* else:
* xroot = ExtendedTrieNode(suffix_link=self.rules.root, phrase_location=PhraseLocation())
*/
- __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s__children); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s__children); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_11, __pyx_cur_scope->__pyx_v_x1, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_11, __pyx_cur_scope->__pyx_v_x1, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_xroot);
@@ -49376,21 +48790,21 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1019
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1005
* xroot = self.rules.root.children[x1]
* else:
* xroot = ExtendedTrieNode(suffix_link=self.rules.root, phrase_location=PhraseLocation()) # <<<<<<<<<<<<<<
* self.rules.root.children[x1] = xroot
*
*/
- __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_12));
- if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__suffix_link), __pyx_cur_scope->__pyx_v_self->rules->root) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__suffix_link), __pyx_cur_scope->__pyx_v_self->rules->root) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_11) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_11) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_xroot);
@@ -49398,21 +48812,21 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_11);
__pyx_t_11 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1020
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1006
* else:
* xroot = ExtendedTrieNode(suffix_link=self.rules.root, phrase_location=PhraseLocation())
* self.rules.root.children[x1] = xroot # <<<<<<<<<<<<<<
*
* for i in range(self.min_gap_size, len(fwords)):
*/
- __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s__children); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s__children); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- if (__Pyx_SetItemInt(__pyx_t_11, __pyx_cur_scope->__pyx_v_x1, __pyx_cur_scope->__pyx_v_xroot, sizeof(int), PyInt_FromLong, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_t_11, __pyx_cur_scope->__pyx_v_x1, __pyx_cur_scope->__pyx_v_xroot, sizeof(int), PyInt_FromLong, 0, 1, 1) < 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_L9:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1022
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1008
* self.rules.root.children[x1] = xroot
*
* for i in range(self.min_gap_size, len(fwords)): # <<<<<<<<<<<<<<
@@ -49421,81 +48835,81 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
*/
__pyx_t_11 = __pyx_cur_scope->__pyx_v_fwords;
__Pyx_INCREF(__pyx_t_11);
- __pyx_t_2 = PyObject_Length(__pyx_t_11); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Length(__pyx_t_11); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
for (__pyx_t_5 = __pyx_cur_scope->__pyx_v_self->min_gap_size; __pyx_t_5 < __pyx_t_2; __pyx_t_5+=1) {
__pyx_cur_scope->__pyx_v_i = __pyx_t_5;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1023
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1009
*
* for i in range(self.min_gap_size, len(fwords)):
* for alt in range(0, len(fwords[i])): # <<<<<<<<<<<<<<
* if fwords[i][alt][0] != EPSILON:
* frontier.append((i-self.min_gap_size, i, (i,), alt, self.min_gap_size, xroot, (x1,), True))
*/
- __pyx_t_11 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_6 = PyObject_Length(__pyx_t_11); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_t_11); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
__pyx_cur_scope->__pyx_v_alt = __pyx_t_7;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1024
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1010
* for i in range(self.min_gap_size, len(fwords)):
* for alt in range(0, len(fwords[i])):
* if fwords[i][alt][0] != EPSILON: # <<<<<<<<<<<<<<
* frontier.append((i-self.min_gap_size, i, (i,), alt, self.min_gap_size, xroot, (x1,), True))
*
*/
- __pyx_t_11 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_11, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_11, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_12, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_12, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_t_12 = PyInt_FromLong(__pyx_v_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyInt_FromLong(__pyx_v_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_11, __pyx_t_12, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_11, __pyx_t_12, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_14) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1025
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1011
* for alt in range(0, len(fwords[i])):
* if fwords[i][alt][0] != EPSILON:
* frontier.append((i-self.min_gap_size, i, (i,), alt, self.min_gap_size, xroot, (x1,), True)) # <<<<<<<<<<<<<<
*
* next_states = []
*/
- __pyx_t_1 = PyInt_FromLong((__pyx_cur_scope->__pyx_v_i - __pyx_cur_scope->__pyx_v_self->min_gap_size)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong((__pyx_cur_scope->__pyx_v_i - __pyx_cur_scope->__pyx_v_self->min_gap_size)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
- __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __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 = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11);
__Pyx_GIVEREF(__pyx_t_11);
__pyx_t_11 = 0;
- __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_x1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_x1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __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 = 1011; __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 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_16 = PyTuple_New(8); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PyTuple_New(8); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
@@ -49521,7 +48935,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_3 = 0;
__pyx_t_15 = 0;
__pyx_t_8 = 0;
- __pyx_t_13 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_frontier, ((PyObject *)__pyx_t_16)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_frontier, ((PyObject *)__pyx_t_16)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0;
goto __pyx_L14;
}
@@ -49529,20 +48943,20 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1027
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1013
* 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_16 = PyList_New(0); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PyList_New(0); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
__Pyx_GIVEREF(((PyObject *)__pyx_t_16));
__pyx_cur_scope->__pyx_v_next_states = ((PyObject*)__pyx_t_16);
__pyx_t_16 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1028
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1014
*
* next_states = []
* for i in range(len(fwords)): # <<<<<<<<<<<<<<
@@ -49551,25 +48965,25 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
*/
__pyx_t_16 = __pyx_cur_scope->__pyx_v_fwords;
__Pyx_INCREF(__pyx_t_16);
- __pyx_t_2 = PyObject_Length(__pyx_t_16); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Length(__pyx_t_16); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_2; __pyx_t_5+=1) {
__pyx_cur_scope->__pyx_v_i = __pyx_t_5;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1029
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1015
* 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_16 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__get_next_states); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__get_next_states); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
- __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __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 = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_fwords);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_fwords);
@@ -49580,15 +48994,15 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_15);
__pyx_t_8 = 0;
__pyx_t_15 = 0;
- __pyx_t_15 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_t_13 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_next_states, __pyx_t_15); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_next_states, __pyx_t_15); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1031
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1017
* next_states.append(self.get_next_states(fwords,i,self.min_gap_size))
*
* while len(frontier) > 0: # <<<<<<<<<<<<<<
@@ -49596,25 +49010,25 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
* for k, i, input_match, alt, pathlen, node, prefix, is_shadow_path in frontier:
*/
while (1) {
- __pyx_t_2 = PyList_GET_SIZE(((PyObject *)__pyx_cur_scope->__pyx_v_frontier)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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 = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_14 = ((__pyx_t_2 > 0) != 0);
if (!__pyx_t_14) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1032
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1018
*
* 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_15 = PyList_New(0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyList_New(0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_new_frontier));
__Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_new_frontier, ((PyObject*)__pyx_t_15));
__Pyx_GIVEREF(((PyObject *)__pyx_t_15));
__pyx_t_15 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1033
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1019
* while len(frontier) > 0:
* new_frontier = []
* for k, i, input_match, alt, pathlen, node, prefix, is_shadow_path in frontier: # <<<<<<<<<<<<<<
@@ -49625,9 +49039,9 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
for (;;) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_15)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyList_GET_ITEM(__pyx_t_15, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_GET_ITEM(__pyx_t_15, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_15, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_15, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __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;
@@ -49639,7 +49053,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
if (unlikely(size != 8)) {
if (size > 8) __Pyx_RaiseTooManyValuesError(8);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -49673,7 +49087,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
Py_ssize_t i;
PyObject** temps[8] = {&__pyx_t_16,&__pyx_t_8,&__pyx_t_11,&__pyx_t_10,&__pyx_t_12,&__pyx_t_1,&__pyx_t_17,&__pyx_t_18};
for (i=0; i < 8; i++) {
- PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(item);
*(temps[i]) = item;
}
@@ -49683,7 +49097,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
{
Py_ssize_t index = -1;
PyObject** temps[8] = {&__pyx_t_16,&__pyx_t_8,&__pyx_t_11,&__pyx_t_10,&__pyx_t_12,&__pyx_t_1,&__pyx_t_17,&__pyx_t_18};
- __pyx_t_19 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_19 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_19);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext;
@@ -49692,7 +49106,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GOTREF(item);
*(temps[index]) = item;
}
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 8) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 8) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_20 = NULL;
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
goto __pyx_L22_unpacking_done;
@@ -49700,14 +49114,14 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
__pyx_t_20 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L22_unpacking_done:;
}
- __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_t_16); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_t_16); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_8); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_8); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_21 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_21 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_cur_scope->__pyx_v_k = __pyx_t_5;
__pyx_cur_scope->__pyx_v_i = __pyx_t_7;
@@ -49733,19 +49147,19 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_18);
__pyx_t_18 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1034
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1020
* new_frontier = []
* for k, i, input_match, alt, pathlen, node, prefix, is_shadow_path in frontier:
* word_id = fwords[i][alt][0] # <<<<<<<<<<<<<<
* spanlen = fwords[i][alt][2]
* # TODO get rid of k -- pathlen is replacing it
*/
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1034; __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, 0, 1, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_18 = __Pyx_GetItemInt(__pyx_t_3, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_GetItemInt(__pyx_t_3, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_18, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_18, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_word_id);
@@ -49753,19 +49167,19 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1035
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1021
* for k, i, input_match, alt, pathlen, node, prefix, is_shadow_path in frontier:
* word_id = fwords[i][alt][0]
* spanlen = fwords[i][alt][2] # <<<<<<<<<<<<<<
* # TODO get rid of k -- pathlen is replacing it
* if word_id == EPSILON:
*/
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1035; __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, 0, 1, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_18 = __Pyx_GetItemInt(__pyx_t_3, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_GetItemInt(__pyx_t_3, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_18, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_18, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_spanlen);
@@ -49773,47 +49187,47 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1037
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1023
* spanlen = fwords[i][alt][2]
* # TODO get rid of k -- pathlen is replacing it
* if word_id == EPSILON: # <<<<<<<<<<<<<<
* # skipping because word_id is epsilon
* if i+spanlen >= len(fwords):
*/
- __pyx_t_3 = PyInt_FromLong(__pyx_v_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong(__pyx_v_4cdec_2sa_3_sa_EPSILON); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_18 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_18); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_18); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
if (__pyx_t_14) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1039
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1025
* 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_18 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
- __pyx_t_3 = PyNumber_Add(__pyx_t_18, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Add(__pyx_t_18, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
__pyx_t_18 = __pyx_cur_scope->__pyx_v_fwords;
__Pyx_INCREF(__pyx_t_18);
- __pyx_t_6 = PyObject_Length(__pyx_t_18); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_t_18); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
- __pyx_t_18 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
- __pyx_t_17 = PyObject_RichCompare(__pyx_t_3, __pyx_t_18, Py_GE); __Pyx_XGOTREF(__pyx_t_17); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = PyObject_RichCompare(__pyx_t_3, __pyx_t_18, Py_GE); __Pyx_XGOTREF(__pyx_t_17); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
- __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
if (__pyx_t_14) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1040
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1026
* # skipping because word_id is epsilon
* if i+spanlen >= len(fwords):
* continue # <<<<<<<<<<<<<<
@@ -49825,43 +49239,43 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
__pyx_L24:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1041
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1027
* 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_17 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_17);
- __pyx_t_18 = PyNumber_Add(__pyx_t_17, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyNumber_Add(__pyx_t_17, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
- __pyx_t_17 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fwords, __pyx_t_18); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fwords, __pyx_t_18); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_17);
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
- __pyx_t_6 = PyObject_Length(__pyx_t_17); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_t_17); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_6; __pyx_t_21+=1) {
__pyx_cur_scope->__pyx_v_nualt = __pyx_t_21;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1042
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1028
* 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_17 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_17);
- __pyx_t_18 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
- __pyx_t_3 = PyNumber_Add(__pyx_t_18, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Add(__pyx_t_18, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
- __pyx_t_18 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_nualt); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_nualt); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
- __pyx_t_1 = PyTuple_New(8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_17);
__Pyx_GIVEREF(__pyx_t_17);
@@ -49887,11 +49301,11 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_17 = 0;
__pyx_t_3 = 0;
__pyx_t_18 = 0;
- __pyx_t_13 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_frontier, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_frontier, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1043
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1029
* for nualt in range(0,len(fwords[i+spanlen])):
* frontier.append((k, i+spanlen, input_match, nualt, pathlen, node, prefix, is_shadow_path))
* continue # <<<<<<<<<<<<<<
@@ -49903,19 +49317,19 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
__pyx_L23:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1045
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1031
* continue
*
* phrase = prefix + (word_id,) # <<<<<<<<<<<<<<
* hiero_phrase = Phrase(phrase)
* arity = hiero_phrase.arity()
*/
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1045; __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 = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_word_id);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_word_id);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_word_id);
- __pyx_t_18 = PyNumber_Add(__pyx_cur_scope->__pyx_v_prefix, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyNumber_Add(__pyx_cur_scope->__pyx_v_prefix, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_phrase);
@@ -49923,19 +49337,19 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_18);
__pyx_t_18 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1046
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1032
*
* phrase = prefix + (word_id,)
* hiero_phrase = Phrase(phrase) # <<<<<<<<<<<<<<
* arity = hiero_phrase.arity()
*
*/
- __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_phrase);
PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_cur_scope->__pyx_v_phrase);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_phrase);
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_18), NULL); 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(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0;
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase));
@@ -49943,23 +49357,23 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1047
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1033
* phrase = prefix + (word_id,)
* hiero_phrase = Phrase(phrase)
* arity = hiero_phrase.arity() # <<<<<<<<<<<<<<
*
* lookup_required = False
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase), __pyx_n_s__arity); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase), __pyx_n_s__arity); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_18 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_21 = __Pyx_PyInt_AsInt(__pyx_t_18); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_21 = __Pyx_PyInt_AsInt(__pyx_t_18); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
__pyx_cur_scope->__pyx_v_arity = __pyx_t_21;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1049
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1035
* arity = hiero_phrase.arity()
*
* lookup_required = False # <<<<<<<<<<<<<<
@@ -49968,30 +49382,30 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
*/
__pyx_cur_scope->__pyx_v_lookup_required = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1050
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1036
*
* lookup_required = False
* if word_id in node.children: # <<<<<<<<<<<<<<
* if node.children[word_id] is None:
* # Path dead-ends at this node
*/
- __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
- __pyx_t_14 = (__Pyx_PySequence_Contains(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_18, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = (__Pyx_PySequence_Contains(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_18, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
__pyx_t_9 = (__pyx_t_14 != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1051
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1037
* 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_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
- __pyx_t_1 = PyObject_GetItem(__pyx_t_18, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetItem(__pyx_t_18, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
__pyx_t_9 = (__pyx_t_1 == Py_None);
@@ -49999,7 +49413,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_14 = (__pyx_t_9 != 0);
if (__pyx_t_14) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1053
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1039
* if node.children[word_id] is None:
* # Path dead-ends at this node
* continue # <<<<<<<<<<<<<<
@@ -50011,16 +49425,16 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1056
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1042
* else:
* # Path continues at this node
* node = node.children[word_id] # <<<<<<<<<<<<<<
* else:
* if node.suffix_link is None:
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_18 = PyObject_GetItem(__pyx_t_1, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyObject_GetItem(__pyx_t_1, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_node);
@@ -50033,21 +49447,21 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1058
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1044
* node = node.children[word_id]
* else:
* if node.suffix_link is None: # <<<<<<<<<<<<<<
* # Current node is root; lookup required
* lookup_required = True
*/
- __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__pyx_t_14 = (__pyx_t_18 == Py_None);
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
__pyx_t_9 = (__pyx_t_14 != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1060
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1046
* if node.suffix_link is None:
* # Current node is root; lookup required
* lookup_required = True # <<<<<<<<<<<<<<
@@ -50059,36 +49473,36 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1062
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1048
* 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_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s__children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s__children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
- __pyx_t_9 = (__Pyx_PySequence_Contains(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = (__Pyx_PySequence_Contains(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_14 = (__pyx_t_9 != 0);
if (__pyx_t_14) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1063
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1049
* else:
* if word_id in node.suffix_link.children:
* if node.suffix_link.children[word_id] is None: # <<<<<<<<<<<<<<
* # Suffix link reports path is dead end
* node.children[word_id] = None
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__children); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__children); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_GetItem(__pyx_t_18, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetItem(__pyx_t_18, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
__pyx_t_14 = (__pyx_t_1 == Py_None);
@@ -50096,19 +49510,19 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_9 = (__pyx_t_14 != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1065
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1051
* if node.suffix_link.children[word_id] is None:
* # Suffix link reports path is dead end
* node.children[word_id] = None # <<<<<<<<<<<<<<
* continue
* else:
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (PyObject_SetItem(__pyx_t_1, __pyx_cur_scope->__pyx_v_word_id, Py_None) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_t_1, __pyx_cur_scope->__pyx_v_word_id, Py_None) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1066
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1052
* # Suffix link reports path is dead end
* node.children[word_id] = None
* continue # <<<<<<<<<<<<<<
@@ -50120,7 +49534,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1069
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1055
* else:
* # Suffix link indicates lookup is reqired
* lookup_required = True # <<<<<<<<<<<<<<
@@ -50134,18 +49548,18 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1072
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1058
* else:
* #ERROR: We never get here
* raise Exception("Keyword trie error") # <<<<<<<<<<<<<<
* # checking whether lookup_required
* if lookup_required:
*/
- __pyx_t_1 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_127), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_127), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_L30:;
}
@@ -50153,7 +49567,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
__pyx_L27:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1074
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1060
* raise Exception("Keyword trie error")
* # checking whether lookup_required
* if lookup_required: # <<<<<<<<<<<<<<
@@ -50163,7 +49577,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_9 = (__pyx_cur_scope->__pyx_v_lookup_required != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1075
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1061
* # checking whether lookup_required
* if lookup_required:
* new_node = None # <<<<<<<<<<<<<<
@@ -50175,66 +49589,66 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_new_node, Py_None);
__Pyx_GIVEREF(Py_None);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1076
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1062
* if lookup_required:
* new_node = None
* if is_shadow_path: # <<<<<<<<<<<<<<
* # Extending shadow path
* # on the shadow path we don't do any search, we just use info from suffix link
*/
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1079
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1065
* # Extending shadow path
* # on the shadow path we don't do any search, we just use info from suffix link
* new_node = ExtendedTrieNode(phrase_location=node.suffix_link.children[word_id].phrase_location, # <<<<<<<<<<<<<<
* suffix_link=node.suffix_link.children[word_id],
* phrase=hiero_phrase)
*/
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
- __pyx_t_18 = PyObject_GetItem(__pyx_t_3, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyObject_GetItem(__pyx_t_3, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __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 = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1080
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1066
* # on the shadow path we don't do any search, we just use info from suffix link
* new_node = ExtendedTrieNode(phrase_location=node.suffix_link.children[word_id].phrase_location,
* suffix_link=node.suffix_link.children[word_id], # <<<<<<<<<<<<<<
* phrase=hiero_phrase)
* else:
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__children); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__children); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_GetItem(__pyx_t_18, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_t_18, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__suffix_link), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__suffix_link), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1081
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1067
* new_node = ExtendedTrieNode(phrase_location=node.suffix_link.children[word_id].phrase_location,
* suffix_link=node.suffix_link.children[word_id],
* phrase=hiero_phrase) # <<<<<<<<<<<<<<
* else:
* if arity > 0:
*/
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__phrase), ((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__phrase), ((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_new_node);
@@ -50245,7 +49659,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1083
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1069
* phrase=hiero_phrase)
* else:
* if arity > 0: # <<<<<<<<<<<<<<
@@ -50255,16 +49669,16 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_9 = ((__pyx_cur_scope->__pyx_v_arity > 0) != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1085
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1071
* if arity > 0:
* # Intersecting because of arity > 0
* intersect_start_time = monitor_cpu() # <<<<<<<<<<<<<<
* phrase_location = self.intersect(node, node.suffix_link.children[word_id], hiero_phrase)
* intersect_stop_time = monitor_cpu()
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_intersect_start_time);
@@ -50272,22 +49686,22 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1086
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1072
* # Intersecting because of arity > 0
* intersect_start_time = monitor_cpu()
* phrase_location = self.intersect(node, node.suffix_link.children[word_id], hiero_phrase) # <<<<<<<<<<<<<<
* intersect_stop_time = monitor_cpu()
* self.intersect_time += intersect_stop_time - intersect_start_time
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_GetItem(__pyx_t_3, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetItem(__pyx_t_3, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1072; __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_4cdec_2sa_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 = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_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 = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location));
@@ -50295,16 +49709,16 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1087
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1073
* intersect_start_time = monitor_cpu()
* phrase_location = self.intersect(node, node.suffix_link.children[word_id], hiero_phrase)
* intersect_stop_time = monitor_cpu() # <<<<<<<<<<<<<<
* self.intersect_time += intersect_stop_time - intersect_start_time
* else:
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_intersect_stop_time);
@@ -50312,66 +49726,66 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1088
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1074
* phrase_location = self.intersect(node, node.suffix_link.children[word_id], hiero_phrase)
* intersect_stop_time = monitor_cpu()
* self.intersect_time += intersect_stop_time - intersect_start_time # <<<<<<<<<<<<<<
* else:
* # Suffix array search
*/
- __pyx_t_1 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->intersect_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->intersect_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_intersect_stop_time, __pyx_cur_scope->__pyx_v_intersect_start_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_intersect_stop_time, __pyx_cur_scope->__pyx_v_intersect_start_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_18 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_18); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_18); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
__pyx_cur_scope->__pyx_v_self->intersect_time = __pyx_t_4;
goto __pyx_L34;
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1091
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1077
* 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_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
- if (!(likely(((__pyx_t_18) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_18, __pyx_ptype_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_18) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_18, __pyx_ptype_4cdec_2sa_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location));
__Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_phrase_location, ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)__pyx_t_18));
__Pyx_GIVEREF(__pyx_t_18);
__pyx_t_18 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1092
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1078
* # 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_18 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self->fsa), __pyx_n_s__lookup); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self->fsa), __pyx_n_s__lookup); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_phrase, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_phrase, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_21 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_21 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_f_4cdec_2sa_3_sa_sym_tostring(__pyx_t_21)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_f_4cdec_2sa_3_sa_sym_tostring(__pyx_t_21)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
- __pyx_t_6 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_6 - 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_6 - 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_17 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_phrase_location->sa_low); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_phrase_location->sa_low); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_17);
- __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_phrase_location->sa_high); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_phrase_location->sa_high); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
- __pyx_t_10 = PyTuple_New(4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_New(4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_3));
__Pyx_GIVEREF(((PyObject *)__pyx_t_3));
@@ -50385,7 +49799,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_1 = 0;
__pyx_t_17 = 0;
__pyx_t_12 = 0;
- __pyx_t_12 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
@@ -50394,7 +49808,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_12);
__pyx_t_12 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1093
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1079
* 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: # <<<<<<<<<<<<<<
@@ -50405,24 +49819,24 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_14 = (__pyx_t_9 != 0);
if (__pyx_t_14) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1094
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1080
* sa_range = self.fsa.lookup(sym_tostring(phrase[-1]), len(phrase)-1, phrase_location.sa_low, phrase_location.sa_high)
* if sa_range is not None:
* phrase_location = PhraseLocation(sa_low=sa_range[0], sa_high=sa_range[1]) # <<<<<<<<<<<<<<
* else:
* phrase_location = None
*/
- __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_12));
- __pyx_t_10 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_sa_range, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_sa_range, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__sa_low), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__sa_low), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_sa_range, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_sa_range, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__sa_high), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__sa_high), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __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_4cdec_2sa_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
__Pyx_GOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location));
@@ -50433,7 +49847,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1096
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1082
* phrase_location = PhraseLocation(sa_low=sa_range[0], sa_high=sa_range[1])
* else:
* phrase_location = None # <<<<<<<<<<<<<<
@@ -50449,7 +49863,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
__pyx_L34:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1098
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1084
* phrase_location = None
*
* if phrase_location is None: # <<<<<<<<<<<<<<
@@ -50460,19 +49874,19 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_9 = (__pyx_t_14 != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1099
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1085
*
* if phrase_location is None:
* node.children[word_id] = None # <<<<<<<<<<<<<<
* # Search failed
* continue
*/
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- if (PyObject_SetItem(__pyx_t_10, __pyx_cur_scope->__pyx_v_word_id, Py_None) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_t_10, __pyx_cur_scope->__pyx_v_word_id, Py_None) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1101
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1087
* node.children[word_id] = None
* # Search failed
* continue # <<<<<<<<<<<<<<
@@ -50484,7 +49898,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
__pyx_L36:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1103
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1089
* continue
* # Search succeeded
* suffix_link = self.rules.root # <<<<<<<<<<<<<<
@@ -50498,33 +49912,33 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_10);
__pyx_t_10 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1104
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1090
* # Search succeeded
* suffix_link = self.rules.root
* if node.suffix_link is not None: # <<<<<<<<<<<<<<
* suffix_link = node.suffix_link.children[word_id]
* new_node = ExtendedTrieNode(phrase_location=phrase_location,
*/
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_9 = (__pyx_t_10 != Py_None);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_14 = (__pyx_t_9 != 0);
if (__pyx_t_14) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1105
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1091
* suffix_link = self.rules.root
* if node.suffix_link is not None:
* suffix_link = node.suffix_link.children[word_id] # <<<<<<<<<<<<<<
* new_node = ExtendedTrieNode(phrase_location=phrase_location,
* suffix_link=suffix_link,
*/
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s__children); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s__children); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyObject_GetItem(__pyx_t_12, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_GetItem(__pyx_t_12, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_suffix_link);
@@ -50535,35 +49949,35 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
__pyx_L37:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1106
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1092
* if node.suffix_link is not None:
* suffix_link = node.suffix_link.children[word_id]
* new_node = ExtendedTrieNode(phrase_location=phrase_location, # <<<<<<<<<<<<<<
* suffix_link=suffix_link,
* phrase=hiero_phrase)
*/
- __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_10));
- if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__phrase_location), ((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__phrase_location), ((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1107
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1093
* suffix_link = node.suffix_link.children[word_id]
* new_node = ExtendedTrieNode(phrase_location=phrase_location,
* suffix_link=suffix_link, # <<<<<<<<<<<<<<
* phrase=hiero_phrase)
* node.children[word_id] = new_node
*/
- if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__suffix_link), __pyx_cur_scope->__pyx_v_suffix_link) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__suffix_link), __pyx_cur_scope->__pyx_v_suffix_link) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1108
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1094
* new_node = ExtendedTrieNode(phrase_location=phrase_location,
* suffix_link=suffix_link,
* phrase=hiero_phrase) # <<<<<<<<<<<<<<
* node.children[word_id] = new_node
* node = new_node
*/
- if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__phrase), ((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__phrase), ((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_new_node);
@@ -50573,19 +49987,19 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
__pyx_L33:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1109
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1095
* suffix_link=suffix_link,
* phrase=hiero_phrase)
* node.children[word_id] = new_node # <<<<<<<<<<<<<<
* node = new_node
*
*/
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
- if (PyObject_SetItem(__pyx_t_12, __pyx_cur_scope->__pyx_v_word_id, __pyx_cur_scope->__pyx_v_new_node) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_t_12, __pyx_cur_scope->__pyx_v_word_id, __pyx_cur_scope->__pyx_v_new_node) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1110
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1096
* phrase=hiero_phrase)
* node.children[word_id] = new_node
* node = new_node # <<<<<<<<<<<<<<
@@ -50597,7 +50011,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_node, __pyx_cur_scope->__pyx_v_new_node);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_new_node);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1115
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1101
* This should happen before we get to extraction (so that
* the node will exist if needed)'''
* if arity < self.max_nonterminals: # <<<<<<<<<<<<<<
@@ -50607,31 +50021,31 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_14 = ((__pyx_cur_scope->__pyx_v_arity < __pyx_cur_scope->__pyx_v_self->max_nonterminals) != 0);
if (__pyx_t_14) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1116
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1102
* the node will exist if needed)'''
* if arity < self.max_nonterminals:
* xcat_index = arity+1 # <<<<<<<<<<<<<<
* xcat = sym_setindex(self.category, xcat_index)
* suffix_link_xcat_index = xcat_index
*/
- __pyx_t_12 = PyInt_FromLong((__pyx_cur_scope->__pyx_v_arity + 1)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyInt_FromLong((__pyx_cur_scope->__pyx_v_arity + 1)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_xcat_index);
__Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_xcat_index, __pyx_t_12);
__Pyx_GIVEREF(__pyx_t_12);
__pyx_t_12 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1117
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1103
* 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_21 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_xcat_index); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_21 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_xcat_index); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_cur_scope->__pyx_v_xcat = __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_21);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1118
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1104
* xcat_index = arity+1
* xcat = sym_setindex(self.category, xcat_index)
* suffix_link_xcat_index = xcat_index # <<<<<<<<<<<<<<
@@ -50643,24 +50057,24 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_suffix_link_xcat_index, __pyx_cur_scope->__pyx_v_xcat_index);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_xcat_index);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1119
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1105
* 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_14 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_14) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1120
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1106
* suffix_link_xcat_index = xcat_index
* if is_shadow_path:
* suffix_link_xcat_index = xcat_index-1 # <<<<<<<<<<<<<<
* suffix_link_xcat = sym_setindex(self.category, suffix_link_xcat_index)
* node.children[xcat] = ExtendedTrieNode(phrase_location=node.phrase_location,
*/
- __pyx_t_12 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_xcat_index, __pyx_int_1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_xcat_index, __pyx_int_1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_suffix_link_xcat_index);
__Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_suffix_link_xcat_index, __pyx_t_12);
@@ -50670,159 +50084,159 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
__pyx_L39:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1121
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1107
* 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_21 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_suffix_link_xcat_index); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_21 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_suffix_link_xcat_index); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_cur_scope->__pyx_v_suffix_link_xcat = __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_21);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1122
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1108
* suffix_link_xcat_index = xcat_index-1
* suffix_link_xcat = sym_setindex(self.category, suffix_link_xcat_index)
* node.children[xcat] = ExtendedTrieNode(phrase_location=node.phrase_location, # <<<<<<<<<<<<<<
* suffix_link=node.suffix_link.children[suffix_link_xcat],
* phrase= Phrase(phrase + (xcat,)))
*/
- __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_12));
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1123
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1109
* suffix_link_xcat = sym_setindex(self.category, suffix_link_xcat_index)
* node.children[xcat] = ExtendedTrieNode(phrase_location=node.phrase_location,
* suffix_link=node.suffix_link.children[suffix_link_xcat], # <<<<<<<<<<<<<<
* phrase= Phrase(phrase + (xcat,)))
*
*/
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s__children); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s__children); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_18, __pyx_cur_scope->__pyx_v_suffix_link_xcat, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_18, __pyx_cur_scope->__pyx_v_suffix_link_xcat, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
- if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__suffix_link), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__suffix_link), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1124
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1110
* node.children[xcat] = ExtendedTrieNode(phrase_location=node.phrase_location,
* suffix_link=node.suffix_link.children[suffix_link_xcat],
* phrase= Phrase(phrase + (xcat,))) # <<<<<<<<<<<<<<
*
* # sample from range
*/
- __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_xcat); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_xcat); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_10);
__Pyx_GIVEREF(__pyx_t_10);
__pyx_t_10 = 0;
- __pyx_t_10 = PyNumber_Add(__pyx_cur_scope->__pyx_v_phrase, ((PyObject *)__pyx_t_18)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyNumber_Add(__pyx_cur_scope->__pyx_v_phrase, ((PyObject *)__pyx_t_18)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0;
- __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_10);
__Pyx_GIVEREF(__pyx_t_10);
__pyx_t_10 = 0;
- __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0;
- if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__phrase), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__phrase), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1108; __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_4cdec_2sa_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1122
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1108
* suffix_link_xcat_index = xcat_index-1
* suffix_link_xcat = sym_setindex(self.category, suffix_link_xcat_index)
* node.children[xcat] = ExtendedTrieNode(phrase_location=node.phrase_location, # <<<<<<<<<<<<<<
* suffix_link=node.suffix_link.children[suffix_link_xcat],
* phrase= Phrase(phrase + (xcat,)))
*/
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
- if (__Pyx_SetItemInt(__pyx_t_12, __pyx_cur_scope->__pyx_v_xcat, __pyx_t_10, sizeof(int), PyInt_FromLong, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_t_12, __pyx_cur_scope->__pyx_v_xcat, __pyx_t_10, sizeof(int), PyInt_FromLong, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
goto __pyx_L38;
}
__pyx_L38:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1127
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1113
*
* # 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_14 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_9 = ((!__pyx_t_14) != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1128
+ /* "/home/mdenkows/cdec/python/cdec/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
* chunklen = IntList(initial_len=num_subpatterns)
*/
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self->sampler), __pyx_n_s__sample); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self->sampler), __pyx_n_s__sample); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
- __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_12);
__Pyx_GIVEREF(__pyx_t_12);
__pyx_t_12 = 0;
- __pyx_t_12 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0;
- if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_sample));
__Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_sample, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_12));
__Pyx_GIVEREF(__pyx_t_12);
__pyx_t_12 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1129
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1115
* 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_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
__pyx_t_21 = ((struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *)__pyx_t_12)->num_subpatterns;
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__pyx_cur_scope->__pyx_v_num_subpatterns = __pyx_t_21;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1130
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1116
* 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_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_12));
- __pyx_t_18 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_num_subpatterns); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_num_subpatterns); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
- if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_18) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_18) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
- __pyx_t_18 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_chunklen));
@@ -50830,7 +50244,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_18);
__pyx_t_18 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1131
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1117
* num_subpatterns = (<PhraseLocation> node.phrase_location).num_subpatterns
* chunklen = IntList(initial_len=num_subpatterns)
* for j from 0 <= j < num_subpatterns: # <<<<<<<<<<<<<<
@@ -50840,7 +50254,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_21 = __pyx_cur_scope->__pyx_v_num_subpatterns;
for (__pyx_cur_scope->__pyx_v_j = 0; __pyx_cur_scope->__pyx_v_j < __pyx_t_21; __pyx_cur_scope->__pyx_v_j++) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1132
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1118
* chunklen = IntList(initial_len=num_subpatterns)
* for j from 0 <= j < num_subpatterns:
* chunklen.arr[j] = hiero_phrase.chunklen(j) # <<<<<<<<<<<<<<
@@ -50850,21 +50264,21 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
(__pyx_cur_scope->__pyx_v_chunklen->arr[__pyx_cur_scope->__pyx_v_j]) = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Phrase *)__pyx_cur_scope->__pyx_v_hiero_phrase->__pyx_vtab)->chunklen(__pyx_cur_scope->__pyx_v_hiero_phrase, __pyx_cur_scope->__pyx_v_j);
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1133
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1119
* for j from 0 <= j < num_subpatterns:
* chunklen.arr[j] = hiero_phrase.chunklen(j)
* extracts = [] # <<<<<<<<<<<<<<
* j = 0
* extract_start = monitor_cpu()
*/
- __pyx_t_18 = PyList_New(0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyList_New(0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_extracts));
__Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_extracts, ((PyObject*)__pyx_t_18));
__Pyx_GIVEREF(((PyObject *)__pyx_t_18));
__pyx_t_18 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1134
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1120
* chunklen.arr[j] = hiero_phrase.chunklen(j)
* extracts = []
* j = 0 # <<<<<<<<<<<<<<
@@ -50873,16 +50287,16 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
*/
__pyx_cur_scope->__pyx_v_j = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1135
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1121
* extracts = []
* j = 0
* extract_start = monitor_cpu() # <<<<<<<<<<<<<<
* while j < sample.len:
* extract = []
*/
- __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
- __pyx_t_12 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_extract_start);
@@ -50890,7 +50304,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_12);
__pyx_t_12 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1136
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1122
* j = 0
* extract_start = monitor_cpu()
* while j < sample.len: # <<<<<<<<<<<<<<
@@ -50901,21 +50315,21 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_9 = ((__pyx_cur_scope->__pyx_v_j < __pyx_cur_scope->__pyx_v_sample->len) != 0);
if (!__pyx_t_9) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1137
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1123
* extract_start = monitor_cpu()
* while j < sample.len:
* extract = [] # <<<<<<<<<<<<<<
*
* assign_matching(&matching, sample.arr, j, num_subpatterns, self.fda.sent_id.arr)
*/
- __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __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 = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_extract);
__Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_12));
__Pyx_GIVEREF(((PyObject *)__pyx_t_12));
__pyx_t_12 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1139
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1125
* extract = []
*
* assign_matching(&matching, sample.arr, j, num_subpatterns, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -50924,21 +50338,21 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
*/
__pyx_f_4cdec_2sa_3_sa_assign_matching((&__pyx_cur_scope->__pyx_v_matching), __pyx_cur_scope->__pyx_v_sample->arr, __pyx_cur_scope->__pyx_v_j, __pyx_cur_scope->__pyx_v_num_subpatterns, __pyx_cur_scope->__pyx_v_self->fda->sent_id->arr);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1140
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1126
*
* assign_matching(&matching, sample.arr, j, num_subpatterns, self.fda.sent_id.arr)
* loc = tuple(sample[j:j+num_subpatterns]) # <<<<<<<<<<<<<<
* extract = self.extract(hiero_phrase, &matching, chunklen.arr, num_subpatterns)
* extracts.extend([(e, loc) for e in extract])
*/
- __pyx_t_12 = __Pyx_PyObject_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), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyObject_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), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
- __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_12);
__Pyx_GIVEREF(__pyx_t_12);
__pyx_t_12 = 0;
- __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_loc);
@@ -50946,36 +50360,36 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_12);
__pyx_t_12 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1141
+ /* "/home/mdenkows/cdec/python/cdec/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])
* j = j + num_subpatterns
*/
- __pyx_t_12 = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->extract(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_hiero_phrase, (&__pyx_cur_scope->__pyx_v_matching), __pyx_cur_scope->__pyx_v_chunklen->arr, __pyx_cur_scope->__pyx_v_num_subpatterns); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->extract(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_hiero_phrase, (&__pyx_cur_scope->__pyx_v_matching), __pyx_cur_scope->__pyx_v_chunklen->arr, __pyx_cur_scope->__pyx_v_num_subpatterns); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_extract);
__Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_extract, __pyx_t_12);
__Pyx_GIVEREF(__pyx_t_12);
__pyx_t_12 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1142
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1128
* 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_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_extracts), __pyx_n_s__extend); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_extracts), __pyx_n_s__extend); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
- __pyx_t_18 = PyList_New(0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyList_New(0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_extract) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_extract)) {
__pyx_t_10 = __pyx_cur_scope->__pyx_v_extract; __Pyx_INCREF(__pyx_t_10); __pyx_t_6 = 0;
__pyx_t_22 = NULL;
} else {
- __pyx_t_6 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_extract); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_extract); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_22 = Py_TYPE(__pyx_t_10)->tp_iternext;
}
@@ -50983,23 +50397,23 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
if (!__pyx_t_22 && PyList_CheckExact(__pyx_t_10)) {
if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_10)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_17 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_17); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_17); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_17 = PySequence_ITEM(__pyx_t_10, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = PySequence_ITEM(__pyx_t_10, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_22 && PyTuple_CheckExact(__pyx_t_10)) {
if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_10)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_17 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_17); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_17); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_17 = PySequence_ITEM(__pyx_t_10, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = PySequence_ITEM(__pyx_t_10, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_17 = __pyx_t_22(__pyx_t_10);
if (unlikely(!__pyx_t_17)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -51009,7 +50423,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_e, __pyx_t_17);
__Pyx_GIVEREF(__pyx_t_17);
__pyx_t_17 = 0;
- __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_17);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_e);
PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_cur_scope->__pyx_v_e);
@@ -51017,22 +50431,22 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_loc);
PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_cur_scope->__pyx_v_loc);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_loc);
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_18, (PyObject*)__pyx_t_17))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_18, (PyObject*)__pyx_t_17))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0;
}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_18));
__Pyx_GIVEREF(((PyObject *)__pyx_t_18));
__pyx_t_18 = 0;
- __pyx_t_18 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1143
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1129
* extract = self.extract(hiero_phrase, &matching, chunklen.arr, num_subpatterns)
* extracts.extend([(e, loc) for e in extract])
* j = j + num_subpatterns # <<<<<<<<<<<<<<
@@ -51042,7 +50456,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_cur_scope->__pyx_v_j = (__pyx_cur_scope->__pyx_v_j + __pyx_cur_scope->__pyx_v_num_subpatterns);
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1145
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1131
* j = j + num_subpatterns
*
* num_samples = sample.len/num_subpatterns # <<<<<<<<<<<<<<
@@ -51057,7 +50471,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
#ifdef WITH_THREAD
PyGILState_Release(__pyx_gilstate_save);
#endif
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1131; __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))) {
#ifdef WITH_THREAD
@@ -51067,20 +50481,20 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
#ifdef WITH_THREAD
PyGILState_Release(__pyx_gilstate_save);
#endif
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1131; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1146
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1132
*
* 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_18 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
- __pyx_t_10 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_extract_stop);
@@ -51088,46 +50502,46 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_10);
__pyx_t_10 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1147
+ /* "/home/mdenkows/cdec/python/cdec/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:
* fcount = Counter()
*/
- __pyx_t_10 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->extract_time); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->extract_time); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_18 = PyNumber_Add(__pyx_t_10, __pyx_cur_scope->__pyx_v_extract_stop); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyNumber_Add(__pyx_t_10, __pyx_cur_scope->__pyx_v_extract_stop); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyNumber_Subtract(__pyx_t_18, __pyx_cur_scope->__pyx_v_extract_start); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyNumber_Subtract(__pyx_t_18, __pyx_cur_scope->__pyx_v_extract_start); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
- __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_10); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_10); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_cur_scope->__pyx_v_self->extract_time = __pyx_t_4;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1148
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1134
* extract_stop = monitor_cpu()
* self.extract_time = self.extract_time + extract_stop - extract_start
* if len(extracts) > 0: # <<<<<<<<<<<<<<
* fcount = Counter()
* fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list)))
*/
- __pyx_t_6 = PyList_GET_SIZE(((PyObject *)__pyx_cur_scope->__pyx_v_extracts)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyList_GET_SIZE(((PyObject *)__pyx_cur_scope->__pyx_v_extracts)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_9 = ((__pyx_t_6 > 0) != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1149
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1135
* self.extract_time = self.extract_time + extract_stop - extract_start
* if len(extracts) > 0:
* fcount = Counter() # <<<<<<<<<<<<<<
* fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list)))
* for (f, e, count, als), loc in extracts:
*/
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s__Counter); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s__Counter); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_18 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_fcount);
@@ -51135,23 +50549,23 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_18);
__pyx_t_18 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1150
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1136
* 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_18 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s__defaultdict); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
- __pyx_t_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda5, 0, __pyx_n_s_128, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_lambda3, 0, __pyx_n_s_128, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10);
__Pyx_GIVEREF(__pyx_t_10);
__pyx_t_10 = 0;
- __pyx_t_10 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
@@ -51160,7 +50574,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_10);
__pyx_t_10 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1151
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1137
* fcount = Counter()
* fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list)))
* for (f, e, count, als), loc in extracts: # <<<<<<<<<<<<<<
@@ -51171,9 +50585,9 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
for (;;) {
if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_10)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_12 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_12); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_12); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_12 = PySequence_ITEM(__pyx_t_10, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PySequence_ITEM(__pyx_t_10, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
if ((likely(PyTuple_CheckExact(__pyx_t_12))) || (PyList_CheckExact(__pyx_t_12))) {
PyObject* sequence = __pyx_t_12;
@@ -51185,7 +50599,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -51198,16 +50612,16 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_INCREF(__pyx_t_18);
__Pyx_INCREF(__pyx_t_17);
#else
- __pyx_t_18 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
- __pyx_t_17 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_17);
#endif
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_1 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__pyx_t_20 = Py_TYPE(__pyx_t_1)->tp_iternext;
@@ -51215,7 +50629,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GOTREF(__pyx_t_18);
index = 1; __pyx_t_17 = __pyx_t_20(__pyx_t_1); if (unlikely(!__pyx_t_17)) goto __pyx_L50_unpacking_failed;
__Pyx_GOTREF(__pyx_t_17);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_20 = NULL;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L51_unpacking_done;
@@ -51223,7 +50637,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_20 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L51_unpacking_done:;
}
if ((likely(PyTuple_CheckExact(__pyx_t_18))) || (PyList_CheckExact(__pyx_t_18))) {
@@ -51236,7 +50650,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
if (unlikely(size != 4)) {
if (size > 4) __Pyx_RaiseTooManyValuesError(4);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -51258,7 +50672,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
Py_ssize_t i;
PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_3,&__pyx_t_11,&__pyx_t_8};
for (i=0; i < 4; i++) {
- PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(item);
*(temps[i]) = item;
}
@@ -51268,7 +50682,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
{
Py_ssize_t index = -1;
PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_3,&__pyx_t_11,&__pyx_t_8};
- __pyx_t_16 = PyObject_GetIter(__pyx_t_18); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PyObject_GetIter(__pyx_t_18); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
__pyx_t_20 = Py_TYPE(__pyx_t_16)->tp_iternext;
@@ -51277,7 +50691,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GOTREF(item);
*(temps[index]) = item;
}
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_16), 4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_16), 4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_20 = NULL;
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
goto __pyx_L53_unpacking_done;
@@ -51285,7 +50699,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
__pyx_t_20 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L53_unpacking_done:;
}
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_f);
@@ -51309,7 +50723,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_17);
__pyx_t_17 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1152
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1138
* fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list)))
* for (f, e, count, als), loc in extracts:
* fcount[f] += count # <<<<<<<<<<<<<<
@@ -51318,38 +50732,38 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
*/
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
__pyx_t_12 = __pyx_cur_scope->__pyx_v_f;
- __pyx_t_17 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_t_12); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_t_12); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_17);
- __pyx_t_18 = PyNumber_InPlaceAdd(__pyx_t_17, __pyx_cur_scope->__pyx_v_count); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyNumber_InPlaceAdd(__pyx_t_17, __pyx_cur_scope->__pyx_v_count); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
- if (PyObject_SetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_t_12, __pyx_t_18) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_t_12, __pyx_t_18) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1153
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1139
* for (f, e, count, als), loc in extracts:
* fcount[f] += count
* fphrases[f][e][als].append(loc) # <<<<<<<<<<<<<<
* for f, elist in fphrases.iteritems():
* for e, alslist in elist.iteritems():
*/
- __pyx_t_12 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fphrases, __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fphrases, __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
- __pyx_t_18 = PyObject_GetItem(__pyx_t_12, __pyx_cur_scope->__pyx_v_e); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyObject_GetItem(__pyx_t_12, __pyx_cur_scope->__pyx_v_e); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_t_12 = PyObject_GetItem(__pyx_t_18, __pyx_cur_scope->__pyx_v_als); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyObject_GetItem(__pyx_t_18, __pyx_cur_scope->__pyx_v_als); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
- __pyx_t_18 = __Pyx_PyObject_Append(__pyx_t_12, __pyx_cur_scope->__pyx_v_loc); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyObject_Append(__pyx_t_12, __pyx_cur_scope->__pyx_v_loc); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1154
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1140
* fcount[f] += count
* fphrases[f][e][als].append(loc)
* for f, elist in fphrases.iteritems(): # <<<<<<<<<<<<<<
@@ -51359,9 +50773,9 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_6 = 0;
if (unlikely(__pyx_cur_scope->__pyx_v_fphrases == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_t_18 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_fphrases, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_23), (&__pyx_t_21)); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_fphrases, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_23), (&__pyx_t_21)); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_XDECREF(__pyx_t_10);
__pyx_t_10 = __pyx_t_18;
@@ -51369,7 +50783,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
while (1) {
__pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_10, __pyx_t_23, &__pyx_t_6, &__pyx_t_18, &__pyx_t_12, NULL, __pyx_t_21);
if (unlikely(__pyx_t_7 == 0)) break;
- if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_GOTREF(__pyx_t_12);
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_f);
@@ -51381,7 +50795,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_12);
__pyx_t_12 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1155
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1141
* fphrases[f][e][als].append(loc)
* for f, elist in fphrases.iteritems():
* for e, alslist in elist.iteritems(): # <<<<<<<<<<<<<<
@@ -51391,9 +50805,9 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__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 = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_t_18 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_elist, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_25), (&__pyx_t_7)); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_elist, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_25), (&__pyx_t_7)); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_XDECREF(__pyx_t_12);
__pyx_t_12 = __pyx_t_18;
@@ -51401,7 +50815,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
while (1) {
__pyx_t_5 = __Pyx_dict_iter_next(__pyx_t_12, __pyx_t_25, &__pyx_t_24, &__pyx_t_18, &__pyx_t_17, NULL, __pyx_t_7);
if (unlikely(__pyx_t_5 == 0)) break;
- if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_GOTREF(__pyx_t_17);
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_e);
@@ -51413,30 +50827,30 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_17);
__pyx_t_17 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1156
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1142
* 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_17 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_alslist, __pyx_n_s__iteritems); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_alslist, __pyx_n_s__iteritems); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_17);
- __pyx_t_18 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
- __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_17);
PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_18);
__Pyx_GIVEREF(__pyx_t_18);
__pyx_t_18 = 0;
- __pyx_t_18 = PyDict_New(); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyDict_New(); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_18));
- __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambda7, 0, __pyx_n_s_128, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_1lambda5, 0, __pyx_n_s_128, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- if (PyDict_SetItem(__pyx_t_18, ((PyObject *)__pyx_n_s__key), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_18, ((PyObject *)__pyx_n_s__key), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_17), ((PyObject *)__pyx_t_18)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_17), ((PyObject *)__pyx_t_18)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0;
@@ -51450,7 +50864,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -51463,16 +50877,16 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_INCREF(__pyx_t_18);
__Pyx_INCREF(__pyx_t_17);
#else
- __pyx_t_18 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
- __pyx_t_17 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_17);
#endif
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_11 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_20 = Py_TYPE(__pyx_t_11)->tp_iternext;
@@ -51480,7 +50894,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GOTREF(__pyx_t_18);
index = 1; __pyx_t_17 = __pyx_t_20(__pyx_t_11); if (unlikely(!__pyx_t_17)) goto __pyx_L58_unpacking_failed;
__Pyx_GOTREF(__pyx_t_17);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_20 = NULL;
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
goto __pyx_L59_unpacking_done;
@@ -51488,7 +50902,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_t_20 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L59_unpacking_done:;
}
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_alignment);
@@ -51500,41 +50914,41 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_17);
__pyx_t_17 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1157
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1143
* for e, alslist in elist.iteritems():
* alignment, max_locs = max(alslist.iteritems(), key=lambda x: len(x[1]))
* locs = tuple(itertools.chain.from_iterable(alslist.itervalues())) # <<<<<<<<<<<<<<
* count = len(locs)
* scores = self.scorer.score(FeatureContext(
*/
- __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s__itertools); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s__itertools); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s__chain); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s__chain); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_17);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s__from_iterable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s__from_iterable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
- __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_alslist, __pyx_n_s__itervalues); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_alslist, __pyx_n_s__itervalues); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_17);
- __pyx_t_18 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
- __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_17);
PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_18);
__Pyx_GIVEREF(__pyx_t_18);
__pyx_t_18 = 0;
- __pyx_t_18 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0;
- __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_17);
PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_18);
__Pyx_GIVEREF(__pyx_t_18);
__pyx_t_18 = 0;
- __pyx_t_18 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0;
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_locs));
@@ -51542,58 +50956,58 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_18);
__pyx_t_18 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1158
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1144
* 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 = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_18 = PyInt_FromSsize_t(__pyx_t_26); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __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 = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyInt_FromSsize_t(__pyx_t_26); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_count);
__Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_count, __pyx_t_18);
__Pyx_GIVEREF(__pyx_t_18);
__pyx_t_18 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1159
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1145
* 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_18 = __Pyx_GetModuleGlobalName(__pyx_n_s__FeatureContext); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s__FeatureContext); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1160
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1146
* 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_17 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_17);
- __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_num_samples); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_num_samples); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1161
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1147
* scores = self.scorer.score(FeatureContext(
* f, e, count, fcount[f], num_samples,
* (k,i+spanlen), locs, input_match, # <<<<<<<<<<<<<<
* fwords, self.fda, self.eda,
* meta,
*/
- __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1161; __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 = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1161; __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 = 1147; __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);
@@ -51602,16 +51016,16 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_11 = 0;
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1165
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1151
* meta,
* # Include online stats. None if none.
* self.online_ctx_lookup(f, e, ctx_name))) # <<<<<<<<<<<<<<
* # Phrase pair processed
* if self.online:
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__online_ctx_lookup); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__online_ctx_lookup); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_cur_scope->__pyx_v_f);
@@ -51622,11 +51036,11 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_ctx_name);
PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_cur_scope->__pyx_v_ctx_name);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ctx_name);
- __pyx_t_16 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
- __pyx_t_11 = PyTuple_New(13); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyTuple_New(13); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_cur_scope->__pyx_v_f);
@@ -51667,11 +51081,11 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_8 = 0;
__pyx_t_3 = 0;
__pyx_t_16 = 0;
- __pyx_t_16 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_t_11), NULL); 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);
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
- __pyx_t_11 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Scorer *)__pyx_cur_scope->__pyx_v_self->scorer->__pyx_vtab)->score(__pyx_cur_scope->__pyx_v_self->scorer, __pyx_t_16)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Scorer *)__pyx_cur_scope->__pyx_v_self->scorer->__pyx_vtab)->score(__pyx_cur_scope->__pyx_v_self->scorer, __pyx_t_16)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_scores));
@@ -51679,7 +51093,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_11);
__pyx_t_11 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1167
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1153
* self.online_ctx_lookup(f, e, ctx_name)))
* # Phrase pair processed
* if self.online: # <<<<<<<<<<<<<<
@@ -51689,14 +51103,14 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_9 = (__pyx_cur_scope->__pyx_v_self->online != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1168
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1154
* # Phrase pair processed
* if self.online:
* seen_phrases.add((f, e)) # <<<<<<<<<<<<<<
* yield Rule(self.category, f, e, scores, alignment)
*
*/
- __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_cur_scope->__pyx_v_f);
@@ -51704,22 +51118,22 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_e);
PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_cur_scope->__pyx_v_e);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e);
- __pyx_t_13 = PySet_Add(__pyx_cur_scope->__pyx_v_seen_phrases, ((PyObject *)__pyx_t_11)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PySet_Add(__pyx_cur_scope->__pyx_v_seen_phrases, ((PyObject *)__pyx_t_11)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
goto __pyx_L60;
}
__pyx_L60:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1169
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1155
* if self.online:
* seen_phrases.add((f, e))
* yield Rule(self.category, f, e, scores, alignment) # <<<<<<<<<<<<<<
*
* if len(phrase) < self.max_length and i+spanlen < len(fwords) and pathlen+1 <= self.max_initial_size:
*/
- __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->category); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->category); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_16 = PyTuple_New(5); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PyTuple_New(5); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_11);
__Pyx_GIVEREF(__pyx_t_11);
@@ -51736,7 +51150,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
PyTuple_SET_ITEM(__pyx_t_16, 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_4cdec_2sa_3_sa_Rule)), ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Rule)), ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0;
__pyx_r = __pyx_t_11;
@@ -51776,7 +51190,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__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 = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
}
@@ -51791,41 +51205,41 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
__pyx_L32:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1171
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1157
* 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 = 1171; __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 = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_9 = (__pyx_t_23 < __pyx_cur_scope->__pyx_v_self->max_length);
if (__pyx_t_9) {
- __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1171; __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 = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_12 = PyNumber_Add(__pyx_t_10, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyNumber_Add(__pyx_t_10, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_10 = __pyx_cur_scope->__pyx_v_fwords;
__Pyx_INCREF(__pyx_t_10);
- __pyx_t_23 = PyObject_Length(__pyx_t_10); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_23 = PyObject_Length(__pyx_t_10); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_23); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_23); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_11 = PyObject_RichCompare(__pyx_t_12, __pyx_t_10, Py_LT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_RichCompare(__pyx_t_12, __pyx_t_10, Py_LT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
if (__pyx_t_14) {
- __pyx_t_11 = PyNumber_Add(__pyx_cur_scope->__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyNumber_Add(__pyx_cur_scope->__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_12 = PyObject_RichCompare(__pyx_t_11, __pyx_t_10, Py_LE); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyObject_RichCompare(__pyx_t_11, __pyx_t_10, Py_LE); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__pyx_t_28 = __pyx_t_27;
} else {
@@ -51837,45 +51251,45 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
if (__pyx_t_14) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1172
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1158
*
* if len(phrase) < self.max_length and i+spanlen < len(fwords) and pathlen+1 <= self.max_initial_size:
* for alt_id in range(len(fwords[i+spanlen])): # <<<<<<<<<<<<<<
* new_frontier.append((k, i+spanlen, input_match, alt_id, pathlen + 1, node, phrase, is_shadow_path))
* num_subpatterns = arity
*/
- __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
- __pyx_t_10 = PyNumber_Add(__pyx_t_12, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyNumber_Add(__pyx_t_12, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_t_12 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fwords, __pyx_t_10); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fwords, __pyx_t_10); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_23 = PyObject_Length(__pyx_t_12); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_23 = PyObject_Length(__pyx_t_12); 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_12); __pyx_t_12 = 0;
for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_23; __pyx_t_21+=1) {
__pyx_cur_scope->__pyx_v_alt_id = __pyx_t_21;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1173
+ /* "/home/mdenkows/cdec/python/cdec/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
* if not is_shadow_path:
*/
- __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
- __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __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 = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_11 = PyNumber_Add(__pyx_t_10, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyNumber_Add(__pyx_t_10, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt_id); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt_id); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __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 = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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 = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
- __pyx_t_18 = PyTuple_New(8); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyTuple_New(8); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_12);
__Pyx_GIVEREF(__pyx_t_12);
@@ -51901,11 +51315,11 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_11 = 0;
__pyx_t_10 = 0;
__pyx_t_16 = 0;
- __pyx_t_13 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_new_frontier, ((PyObject *)__pyx_t_18)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_new_frontier, ((PyObject *)__pyx_t_18)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0;
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1174
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1160
* 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 # <<<<<<<<<<<<<<
@@ -51914,18 +51328,18 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
*/
__pyx_cur_scope->__pyx_v_num_subpatterns = __pyx_cur_scope->__pyx_v_arity;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1175
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1161
* 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_14 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_9 = ((!__pyx_t_14) != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1176
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1162
* num_subpatterns = arity
* if not is_shadow_path:
* num_subpatterns = num_subpatterns + 1 # <<<<<<<<<<<<<<
@@ -51937,14 +51351,14 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
__pyx_L65:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1177
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1163
* 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 = 1177; __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 = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_9 = (((__pyx_t_23 + 1) < __pyx_cur_scope->__pyx_v_self->max_length) != 0);
if (__pyx_t_9) {
__pyx_t_14 = ((__pyx_cur_scope->__pyx_v_arity < __pyx_cur_scope->__pyx_v_self->max_nonterminals) != 0);
@@ -51960,7 +51374,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
if (__pyx_t_14) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1178
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1164
* 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) # <<<<<<<<<<<<<<
@@ -51969,16 +51383,16 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
*/
__pyx_cur_scope->__pyx_v_xcat = __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, (__pyx_cur_scope->__pyx_v_arity + 1));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1179
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1165
* 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_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
- __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_18, __pyx_cur_scope->__pyx_v_xcat, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_16) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_18, __pyx_cur_scope->__pyx_v_xcat, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_16) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_xnode);
@@ -51986,18 +51400,18 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_16);
__pyx_t_16 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1181
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1167
* 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_16 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
- __pyx_t_18 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
- __pyx_t_10 = PyList_New(4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyList_New(4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
PyList_SET_ITEM(__pyx_t_10, 0, __pyx_t_16);
__Pyx_GIVEREF(__pyx_t_16);
@@ -52011,7 +51425,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_pathlen);
__pyx_t_16 = 0;
__pyx_t_18 = 0;
- __pyx_t_18 = ((PyObject *)PyList_AsTuple(((PyObject*)__pyx_t_10))); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = ((PyObject *)PyList_AsTuple(((PyObject*)__pyx_t_10))); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_18));
__Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_key));
@@ -52019,39 +51433,39 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(((PyObject *)__pyx_t_18));
__pyx_t_18 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1182
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1168
* # 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_18 = PyList_New(0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyList_New(0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_frontier_nodes);
__Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_frontier_nodes, ((PyObject *)__pyx_t_18));
__Pyx_GIVEREF(((PyObject *)__pyx_t_18));
__pyx_t_18 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1183
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1169
* 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_14 = (__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_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = (__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_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_9 = (__pyx_t_14 != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1184
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1170
* 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_18 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer), ((PyObject *)__pyx_cur_scope->__pyx_v_key)); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer), ((PyObject *)__pyx_cur_scope->__pyx_v_key)); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_frontier_nodes);
__Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_frontier_nodes, __pyx_t_18);
@@ -52061,20 +51475,20 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1186
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1172
* 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_18 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_129); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_129); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
- __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_16 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1186; __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 = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
- __pyx_t_11 = PyTuple_New(7); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyTuple_New(7); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10);
__Pyx_GIVEREF(__pyx_t_10);
@@ -52097,7 +51511,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_reachable_buffer));
__pyx_t_10 = 0;
__pyx_t_16 = 0;
- __pyx_t_16 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
@@ -52106,18 +51520,18 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_16);
__pyx_t_16 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1187
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1173
* 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 = 1187; __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 = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_L67:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1189
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1175
* nodes_isteps_away_buffer[key] = frontier_nodes
*
* for i, alt, pathlen in frontier_nodes: # <<<<<<<<<<<<<<
@@ -52128,7 +51542,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_16 = __pyx_cur_scope->__pyx_v_frontier_nodes; __Pyx_INCREF(__pyx_t_16); __pyx_t_23 = 0;
__pyx_t_22 = NULL;
} else {
- __pyx_t_23 = -1; __pyx_t_16 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_frontier_nodes); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_23 = -1; __pyx_t_16 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_frontier_nodes); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
__pyx_t_22 = Py_TYPE(__pyx_t_16)->tp_iternext;
}
@@ -52136,23 +51550,23 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
if (!__pyx_t_22 && PyList_CheckExact(__pyx_t_16)) {
if (__pyx_t_23 >= PyList_GET_SIZE(__pyx_t_16)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_11 = PyList_GET_ITEM(__pyx_t_16, __pyx_t_23); __Pyx_INCREF(__pyx_t_11); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyList_GET_ITEM(__pyx_t_16, __pyx_t_23); __Pyx_INCREF(__pyx_t_11); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_11 = PySequence_ITEM(__pyx_t_16, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PySequence_ITEM(__pyx_t_16, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_22 && PyTuple_CheckExact(__pyx_t_16)) {
if (__pyx_t_23 >= PyTuple_GET_SIZE(__pyx_t_16)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_16, __pyx_t_23); __Pyx_INCREF(__pyx_t_11); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_16, __pyx_t_23); __Pyx_INCREF(__pyx_t_11); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_11 = PySequence_ITEM(__pyx_t_16, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PySequence_ITEM(__pyx_t_16, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_11 = __pyx_t_22(__pyx_t_16);
if (unlikely(!__pyx_t_11)) {
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;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -52168,7 +51582,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -52184,18 +51598,18 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_INCREF(__pyx_t_10);
__Pyx_INCREF(__pyx_t_12);
#else
- __pyx_t_18 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
- __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_12 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
#endif
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_3 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_t_20 = Py_TYPE(__pyx_t_3)->tp_iternext;
@@ -52205,7 +51619,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GOTREF(__pyx_t_10);
index = 2; __pyx_t_12 = __pyx_t_20(__pyx_t_3); if (unlikely(!__pyx_t_12)) goto __pyx_L70_unpacking_failed;
__Pyx_GOTREF(__pyx_t_12);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_3), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_3), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_20 = NULL;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L71_unpacking_done;
@@ -52213,12 +51627,12 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_20 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L71_unpacking_done:;
}
- __pyx_t_21 = __Pyx_PyInt_AsInt(__pyx_t_18); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_21 = __Pyx_PyInt_AsInt(__pyx_t_18); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
- __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_cur_scope->__pyx_v_i = __pyx_t_21;
__pyx_cur_scope->__pyx_v_alt = __pyx_t_7;
@@ -52227,40 +51641,40 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_12);
__pyx_t_12 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1190
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1176
*
* for i, alt, pathlen in frontier_nodes:
* new_frontier.append((k, i, input_match + (i,), alt, pathlen, xnode, phrase +(xcat,), is_shadow_path)) # <<<<<<<<<<<<<<
* frontier = new_frontier
*
*/
- __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
- __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __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 = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_10);
__Pyx_GIVEREF(__pyx_t_10);
__pyx_t_10 = 0;
- __pyx_t_10 = PyNumber_Add(__pyx_cur_scope->__pyx_v_input_match, ((PyObject *)__pyx_t_18)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyNumber_Add(__pyx_cur_scope->__pyx_v_input_match, ((PyObject *)__pyx_t_18)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0;
- __pyx_t_18 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
- __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_xcat); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_xcat); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __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 = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_Add(__pyx_cur_scope->__pyx_v_phrase, ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Add(__pyx_cur_scope->__pyx_v_phrase, ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
- __pyx_t_8 = PyTuple_New(8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_New(8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __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);
@@ -52286,7 +51700,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_10 = 0;
__pyx_t_18 = 0;
__pyx_t_3 = 0;
- __pyx_t_13 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_new_frontier, ((PyObject *)__pyx_t_8)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_new_frontier, ((PyObject *)__pyx_t_8)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
}
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
@@ -52300,7 +51714,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1191
+ /* "/home/mdenkows/cdec/python/cdec/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 # <<<<<<<<<<<<<<
@@ -52313,7 +51727,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_new_frontier));
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1194
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1180
*
* # Online rule extraction and scoring
* if self.online: # <<<<<<<<<<<<<<
@@ -52323,55 +51737,55 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_9 = (__pyx_cur_scope->__pyx_v_self->online != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1195
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1181
* # Online rule extraction and scoring
* if self.online:
* stats = self.online_stats[ctx_name] # <<<<<<<<<<<<<<
* f_syms = tuple(word[0][0] for word in fwords)
* for f, lex_i, lex_j in self.get_f_phrases(f_syms):
*/
- __pyx_t_15 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->online_stats, __pyx_cur_scope->__pyx_v_ctx_name); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->online_stats, __pyx_cur_scope->__pyx_v_ctx_name); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_GIVEREF(__pyx_t_15);
__pyx_cur_scope->__pyx_v_stats = __pyx_t_15;
__pyx_t_15 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1196
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1182
* if self.online:
* stats = self.online_stats[ctx_name]
* f_syms = tuple(word[0][0] for word in fwords) # <<<<<<<<<<<<<<
* for f, lex_i, lex_j in self.get_f_phrases(f_syms):
* spanlen = (lex_j - lex_i) + 1
*/
- __pyx_t_15 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_2genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_5input_2genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1196; __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 = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15);
__Pyx_GIVEREF(__pyx_t_15);
__pyx_t_15 = 0;
- __pyx_t_15 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0;
__Pyx_GIVEREF(__pyx_t_15);
__pyx_cur_scope->__pyx_v_f_syms = ((PyObject*)__pyx_t_15);
__pyx_t_15 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1197
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1183
* stats = self.online_stats[ctx_name]
* f_syms = tuple(word[0][0] for word in fwords)
* for f, lex_i, lex_j in self.get_f_phrases(f_syms): # <<<<<<<<<<<<<<
* spanlen = (lex_j - lex_i) + 1
* if not sym_isvar(f[0]):
*/
- __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__get_f_phrases); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__get_f_phrases); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __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 = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_f_syms));
PyTuple_SET_ITEM(__pyx_t_16, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_f_syms));
__Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_f_syms));
- __pyx_t_8 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __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_16)); __pyx_t_16 = 0;
@@ -52379,7 +51793,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_16 = __pyx_t_8; __Pyx_INCREF(__pyx_t_16); __pyx_t_2 = 0;
__pyx_t_22 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_16 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_16 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
__pyx_t_22 = Py_TYPE(__pyx_t_16)->tp_iternext;
}
@@ -52388,23 +51802,23 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
if (!__pyx_t_22 && PyList_CheckExact(__pyx_t_16)) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_16)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_8 = PyList_GET_ITEM(__pyx_t_16, __pyx_t_2); __Pyx_INCREF(__pyx_t_8); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyList_GET_ITEM(__pyx_t_16, __pyx_t_2); __Pyx_INCREF(__pyx_t_8); __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_8 = PySequence_ITEM(__pyx_t_16, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PySequence_ITEM(__pyx_t_16, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_22 && PyTuple_CheckExact(__pyx_t_16)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_16)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_16, __pyx_t_2); __Pyx_INCREF(__pyx_t_8); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_16, __pyx_t_2); __Pyx_INCREF(__pyx_t_8); __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_8 = PySequence_ITEM(__pyx_t_16, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PySequence_ITEM(__pyx_t_16, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_8 = __pyx_t_22(__pyx_t_16);
if (unlikely(!__pyx_t_8)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -52420,7 +51834,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__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))) {
@@ -52436,18 +51850,18 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_18);
#else
- __pyx_t_15 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __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 = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_18 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
#endif
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_10 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_20 = Py_TYPE(__pyx_t_10)->tp_iternext;
@@ -52457,7 +51871,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GOTREF(__pyx_t_3);
index = 2; __pyx_t_18 = __pyx_t_20(__pyx_t_10); if (unlikely(!__pyx_t_18)) goto __pyx_L75_unpacking_failed;
__Pyx_GOTREF(__pyx_t_18);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_10), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_10), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_20 = NULL;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
goto __pyx_L76_unpacking_done;
@@ -52465,7 +51879,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_20 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__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);
@@ -52481,16 +51895,16 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_18);
__pyx_t_18 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1198
+ /* "/home/mdenkows/cdec/python/cdec/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_8 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_lex_j, __pyx_cur_scope->__pyx_v_lex_i); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_lex_j, __pyx_cur_scope->__pyx_v_lex_i); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_18 = PyNumber_Add(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyNumber_Add(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_spanlen);
@@ -52498,28 +51912,28 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_18);
__pyx_t_18 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1199
+ /* "/home/mdenkows/cdec/python/cdec/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_18 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_f, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_f, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
- __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_18); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_18); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
__pyx_t_9 = ((!(__pyx_f_4cdec_2sa_3_sa_sym_isvar(__pyx_t_7) != 0)) != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1200
+ /* "/home/mdenkows/cdec/python/cdec/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_18 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_spanlen, __pyx_int_1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_spanlen, __pyx_int_1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_spanlen);
__Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_spanlen, __pyx_t_18);
@@ -52529,28 +51943,28 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
__pyx_L77:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1201
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1187
* if not sym_isvar(f[0]):
* spanlen += 1
* if not sym_isvar(f[1]): # <<<<<<<<<<<<<<
* spanlen += 1
* for e in stats.phrases_fe.get(f, ()):
*/
- __pyx_t_18 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_f, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_f, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_18) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
- __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_18); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_18); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
__pyx_t_9 = ((!(__pyx_f_4cdec_2sa_3_sa_sym_isvar(__pyx_t_7) != 0)) != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1202
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1188
* spanlen += 1
* if not sym_isvar(f[1]):
* spanlen += 1 # <<<<<<<<<<<<<<
* for e in stats.phrases_fe.get(f, ()):
* if (f, e) not in seen_phrases:
*/
- __pyx_t_18 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_spanlen, __pyx_int_1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_spanlen, __pyx_int_1); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_spanlen);
__Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_spanlen, __pyx_t_18);
@@ -52560,19 +51974,19 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
__pyx_L78:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1203
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1189
* if not sym_isvar(f[1]):
* spanlen += 1
* for e in stats.phrases_fe.get(f, ()): # <<<<<<<<<<<<<<
* if (f, e) not in seen_phrases:
* # Don't add multiple instances of the same phrase here
*/
- __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_stats, __pyx_n_s__phrases_fe); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_stats, __pyx_n_s__phrases_fe); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s__get); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s__get); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
- __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_cur_scope->__pyx_v_f);
@@ -52580,7 +51994,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_INCREF(((PyObject *)__pyx_empty_tuple));
PyTuple_SET_ITEM(__pyx_t_18, 1, ((PyObject *)__pyx_empty_tuple));
__Pyx_GIVEREF(((PyObject *)__pyx_empty_tuple));
- __pyx_t_3 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __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_18)); __pyx_t_18 = 0;
@@ -52588,7 +52002,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_18 = __pyx_t_3; __Pyx_INCREF(__pyx_t_18); __pyx_t_23 = 0;
__pyx_t_29 = NULL;
} else {
- __pyx_t_23 = -1; __pyx_t_18 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_23 = -1; __pyx_t_18 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__pyx_t_29 = Py_TYPE(__pyx_t_18)->tp_iternext;
}
@@ -52597,23 +52011,23 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
if (!__pyx_t_29 && PyList_CheckExact(__pyx_t_18)) {
if (__pyx_t_23 >= PyList_GET_SIZE(__pyx_t_18)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyList_GET_ITEM(__pyx_t_18, __pyx_t_23); __Pyx_INCREF(__pyx_t_3); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_GET_ITEM(__pyx_t_18, __pyx_t_23); __Pyx_INCREF(__pyx_t_3); __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_3 = PySequence_ITEM(__pyx_t_18, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_18, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_3)) {__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_18)) {
if (__pyx_t_23 >= PyTuple_GET_SIZE(__pyx_t_18)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_18, __pyx_t_23); __Pyx_INCREF(__pyx_t_3); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_18, __pyx_t_23); __Pyx_INCREF(__pyx_t_3); __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_3 = PySequence_ITEM(__pyx_t_18, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_18, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_3 = __pyx_t_29(__pyx_t_18);
if (unlikely(!__pyx_t_3)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -52624,14 +52038,14 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1204
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1190
* spanlen += 1
* for e in stats.phrases_fe.get(f, ()):
* if (f, e) not in seen_phrases: # <<<<<<<<<<<<<<
* # Don't add multiple instances of the same phrase here
* seen_phrases.add((f, e))
*/
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1204; __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 = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_f);
@@ -52639,19 +52053,19 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_e);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_cur_scope->__pyx_v_e);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e);
- __pyx_t_9 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_t_3), ((PyObject *)__pyx_cur_scope->__pyx_v_seen_phrases), Py_NE)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_t_3), ((PyObject *)__pyx_cur_scope->__pyx_v_seen_phrases), Py_NE)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__pyx_t_14 = (__pyx_t_9 != 0);
if (__pyx_t_14) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1206
+ /* "/home/mdenkows/cdec/python/cdec/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_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1206; __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 = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_f);
@@ -52659,29 +52073,29 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_e);
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_cur_scope->__pyx_v_e);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e);
- __pyx_t_13 = PySet_Add(__pyx_cur_scope->__pyx_v_seen_phrases, ((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PySet_Add(__pyx_cur_scope->__pyx_v_seen_phrases, ((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1207
+ /* "/home/mdenkows/cdec/python/cdec/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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__FeatureContext); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__FeatureContext); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1212
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1198
* fwords, self.fda, self.eda,
* meta,
* self.online_ctx_lookup(f, e, ctx_name))) # <<<<<<<<<<<<<<
* alignment = stats.phrases_al[f][e]
* yield Rule(self.category, f, e, scores, alignment)
*/
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__online_ctx_lookup); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__online_ctx_lookup); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1212; __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 = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_cur_scope->__pyx_v_f);
@@ -52692,11 +52106,11 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_ctx_name);
PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_cur_scope->__pyx_v_ctx_name);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ctx_name);
- __pyx_t_10 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
- __pyx_t_15 = PyTuple_New(13); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(13); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_cur_scope->__pyx_v_f);
@@ -52737,11 +52151,11 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
PyTuple_SET_ITEM(__pyx_t_15, 12, __pyx_t_10);
__Pyx_GIVEREF(__pyx_t_10);
__pyx_t_10 = 0;
- __pyx_t_10 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
- __pyx_t_15 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Scorer *)__pyx_cur_scope->__pyx_v_self->scorer->__pyx_vtab)->score(__pyx_cur_scope->__pyx_v_self->scorer, __pyx_t_10)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Scorer *)__pyx_cur_scope->__pyx_v_self->scorer->__pyx_vtab)->score(__pyx_cur_scope->__pyx_v_self->scorer, __pyx_t_10)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_scores));
@@ -52749,19 +52163,19 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_15);
__pyx_t_15 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1213
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1199
* meta,
* self.online_ctx_lookup(f, e, ctx_name)))
* alignment = stats.phrases_al[f][e] # <<<<<<<<<<<<<<
* yield Rule(self.category, f, e, scores, alignment)
*
*/
- __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_stats, __pyx_n_s__phrases_al); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_stats, __pyx_n_s__phrases_al); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_10 = PyObject_GetItem(__pyx_t_15, __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_GetItem(__pyx_t_15, __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_15 = PyObject_GetItem(__pyx_t_10, __pyx_cur_scope->__pyx_v_e); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_GetItem(__pyx_t_10, __pyx_cur_scope->__pyx_v_e); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_alignment);
@@ -52769,16 +52183,16 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__Pyx_GIVEREF(__pyx_t_15);
__pyx_t_15 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1214
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1200
* self.online_ctx_lookup(f, e, ctx_name)))
* alignment = stats.phrases_al[f][e]
* yield Rule(self.category, f, e, scores, alignment) # <<<<<<<<<<<<<<
*
* stop_time = monitor_cpu()
*/
- __pyx_t_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->category); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->category); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_10 = PyTuple_New(5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_New(5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_15);
__Pyx_GIVEREF(__pyx_t_15);
@@ -52795,7 +52209,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_cur_scope->__pyx_v_alignment);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_alignment);
__pyx_t_15 = 0;
- __pyx_t_15 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Rule)), ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Rule)), ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
__pyx_r = __pyx_t_15;
@@ -52824,7 +52238,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
__pyx_t_22 = __pyx_cur_scope->__pyx_t_10;
__pyx_t_23 = __pyx_cur_scope->__pyx_t_1;
__pyx_t_29 = __pyx_cur_scope->__pyx_t_11;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ 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:;
@@ -52836,40 +52250,40 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
}
__pyx_L72:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1216
+ /* "/home/mdenkows/cdec/python/cdec/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_16 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = __Pyx_GetModuleGlobalName(__pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
- __pyx_t_18 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
__Pyx_GIVEREF(__pyx_t_18);
__pyx_cur_scope->__pyx_v_stop_time = __pyx_t_18;
__pyx_t_18 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1217
+ /* "/home/mdenkows/cdec/python/cdec/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_18 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
- __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s__info); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s__info); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
- __pyx_t_18 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_start_time); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_start_time); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
- __pyx_t_15 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_stop_time, __pyx_t_18); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_stop_time, __pyx_t_18); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
- __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_130));
PyTuple_SET_ITEM(__pyx_t_18, 0, ((PyObject *)__pyx_kp_s_130));
@@ -52877,44 +52291,44 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_15);
__Pyx_GIVEREF(__pyx_t_15);
__pyx_t_15 = 0;
- __pyx_t_15 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0;
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1218
+ /* "/home/mdenkows/cdec/python/cdec/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)
* logger.info(" Intersect time = %f seconds", self.intersect_time)
*/
- __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s__gc); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s__gc); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s__collect); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s__collect); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_15 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1219
+ /* "/home/mdenkows/cdec/python/cdec/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) # <<<<<<<<<<<<<<
* logger.info(" Intersect time = %f seconds", self.intersect_time)
*
*/
- __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s__info); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s__info); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__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 = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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 = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_131));
PyTuple_SET_ITEM(__pyx_t_16, 0, ((PyObject *)__pyx_kp_s_131));
@@ -52922,27 +52336,27 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_15);
__Pyx_GIVEREF(__pyx_t_15);
__pyx_t_15 = 0;
- __pyx_t_15 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_Call(__pyx_t_18, ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0;
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1220
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1206
* gc.collect()
* logger.info(" Extract time = %f seconds", self.extract_time)
* logger.info(" Intersect time = %f seconds", self.intersect_time) # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s__logger); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s__info); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s__info); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_15 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->intersect_time); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->intersect_time); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_18);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_132));
PyTuple_SET_ITEM(__pyx_t_18, 0, ((PyObject *)__pyx_kp_s_132));
@@ -52950,7 +52364,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_15);
__Pyx_GIVEREF(__pyx_t_15);
__pyx_t_15 = 0;
- __pyx_t_15 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_t_18), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_18)); __pyx_t_18 = 0;
@@ -52978,7 +52392,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_24generator4(
return NULL;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1223
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1209
*
*
* cdef int find_fixpoint(self, # <<<<<<<<<<<<<<
@@ -53008,7 +52422,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("find_fixpoint", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1238
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1224
* 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 # <<<<<<<<<<<<<<
@@ -53017,7 +52431,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
*/
(__pyx_v_e_low[0]) = __pyx_v_e_in_low;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1239
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1225
*
* e_low[0] = e_in_low
* e_high[0] = e_in_high # <<<<<<<<<<<<<<
@@ -53026,19 +52440,19 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
*/
(__pyx_v_e_high[0]) = __pyx_v_e_in_high;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1240
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1226
* 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 = 1240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1240; __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 = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1241
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1227
* 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: # <<<<<<<<<<<<<<
@@ -53048,7 +52462,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_3 = (((__pyx_v_e_low[0]) == -1) != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1247
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1233
* # rule X -> X_1 w X_2 / X_1 X_2. This is probably
* # not worth the bother, though.
* return 0 # <<<<<<<<<<<<<<
@@ -53060,7 +52474,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
goto __pyx_L3;
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1248
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1234
* # not worth the bother, though.
* return 0
* elif e_in_low != -1 and e_low[0] != e_in_low: # <<<<<<<<<<<<<<
@@ -53076,7 +52490,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
if (__pyx_t_5) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1249
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1235
* return 0
* elif e_in_low != -1 and e_low[0] != e_in_low:
* if e_in_low - e_low[0] < min_ex_size: # <<<<<<<<<<<<<<
@@ -53086,7 +52500,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_5 = (((__pyx_v_e_in_low - (__pyx_v_e_low[0])) < __pyx_v_min_ex_size) != 0);
if (__pyx_t_5) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1250
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1236
* 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 # <<<<<<<<<<<<<<
@@ -53095,7 +52509,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
*/
(__pyx_v_e_low[0]) = (__pyx_v_e_in_low - __pyx_v_min_ex_size);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1251
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1237
* if e_in_low - e_low[0] < min_ex_size:
* e_low[0] = e_in_low - min_ex_size
* if e_low[0] < 0: # <<<<<<<<<<<<<<
@@ -53105,7 +52519,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_5 = (((__pyx_v_e_low[0]) < 0) != 0);
if (__pyx_t_5) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1252
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1238
* e_low[0] = e_in_low - min_ex_size
* if e_low[0] < 0:
* return 0 # <<<<<<<<<<<<<<
@@ -53124,7 +52538,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
__pyx_L3:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1254
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1240
* return 0
*
* if e_high[0] - e_low[0] > max_e_len: # <<<<<<<<<<<<<<
@@ -53134,7 +52548,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_5 = ((((__pyx_v_e_high[0]) - (__pyx_v_e_low[0])) > __pyx_v_max_e_len) != 0);
if (__pyx_t_5) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1255
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1241
*
* if e_high[0] - e_low[0] > max_e_len:
* return 0 # <<<<<<<<<<<<<<
@@ -53146,7 +52560,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
goto __pyx_L6;
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1256
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1242
* if e_high[0] - e_low[0] > max_e_len:
* return 0
* elif e_in_high != -1 and e_high[0] != e_in_high: # <<<<<<<<<<<<<<
@@ -53162,7 +52576,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
if (__pyx_t_4) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1257
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1243
* return 0
* elif e_in_high != -1 and e_high[0] != e_in_high:
* if e_high[0] - e_in_high < min_ex_size: # <<<<<<<<<<<<<<
@@ -53172,7 +52586,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_4 = ((((__pyx_v_e_high[0]) - __pyx_v_e_in_high) < __pyx_v_min_ex_size) != 0);
if (__pyx_t_4) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1258
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1244
* 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 # <<<<<<<<<<<<<<
@@ -53181,7 +52595,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
*/
(__pyx_v_e_high[0]) = (__pyx_v_e_in_high + __pyx_v_min_ex_size);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1259
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1245
* 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: # <<<<<<<<<<<<<<
@@ -53191,7 +52605,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_4 = (((__pyx_v_e_high[0]) > __pyx_v_e_sent_len) != 0);
if (__pyx_t_4) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1260
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1246
* e_high[0] = e_in_high + min_ex_size
* if e_high[0] > e_sent_len:
* return 0 # <<<<<<<<<<<<<<
@@ -53210,7 +52624,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
__pyx_L6:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1262
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1248
* return 0
*
* f_back_low[0] = -1 # <<<<<<<<<<<<<<
@@ -53219,7 +52633,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
*/
(__pyx_v_f_back_low[0]) = -1;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1263
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1249
*
* f_back_low[0] = -1
* f_back_high[0] = -1 # <<<<<<<<<<<<<<
@@ -53228,7 +52642,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
*/
(__pyx_v_f_back_high[0]) = -1;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1264
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1250
* f_back_low[0] = -1
* f_back_high[0] = -1
* f_low_prev = f_low # <<<<<<<<<<<<<<
@@ -53237,17 +52651,17 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
*/
__pyx_v_f_low_prev = __pyx_v_f_low;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1265
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1251
* 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 = 1265; __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 = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_f_high_prev = __pyx_t_1;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1266
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1252
* f_low_prev = f_low
* f_high_prev = f_high
* new_x = 0 # <<<<<<<<<<<<<<
@@ -53256,7 +52670,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
*/
__pyx_v_new_x = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1267
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1253
* f_high_prev = f_high
* new_x = 0
* new_low_x = 0 # <<<<<<<<<<<<<<
@@ -53265,7 +52679,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
*/
__pyx_v_new_low_x = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1268
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1254
* new_x = 0
* new_low_x = 0
* new_high_x = 0 # <<<<<<<<<<<<<<
@@ -53274,7 +52688,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
*/
__pyx_v_new_high_x = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1270
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1256
* new_high_x = 0
*
* while True: # <<<<<<<<<<<<<<
@@ -53284,7 +52698,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
while (1) {
if (!1) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1272
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1258
* while True:
*
* if f_back_low[0] == -1: # <<<<<<<<<<<<<<
@@ -53294,45 +52708,45 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_4 = (((__pyx_v_f_back_low[0]) == -1) != 0);
if (__pyx_t_4) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1273
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1259
*
* 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_4cdec_2sa_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 = 1273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1259; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1275
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1261
* 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_4cdec_2sa_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 = 1275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1276
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1262
* 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_4cdec_2sa_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 = 1276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
__pyx_L11:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1278
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1264
* 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: # <<<<<<<<<<<<<<
@@ -53342,7 +52756,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_4 = (((__pyx_v_f_back_low[0]) > __pyx_v_f_low) != 0);
if (__pyx_t_4) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1279
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1265
*
* if f_back_low[0] > f_low:
* f_back_low[0] = f_low # <<<<<<<<<<<<<<
@@ -53354,35 +52768,35 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
__pyx_L12:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1281
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1267
* 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 = 1281; __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 = 1267; __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 = 1281; __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 = 1267; __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 = 1281; __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 = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_4) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1282
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1268
*
* 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 = 1282; __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 = 1268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
(__pyx_v_f_back_high[0]) = __pyx_t_1;
goto __pyx_L13;
}
__pyx_L13:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1284
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1270
* f_back_high[0] = f_high
*
* if f_back_low[0] == f_low_prev and f_back_high[0] == f_high_prev: # <<<<<<<<<<<<<<
@@ -53398,7 +52812,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1285
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1271
*
* if f_back_low[0] == f_low_prev and f_back_high[0] == f_high_prev:
* return 1 # <<<<<<<<<<<<<<
@@ -53411,7 +52825,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
__pyx_L14:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1287
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1273
* return 1
*
* if allow_low_x == 0 and f_back_low[0] < f_low: # <<<<<<<<<<<<<<
@@ -53427,7 +52841,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
if (__pyx_t_5) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1289
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1275
* if allow_low_x == 0 and f_back_low[0] < f_low:
* # FAIL: f phrase is not tight
* return 0 # <<<<<<<<<<<<<<
@@ -53440,7 +52854,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
__pyx_L15:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1291
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1277
* return 0
*
* if f_back_high[0] - f_back_low[0] > max_f_len: # <<<<<<<<<<<<<<
@@ -53450,7 +52864,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_5 = ((((__pyx_v_f_back_high[0]) - (__pyx_v_f_back_low[0])) > __pyx_v_max_f_len) != 0);
if (__pyx_t_5) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1293
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1279
* if f_back_high[0] - f_back_low[0] > max_f_len:
* # FAIL: f back projection is too wide
* return 0 # <<<<<<<<<<<<<<
@@ -53463,7 +52877,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
__pyx_L16:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1295
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1281
* return 0
*
* if allow_high_x == 0 and f_back_high[0] > f_high: # <<<<<<<<<<<<<<
@@ -53472,11 +52886,11 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
*/
__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 = 1295; __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 = 1281; __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 = 1295; __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 = 1281; __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 = 1295; __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 = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_4 = __pyx_t_3;
} else {
@@ -53484,7 +52898,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
if (__pyx_t_4) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1297
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1283
* if allow_high_x == 0 and f_back_high[0] > f_high:
* # FAIL: extension on high side not allowed
* return 0 # <<<<<<<<<<<<<<
@@ -53497,7 +52911,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
__pyx_L17:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1299
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1285
* return 0
*
* if f_low != f_back_low[0]: # <<<<<<<<<<<<<<
@@ -53507,7 +52921,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_4 = ((__pyx_v_f_low != (__pyx_v_f_back_low[0])) != 0);
if (__pyx_t_4) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1300
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1286
*
* if f_low != f_back_low[0]:
* if new_low_x == 0: # <<<<<<<<<<<<<<
@@ -53517,7 +52931,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_4 = ((__pyx_v_new_low_x == 0) != 0);
if (__pyx_t_4) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1301
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1287
* if f_low != f_back_low[0]:
* if new_low_x == 0:
* if new_x >= max_new_x: # <<<<<<<<<<<<<<
@@ -53527,7 +52941,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_4 = ((__pyx_v_new_x >= __pyx_v_max_new_x) != 0);
if (__pyx_t_4) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1303
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1289
* if new_x >= max_new_x:
* # FAIL: extension required on low side violates max # of gaps
* return 0 # <<<<<<<<<<<<<<
@@ -53540,7 +52954,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1305
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1291
* return 0
* else:
* new_x = new_x + 1 # <<<<<<<<<<<<<<
@@ -53549,7 +52963,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
*/
__pyx_v_new_x = (__pyx_v_new_x + 1);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1306
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1292
* else:
* new_x = new_x + 1
* new_low_x = 1 # <<<<<<<<<<<<<<
@@ -53563,7 +52977,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
__pyx_L19:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1307
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1293
* new_x = new_x + 1
* new_low_x = 1
* if f_low - f_back_low[0] < min_fx_size: # <<<<<<<<<<<<<<
@@ -53573,7 +52987,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_4 = (((__pyx_v_f_low - (__pyx_v_f_back_low[0])) < __pyx_v_min_fx_size) != 0);
if (__pyx_t_4) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1308
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1294
* new_low_x = 1
* if f_low - f_back_low[0] < min_fx_size:
* f_back_low[0] = f_low - min_fx_size # <<<<<<<<<<<<<<
@@ -53582,7 +52996,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
*/
(__pyx_v_f_back_low[0]) = (__pyx_v_f_low - __pyx_v_min_fx_size);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1309
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1295
* 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: # <<<<<<<<<<<<<<
@@ -53592,7 +53006,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_4 = ((((__pyx_v_f_back_high[0]) - (__pyx_v_f_back_low[0])) > __pyx_v_max_f_len) != 0);
if (__pyx_t_4) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1311
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1297
* if f_back_high[0] - f_back_low[0] > max_f_len:
* # FAIL: extension required on low side violates max initial length
* return 0 # <<<<<<<<<<<<<<
@@ -53605,7 +53019,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
__pyx_L22:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1312
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1298
* # FAIL: extension required on low side violates max initial length
* return 0
* if f_back_low[0] < 0: # <<<<<<<<<<<<<<
@@ -53615,7 +53029,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_4 = (((__pyx_v_f_back_low[0]) < 0) != 0);
if (__pyx_t_4) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1314
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1300
* if f_back_low[0] < 0:
* # FAIL: extension required on low side violates sentence boundary
* return 0 # <<<<<<<<<<<<<<
@@ -53634,22 +53048,22 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
__pyx_L18:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1316
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1302
* 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 = 1316; __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 = 1302; __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 = 1316; __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 = 1302; __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 = 1316; __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 = 1302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_4) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1317
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1303
*
* if f_high != f_back_high[0]:
* if new_high_x == 0: # <<<<<<<<<<<<<<
@@ -53659,7 +53073,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_4 = ((__pyx_v_new_high_x == 0) != 0);
if (__pyx_t_4) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1318
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1304
* if f_high != f_back_high[0]:
* if new_high_x == 0:
* if new_x >= max_new_x: # <<<<<<<<<<<<<<
@@ -53669,7 +53083,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_4 = ((__pyx_v_new_x >= __pyx_v_max_new_x) != 0);
if (__pyx_t_4) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1320
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1306
* if new_x >= max_new_x:
* # FAIL: extension required on high side violates max # of gaps
* return 0 # <<<<<<<<<<<<<<
@@ -53682,7 +53096,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1322
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1308
* return 0
* else:
* new_x = new_x + 1 # <<<<<<<<<<<<<<
@@ -53691,7 +53105,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
*/
__pyx_v_new_x = (__pyx_v_new_x + 1);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1323
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1309
* else:
* new_x = new_x + 1
* new_high_x = 1 # <<<<<<<<<<<<<<
@@ -53705,44 +53119,44 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
__pyx_L25:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1324
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1310
* 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 = 1324; __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 = 1310; __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 = 1324; __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 = 1310; __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 = 1324; __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 = 1310; __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 = 1324; __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 = 1310; __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 = 1324; __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 = 1310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (__pyx_t_4) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1325
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1311
* 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 = 1325; __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 = 1311; __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 = 1325; __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 = 1311; __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 = 1325; __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 = 1311; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1326
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1312
* 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: # <<<<<<<<<<<<<<
@@ -53752,7 +53166,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_4 = ((((__pyx_v_f_back_high[0]) - (__pyx_v_f_back_low[0])) > __pyx_v_max_f_len) != 0);
if (__pyx_t_4) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1328
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1314
* if f_back_high[0] - f_back_low[0] > max_f_len:
* # FAIL: extension required on high side violates max initial length
* return 0 # <<<<<<<<<<<<<<
@@ -53765,7 +53179,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
__pyx_L28:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1329
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1315
* # FAIL: extension required on high side violates max initial length
* return 0
* if f_back_high[0] > f_sent_len: # <<<<<<<<<<<<<<
@@ -53775,7 +53189,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_4 = (((__pyx_v_f_back_high[0]) > __pyx_v_f_sent_len) != 0);
if (__pyx_t_4) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1331
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1317
* if f_back_high[0] > f_sent_len:
* # FAIL: extension required on high side violates sentence boundary
* return 0 # <<<<<<<<<<<<<<
@@ -53794,7 +53208,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
__pyx_L24:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1333
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1319
* return 0
*
* e_low_prev = e_low[0] # <<<<<<<<<<<<<<
@@ -53803,7 +53217,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
*/
__pyx_v_e_low_prev = (__pyx_v_e_low[0]);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1334
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1320
*
* e_low_prev = e_low[0]
* e_high_prev = e_high[0] # <<<<<<<<<<<<<<
@@ -53812,29 +53226,29 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
*/
__pyx_v_e_high_prev = (__pyx_v_e_high[0]);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1336
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1322
* 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_4cdec_2sa_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 = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1337
+ /* "/home/mdenkows/cdec/python/cdec/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:
* return 1
*/
- __pyx_t_6 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1338
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1324
* 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: # <<<<<<<<<<<<<<
@@ -53850,7 +53264,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1339
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1325
* 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 # <<<<<<<<<<<<<<
@@ -53863,7 +53277,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
__pyx_L30:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1340
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1326
* if e_low[0] == e_low_prev and e_high[0] == e_high_prev:
* return 1
* if allow_arbitrary_x == 0: # <<<<<<<<<<<<<<
@@ -53873,7 +53287,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_3 = ((__pyx_v_allow_arbitrary_x == 0) != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1342
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1328
* if allow_arbitrary_x == 0:
* # FAIL: arbitrary expansion not permitted
* return 0 # <<<<<<<<<<<<<<
@@ -53886,7 +53300,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
__pyx_L31:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1343
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1329
* # FAIL: arbitrary expansion not permitted
* return 0
* if e_high[0] - e_low[0] > max_e_len: # <<<<<<<<<<<<<<
@@ -53896,7 +53310,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
__pyx_t_3 = ((((__pyx_v_e_high[0]) - (__pyx_v_e_low[0])) > __pyx_v_max_e_len) != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1345
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1331
* if e_high[0] - e_low[0] > max_e_len:
* # FAIL: re-projection violates sentence max phrase length
* return 0 # <<<<<<<<<<<<<<
@@ -53909,7 +53323,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
}
__pyx_L32:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1346
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1332
* # FAIL: re-projection violates sentence max phrase length
* return 0
* f_low_prev = f_back_low[0] # <<<<<<<<<<<<<<
@@ -53918,7 +53332,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
*/
__pyx_v_f_low_prev = (__pyx_v_f_back_low[0]);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1347
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1333
* return 0
* f_low_prev = f_back_low[0]
* f_high_prev = f_back_high[0] # <<<<<<<<<<<<<<
@@ -53941,7 +53355,7 @@ static int __pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1350
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1336
*
*
* cdef find_projection(self, int in_low, int in_high, int* in_links_low, int* in_links_high, # <<<<<<<<<<<<<<
@@ -53959,7 +53373,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_projectio
int __pyx_t_4;
__Pyx_RefNannySetupContext("find_projection", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1353
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1339
* int* out_low, int* out_high):
* cdef int i
* for i from in_low <= i < in_high: # <<<<<<<<<<<<<<
@@ -53969,7 +53383,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_projectio
__pyx_t_1 = __pyx_v_in_high;
for (__pyx_v_i = __pyx_v_in_low; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1354
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1340
* cdef int i
* for i from in_low <= i < in_high:
* if in_links_low[i] != -1: # <<<<<<<<<<<<<<
@@ -53979,7 +53393,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_projectio
__pyx_t_2 = (((__pyx_v_in_links_low[__pyx_v_i]) != -1) != 0);
if (__pyx_t_2) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1355
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1341
* 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]: # <<<<<<<<<<<<<<
@@ -53995,7 +53409,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_projectio
}
if (__pyx_t_4) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1356
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1342
* 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] # <<<<<<<<<<<<<<
@@ -54007,7 +53421,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_projectio
}
__pyx_L6:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1357
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1343
* 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]: # <<<<<<<<<<<<<<
@@ -54023,7 +53437,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_projectio
}
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1358
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1344
* 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] # <<<<<<<<<<<<<<
@@ -54045,7 +53459,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_find_projectio
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1361
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1347
*
*
* cdef int* int_arr_extend(self, int* arr, int* arr_len, int* data, int data_len): # <<<<<<<<<<<<<<
@@ -54059,7 +53473,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTH
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("int_arr_extend", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1363
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1349
* 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 # <<<<<<<<<<<<<<
@@ -54068,7 +53482,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTH
*/
__pyx_v_new_len = ((__pyx_v_arr_len[0]) + __pyx_v_data_len);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1364
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1350
* cdef int new_len
* new_len = arr_len[0] + data_len
* arr = <int*> realloc(arr, new_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -54077,7 +53491,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTH
*/
__pyx_v_arr = ((int *)realloc(__pyx_v_arr, (__pyx_v_new_len * (sizeof(int)))));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1365
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1351
* 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)) # <<<<<<<<<<<<<<
@@ -54086,7 +53500,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTH
*/
memcpy((__pyx_v_arr + (__pyx_v_arr_len[0])), __pyx_v_data, (__pyx_v_data_len * (sizeof(int))));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1366
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1352
* arr = <int*> realloc(arr, new_len*sizeof(int))
* memcpy(arr+arr_len[0], data, data_len*sizeof(int))
* arr_len[0] = new_len # <<<<<<<<<<<<<<
@@ -54095,7 +53509,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTH
*/
(__pyx_v_arr_len[0]) = __pyx_v_new_len;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1367
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1353
* memcpy(arr+arr_len[0], data, data_len*sizeof(int))
* arr_len[0] = new_len
* return arr # <<<<<<<<<<<<<<
@@ -54111,7 +53525,7 @@ static int *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTH
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1370
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1356
*
*
* 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, # <<<<<<<<<<<<<<
@@ -54156,19 +53570,19 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("extract_phrases", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1378
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1364
* 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 = 1378; __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 = 1364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_result = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1379
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1365
*
* result = []
* len1 = 0 # <<<<<<<<<<<<<<
@@ -54177,7 +53591,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_len1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1380
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1366
* result = []
* len1 = 0
* e_gaps1 = <int*> malloc(0) # <<<<<<<<<<<<<<
@@ -54186,19 +53600,19 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_e_gaps1 = ((int *)malloc(0));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1381
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1367
* 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_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ephr_arr = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1383
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1369
* ephr_arr = IntList()
*
* e_gap_order = <int*> malloc(num_gaps*sizeof(int)) # <<<<<<<<<<<<<<
@@ -54207,7 +53621,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_e_gap_order = ((int *)malloc((__pyx_v_num_gaps * (sizeof(int)))));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1384
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1370
*
* e_gap_order = <int*> malloc(num_gaps*sizeof(int))
* if num_gaps > 0: # <<<<<<<<<<<<<<
@@ -54217,7 +53631,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_2 = ((__pyx_v_num_gaps > 0) != 0);
if (__pyx_t_2) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1385
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1371
* e_gap_order = <int*> malloc(num_gaps*sizeof(int))
* if num_gaps > 0:
* e_gap_order[0] = 0 # <<<<<<<<<<<<<<
@@ -54226,7 +53640,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
(__pyx_v_e_gap_order[0]) = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1386
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1372
* if num_gaps > 0:
* e_gap_order[0] = 0
* for i from 1 <= i < num_gaps: # <<<<<<<<<<<<<<
@@ -54236,7 +53650,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_3 = __pyx_v_num_gaps;
for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1387
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1373
* e_gap_order[0] = 0
* for i from 1 <= i < num_gaps:
* for j from 0 <= j < i: # <<<<<<<<<<<<<<
@@ -54246,7 +53660,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_4 = __pyx_v_i;
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_4; __pyx_v_j++) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1388
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1374
* for i from 1 <= i < num_gaps:
* for j from 0 <= j < i:
* if e_gap_low[i] < e_gap_low[j]: # <<<<<<<<<<<<<<
@@ -54256,7 +53670,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_2 = (((__pyx_v_e_gap_low[__pyx_v_i]) < (__pyx_v_e_gap_low[__pyx_v_j])) != 0);
if (__pyx_t_2) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1389
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1375
* for j from 0 <= j < i:
* if e_gap_low[i] < e_gap_low[j]:
* for k from j <= k < i: # <<<<<<<<<<<<<<
@@ -54266,7 +53680,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_5 = __pyx_v_i;
for (__pyx_v_k = __pyx_v_j; __pyx_v_k < __pyx_t_5; __pyx_v_k++) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1390
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1376
* if e_gap_low[i] < e_gap_low[j]:
* for k from j <= k < i:
* e_gap_order[k+1] = e_gap_order[k] # <<<<<<<<<<<<<<
@@ -54276,7 +53690,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
(__pyx_v_e_gap_order[(__pyx_v_k + 1)]) = (__pyx_v_e_gap_order[__pyx_v_k]);
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1391
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1377
* for k from j <= k < i:
* e_gap_order[k+1] = e_gap_order[k]
* e_gap_order[j] = i # <<<<<<<<<<<<<<
@@ -54285,7 +53699,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
(__pyx_v_e_gap_order[__pyx_v_j]) = __pyx_v_i;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1392
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1378
* e_gap_order[k+1] = e_gap_order[k]
* e_gap_order[j] = i
* break # <<<<<<<<<<<<<<
@@ -54299,7 +53713,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1394
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1380
* break
* else:
* e_gap_order[i] = i # <<<<<<<<<<<<<<
@@ -54314,7 +53728,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
}
__pyx_L3:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1396
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1382
* e_gap_order[i] = i
*
* e_x_low = e_low # <<<<<<<<<<<<<<
@@ -54323,7 +53737,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_e_x_low = __pyx_v_e_low;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1397
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1383
*
* e_x_low = e_low
* e_x_high = e_high # <<<<<<<<<<<<<<
@@ -54332,7 +53746,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_e_x_high = __pyx_v_e_high;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1398
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1384
* e_x_low = e_low
* e_x_high = e_high
* if not self.tight_phrases: # <<<<<<<<<<<<<<
@@ -54342,7 +53756,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_2 = ((!(__pyx_v_self->tight_phrases != 0)) != 0);
if (__pyx_t_2) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1399
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1385
* 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: # <<<<<<<<<<<<<<
@@ -54365,7 +53779,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
}
if (!__pyx_t_6) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1400
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1386
* 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 # <<<<<<<<<<<<<<
@@ -54375,7 +53789,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_v_e_x_low = (__pyx_v_e_x_low - 1);
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1401
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1387
* 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: # <<<<<<<<<<<<<<
@@ -54398,7 +53812,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
}
if (!__pyx_t_2) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1402
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1388
* 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 # <<<<<<<<<<<<<<
@@ -54411,7 +53825,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
}
__pyx_L11:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1404
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1390
* e_x_high = e_x_high + 1
*
* for i from e_x_low <= i <= e_low: # <<<<<<<<<<<<<<
@@ -54421,7 +53835,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_3 = __pyx_v_e_low;
for (__pyx_v_i = __pyx_v_e_x_low; __pyx_v_i <= __pyx_t_3; __pyx_v_i++) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1405
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1391
*
* for i from e_x_low <= i <= e_low:
* e_gaps1 = self.int_arr_extend(e_gaps1, &len1, &i, 1) # <<<<<<<<<<<<<<
@@ -54431,7 +53845,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_v_e_gaps1 = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps1, (&__pyx_v_len1), (&__pyx_v_i), 1);
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1407
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1393
* e_gaps1 = self.int_arr_extend(e_gaps1, &len1, &i, 1)
*
* for i from 0 <= i < num_gaps: # <<<<<<<<<<<<<<
@@ -54441,7 +53855,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_3 = __pyx_v_num_gaps;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1408
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1394
*
* for i from 0 <= i < num_gaps:
* e_gaps2 = <int*> malloc(0) # <<<<<<<<<<<<<<
@@ -54450,7 +53864,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_e_gaps2 = ((int *)malloc(0));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1409
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1395
* for i from 0 <= i < num_gaps:
* e_gaps2 = <int*> malloc(0)
* len2 = 0 # <<<<<<<<<<<<<<
@@ -54459,7 +53873,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_len2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1411
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1397
* len2 = 0
*
* j = e_gap_order[i] # <<<<<<<<<<<<<<
@@ -54468,7 +53882,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_j = (__pyx_v_e_gap_order[__pyx_v_i]);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1412
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1398
*
* j = e_gap_order[i]
* e_x_gap_low = e_gap_low[j] # <<<<<<<<<<<<<<
@@ -54477,7 +53891,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_e_x_gap_low = (__pyx_v_e_gap_low[__pyx_v_j]);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1413
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1399
* j = e_gap_order[i]
* e_x_gap_low = e_gap_low[j]
* e_x_gap_high = e_gap_high[j] # <<<<<<<<<<<<<<
@@ -54486,7 +53900,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_e_x_gap_high = (__pyx_v_e_gap_high[__pyx_v_j]);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1414
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1400
* e_x_gap_low = e_gap_low[j]
* e_x_gap_high = e_gap_high[j]
* if not self.tight_phrases: # <<<<<<<<<<<<<<
@@ -54496,7 +53910,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_2 = ((!(__pyx_v_self->tight_phrases != 0)) != 0);
if (__pyx_t_2) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1415
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1401
* 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: # <<<<<<<<<<<<<<
@@ -54513,7 +53927,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
}
if (!__pyx_t_7) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1416
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1402
* 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 # <<<<<<<<<<<<<<
@@ -54523,7 +53937,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_v_e_x_gap_low = (__pyx_v_e_x_gap_low - 1);
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1417
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1403
* 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: # <<<<<<<<<<<<<<
@@ -54540,7 +53954,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
}
if (!__pyx_t_6) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1418
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1404
* 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 # <<<<<<<<<<<<<<
@@ -54553,7 +53967,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
}
__pyx_L20:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1420
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1406
* e_x_gap_high = e_x_gap_high + 1
*
* k = 0 # <<<<<<<<<<<<<<
@@ -54562,7 +53976,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_k = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1421
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1407
*
* k = 0
* step = 1+(i*2) # <<<<<<<<<<<<<<
@@ -54571,7 +53985,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_step = (1 + (__pyx_v_i * 2));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1422
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1408
* k = 0
* step = 1+(i*2)
* while k < len1: # <<<<<<<<<<<<<<
@@ -54582,7 +53996,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_6 = ((__pyx_v_k < __pyx_v_len1) != 0);
if (!__pyx_t_6) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1423
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1409
* step = 1+(i*2)
* while k < len1:
* for m from e_x_gap_low <= m <= e_gap_low[j]: # <<<<<<<<<<<<<<
@@ -54592,7 +54006,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_4 = (__pyx_v_e_gap_low[__pyx_v_j]);
for (__pyx_v_m = __pyx_v_e_x_gap_low; __pyx_v_m <= __pyx_t_4; __pyx_v_m++) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1424
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1410
* while k < len1:
* for m from e_x_gap_low <= m <= e_gap_low[j]:
* if m >= e_gaps1[k+step-1]: # <<<<<<<<<<<<<<
@@ -54602,7 +54016,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_6 = ((__pyx_v_m >= (__pyx_v_e_gaps1[((__pyx_v_k + __pyx_v_step) - 1)])) != 0);
if (__pyx_t_6) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1425
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1411
* 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: # <<<<<<<<<<<<<<
@@ -54612,7 +54026,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_5 = __pyx_v_e_x_gap_high;
for (__pyx_v_n = (__pyx_v_e_gap_high[__pyx_v_j]); __pyx_v_n <= __pyx_t_5; __pyx_v_n++) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1426
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1412
* 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 # <<<<<<<<<<<<<<
@@ -54622,7 +54036,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_6 = (((__pyx_v_n - __pyx_v_m) >= 1) != 0);
if (__pyx_t_6) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1427
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1413
* 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) # <<<<<<<<<<<<<<
@@ -54631,7 +54045,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_e_gaps2 = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps2, (&__pyx_v_len2), (__pyx_v_e_gaps1 + __pyx_v_k), __pyx_v_step);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1428
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1414
* 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) # <<<<<<<<<<<<<<
@@ -54640,7 +54054,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_e_gaps2 = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps2, (&__pyx_v_len2), (&__pyx_v_m), 1);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1429
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1415
* 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) # <<<<<<<<<<<<<<
@@ -54657,7 +54071,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_L29:;
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1430
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1416
* 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 # <<<<<<<<<<<<<<
@@ -54667,7 +54081,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_v_k = (__pyx_v_k + __pyx_v_step);
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1431
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1417
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &n, 1)
* k = k + step
* free(e_gaps1) # <<<<<<<<<<<<<<
@@ -54676,7 +54090,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
free(__pyx_v_e_gaps1);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1432
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1418
* k = k + step
* free(e_gaps1)
* e_gaps1 = e_gaps2 # <<<<<<<<<<<<<<
@@ -54685,7 +54099,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_e_gaps1 = __pyx_v_e_gaps2;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1433
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1419
* free(e_gaps1)
* e_gaps1 = e_gaps2
* len1 = len2 # <<<<<<<<<<<<<<
@@ -54695,7 +54109,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_v_len1 = __pyx_v_len2;
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1435
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1421
* len1 = len2
*
* step = 1+(num_gaps*2) # <<<<<<<<<<<<<<
@@ -54704,7 +54118,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_step = (1 + (__pyx_v_num_gaps * 2));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1436
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1422
*
* step = 1+(num_gaps*2)
* e_gaps2 = <int*> malloc(0) # <<<<<<<<<<<<<<
@@ -54713,7 +54127,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_e_gaps2 = ((int *)malloc(0));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1437
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1423
* step = 1+(num_gaps*2)
* e_gaps2 = <int*> malloc(0)
* len2 = 0 # <<<<<<<<<<<<<<
@@ -54722,7 +54136,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_len2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1438
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1424
* e_gaps2 = <int*> malloc(0)
* len2 = 0
* for i from e_high <= i <= e_x_high: # <<<<<<<<<<<<<<
@@ -54732,7 +54146,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_3 = __pyx_v_e_x_high;
for (__pyx_v_i = __pyx_v_e_high; __pyx_v_i <= __pyx_t_3; __pyx_v_i++) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1439
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1425
* len2 = 0
* for i from e_high <= i <= e_x_high:
* j = 0 # <<<<<<<<<<<<<<
@@ -54741,7 +54155,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_j = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1440
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1426
* for i from e_high <= i <= e_x_high:
* j = 0
* while j < len1: # <<<<<<<<<<<<<<
@@ -54752,7 +54166,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_6 = ((__pyx_v_j < __pyx_v_len1) != 0);
if (!__pyx_t_6) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1441
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1427
* j = 0
* while j < len1:
* if i - e_gaps1[j] <= self.train_max_initial_size and i >= e_gaps1[j+step-1]: # <<<<<<<<<<<<<<
@@ -54768,7 +54182,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
}
if (__pyx_t_2) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1442
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1428
* 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) # <<<<<<<<<<<<<<
@@ -54777,7 +54191,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_e_gaps2 = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps2, (&__pyx_v_len2), (__pyx_v_e_gaps1 + __pyx_v_j), __pyx_v_step);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1443
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1429
* 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) # <<<<<<<<<<<<<<
@@ -54789,7 +54203,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
}
__pyx_L37:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1444
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1430
* 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 # <<<<<<<<<<<<<<
@@ -54800,7 +54214,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
}
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1445
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1431
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &i, 1)
* j = j + step
* free(e_gaps1) # <<<<<<<<<<<<<<
@@ -54809,7 +54223,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
free(__pyx_v_e_gaps1);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1446
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1432
* j = j + step
* free(e_gaps1)
* e_gaps1 = e_gaps2 # <<<<<<<<<<<<<<
@@ -54818,7 +54232,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_e_gaps1 = __pyx_v_e_gaps2;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1447
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1433
* free(e_gaps1)
* e_gaps1 = e_gaps2
* len1 = len2 # <<<<<<<<<<<<<<
@@ -54827,7 +54241,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_len1 = __pyx_v_len2;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1449
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1435
* len1 = len2
*
* step = (num_gaps+1)*2 # <<<<<<<<<<<<<<
@@ -54836,7 +54250,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_step = ((__pyx_v_num_gaps + 1) * 2);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1450
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1436
*
* step = (num_gaps+1)*2
* i = 0 # <<<<<<<<<<<<<<
@@ -54845,7 +54259,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_i = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1453
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1439
*
* cdef IntList indexes
* while i < len1: # <<<<<<<<<<<<<<
@@ -54856,7 +54270,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_2 = ((__pyx_v_i < __pyx_v_len1) != 0);
if (!__pyx_t_2) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1454
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1440
* cdef IntList indexes
* while i < len1:
* ephr_arr._clear() # <<<<<<<<<<<<<<
@@ -54865,7 +54279,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_ephr_arr->__pyx_vtab)->_clear(__pyx_v_ephr_arr);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1455
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1441
* while i < len1:
* ephr_arr._clear()
* num_chunks = 0 # <<<<<<<<<<<<<<
@@ -54874,19 +54288,19 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_num_chunks = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1456
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1442
* ephr_arr._clear()
* num_chunks = 0
* indexes = IntList() # <<<<<<<<<<<<<<
* for j from 0 <= j < num_gaps+1:
* if e_gaps1[i+2*j] < e_gaps1[i+(2*j)+1]:
*/
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_XDECREF_SET(__pyx_v_indexes, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1));
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1457
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1443
* num_chunks = 0
* indexes = IntList()
* for j from 0 <= j < num_gaps+1: # <<<<<<<<<<<<<<
@@ -54896,7 +54310,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_9 = (__pyx_v_num_gaps + 1);
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_9; __pyx_v_j++) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1458
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1444
* indexes = IntList()
* for j from 0 <= j < num_gaps+1:
* if e_gaps1[i+2*j] < e_gaps1[i+(2*j)+1]: # <<<<<<<<<<<<<<
@@ -54906,7 +54320,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_2 = (((__pyx_v_e_gaps1[(__pyx_v_i + (2 * __pyx_v_j))]) < (__pyx_v_e_gaps1[((__pyx_v_i + (2 * __pyx_v_j)) + 1)])) != 0);
if (__pyx_t_2) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1459
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1445
* 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 # <<<<<<<<<<<<<<
@@ -54918,7 +54332,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
}
__pyx_L42:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1460
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1446
* 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]: # <<<<<<<<<<<<<<
@@ -54928,21 +54342,21 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_3 = (__pyx_v_e_gaps1[((__pyx_v_i + (2 * __pyx_v_j)) + 1)]);
for (__pyx_v_k = (__pyx_v_e_gaps1[(__pyx_v_i + (2 * __pyx_v_j))]); __pyx_v_k < __pyx_t_3; __pyx_v_k++) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1461
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1447
* 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 = 1461; __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 = 1447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_10 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_indexes), __pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_indexes), __pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1447; __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_10); __pyx_t_10 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1462
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1448
* 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]]) # <<<<<<<<<<<<<<
@@ -54950,14 +54364,14 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
* 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_10 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->eid2symid), __pyx_t_4, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->eid2symid), __pyx_t_4, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_ephr_arr->__pyx_vtab)->_append(__pyx_v_ephr_arr, __pyx_t_4);
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1463
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1449
* indexes.append(k)
* ephr_arr._append(self.eid2symid[self.eda.data.arr[e_sent_start+k]])
* if j < num_gaps: # <<<<<<<<<<<<<<
@@ -54967,21 +54381,21 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_t_2 = ((__pyx_v_j < __pyx_v_num_gaps) != 0);
if (__pyx_t_2) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1464
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1450
* 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_10 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, ((__pyx_v_e_gap_order[__pyx_v_j]) + 1))); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, ((__pyx_v_e_gap_order[__pyx_v_j]) + 1))); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_indexes), __pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_indexes), __pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1465
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1451
* 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)) # <<<<<<<<<<<<<<
@@ -54994,7 +54408,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_L45:;
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1466
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1452
* 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 # <<<<<<<<<<<<<<
@@ -55003,7 +54417,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
__pyx_v_i = (__pyx_v_i + __pyx_v_step);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1467
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1453
* 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: # <<<<<<<<<<<<<<
@@ -55019,22 +54433,22 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
}
if (__pyx_t_7) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1468
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1454
* 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 = 1468; __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 = 1454; __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_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__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 = 1468; __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 = 1454; __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);
@@ -55042,7 +54456,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_indexes));
__Pyx_GIVEREF(((PyObject *)__pyx_v_indexes));
__pyx_t_10 = 0;
- __pyx_t_10 = __Pyx_PyObject_Append(__pyx_v_result, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyObject_Append(__pyx_v_result, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
@@ -55051,7 +54465,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
__pyx_L46:;
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1470
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1456
* result.append((Phrase(ephr_arr),indexes))
*
* free(e_gaps1) # <<<<<<<<<<<<<<
@@ -55060,7 +54474,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
free(__pyx_v_e_gaps1);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1471
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1457
*
* free(e_gaps1)
* free(e_gap_order) # <<<<<<<<<<<<<<
@@ -55069,7 +54483,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
*/
free(__pyx_v_e_gap_order);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1472
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1458
* free(e_gaps1)
* free(e_gap_order)
* return result # <<<<<<<<<<<<<<
@@ -55097,7 +54511,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrase
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1474
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1460
* return result
*
* cdef IntList create_alignments(self, int* sent_links, int num_links, # <<<<<<<<<<<<<<
@@ -55125,19 +54539,19 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("create_alignments", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1477
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1463
* IntList findexes, IntList eindexes):
* cdef unsigned i
* cdef IntList ret = IntList() # <<<<<<<<<<<<<<
* for i in range(findexes.len):
* s = findexes.arr[i]
*/
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ret = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1478
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1464
* cdef unsigned i
* cdef IntList ret = IntList()
* for i in range(findexes.len): # <<<<<<<<<<<<<<
@@ -55148,7 +54562,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1479
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1465
* cdef IntList ret = IntList()
* for i in range(findexes.len):
* s = findexes.arr[i] # <<<<<<<<<<<<<<
@@ -55157,7 +54571,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa
*/
__pyx_v_s = (__pyx_v_findexes->arr[__pyx_v_i]);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1480
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1466
* for i in range(findexes.len):
* s = findexes.arr[i]
* if s < 0: continue # <<<<<<<<<<<<<<
@@ -55171,7 +54585,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa
}
__pyx_L5:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1481
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1467
* s = findexes.arr[i]
* if s < 0: continue
* idx = 0 # <<<<<<<<<<<<<<
@@ -55181,7 +54595,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa
__Pyx_INCREF(__pyx_int_0);
__Pyx_XDECREF_SET(__pyx_v_idx, __pyx_int_0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1482
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1468
* if s < 0: continue
* idx = 0
* while idx < num_links * 2: # <<<<<<<<<<<<<<
@@ -55189,65 +54603,65 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa
* 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 = 1482; __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 = 1468; __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 = 1482; __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 = 1468; __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 = 1482; __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 = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (!__pyx_t_4) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1483
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1469
* idx = 0
* while idx < num_links * 2:
* if sent_links[idx] == s: # <<<<<<<<<<<<<<
* j = eindexes.index(sent_links[idx+1])
* ret.append(i * ALIGNMENT_CODE + 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 = 1483; __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 = 1469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_4 = (((__pyx_v_sent_links[__pyx_t_6]) == __pyx_v_s) != 0);
if (__pyx_t_4) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1484
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1470
* while idx < num_links * 2:
* if sent_links[idx] == s:
* j = eindexes.index(sent_links[idx+1]) # <<<<<<<<<<<<<<
* ret.append(i * ALIGNMENT_CODE + j)
* idx += 2
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_eindexes), __pyx_n_s__index); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_eindexes), __pyx_n_s__index); 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_t_1 = PyNumber_Add(__pyx_v_idx, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Add(__pyx_v_idx, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyInt_FromLong((__pyx_v_sent_links[__pyx_t_6])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong((__pyx_v_sent_links[__pyx_t_6])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1470; __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 = 1484; __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 = 1470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1470; __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_7)); __pyx_t_7 = 0;
__Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1485
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1471
* if sent_links[idx] == s:
* j = eindexes.index(sent_links[idx+1])
* ret.append(i * ALIGNMENT_CODE + j) # <<<<<<<<<<<<<<
* idx += 2
* return ret
*/
- __pyx_t_1 = PyLong_FromUnsignedLong((__pyx_v_i * __pyx_v_4cdec_2sa_3_sa_ALIGNMENT_CODE)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyLong_FromUnsignedLong((__pyx_v_i * __pyx_v_4cdec_2sa_3_sa_ALIGNMENT_CODE)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = PyNumber_Add(__pyx_t_1, __pyx_v_j); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyNumber_Add(__pyx_t_1, __pyx_v_j); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_ret), __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_ret), __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1471; __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;
@@ -55255,14 +54669,14 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa
}
__pyx_L8:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1486
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1472
* j = eindexes.index(sent_links[idx+1])
* ret.append(i * ALIGNMENT_CODE + j)
* idx += 2 # <<<<<<<<<<<<<<
* return ret
*
*/
- __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_idx, __pyx_int_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_idx, __pyx_int_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_idx, __pyx_t_1);
__pyx_t_1 = 0;
@@ -55270,7 +54684,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa
__pyx_L3_continue:;
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1487
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1473
* ret.append(i * ALIGNMENT_CODE + j)
* idx += 2
* return ret # <<<<<<<<<<<<<<
@@ -55299,7 +54713,7 @@ static struct __pyx_obj_4cdec_2sa_3_sa_IntList *__pyx_f_4cdec_2sa_3_sa_23HieroCa
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1489
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1475
* return ret
*
* cdef extract(self, Phrase phrase, Matching* matching, int* chunklen, int num_chunks): # <<<<<<<<<<<<<<
@@ -55393,19 +54807,19 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("extract", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1502
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1488
* cdef reason_for_failure
*
* fphr_arr = IntList() # <<<<<<<<<<<<<<
* phrase_len = phrase.n
* extracts = []
*/
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); 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_fphr_arr = ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1503
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1489
*
* fphr_arr = IntList()
* phrase_len = phrase.n # <<<<<<<<<<<<<<
@@ -55415,19 +54829,19 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_2 = __pyx_v_phrase->n;
__pyx_v_phrase_len = __pyx_t_2;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1504
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1490
* 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 = 1504; __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 = 1490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_extracts = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1505
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1491
* phrase_len = phrase.n
* extracts = []
* sent_links = self.alignment._get_sent_links(matching.sent_id, &num_links) # <<<<<<<<<<<<<<
@@ -55436,7 +54850,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_sent_links = ((struct __pyx_vtabstruct_4cdec_2sa_3_sa_Alignment *)__pyx_v_self->alignment->__pyx_vtab)->_get_sent_links(__pyx_v_self->alignment, __pyx_v_matching->sent_id, (&__pyx_v_num_links));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1507
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1493
* sent_links = self.alignment._get_sent_links(matching.sent_id, &num_links)
*
* e_sent_start = self.eda.sent_index.arr[matching.sent_id] # <<<<<<<<<<<<<<
@@ -55445,7 +54859,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_e_sent_start = (__pyx_v_self->eda->sent_index->arr[__pyx_v_matching->sent_id]);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1508
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1494
*
* e_sent_start = self.eda.sent_index.arr[matching.sent_id]
* e_sent_end = self.eda.sent_index.arr[matching.sent_id+1] # <<<<<<<<<<<<<<
@@ -55454,7 +54868,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_e_sent_end = (__pyx_v_self->eda->sent_index->arr[(__pyx_v_matching->sent_id + 1)]);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1509
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1495
* 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 # <<<<<<<<<<<<<<
@@ -55463,7 +54877,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_e_sent_len = ((__pyx_v_e_sent_end - __pyx_v_e_sent_start) - 1);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1510
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1496
* 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] # <<<<<<<<<<<<<<
@@ -55472,7 +54886,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_f_sent_start = (__pyx_v_self->fda->sent_index->arr[__pyx_v_matching->sent_id]);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1511
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1497
* 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] # <<<<<<<<<<<<<<
@@ -55481,7 +54895,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_f_sent_end = (__pyx_v_self->fda->sent_index->arr[(__pyx_v_matching->sent_id + 1)]);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1512
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1498
* 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 # <<<<<<<<<<<<<<
@@ -55490,21 +54904,21 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_f_sent_len = ((__pyx_v_f_sent_end - __pyx_v_f_sent_start) - 1);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1514
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1500
* f_sent_len = f_sent_end - f_sent_start - 1
*
* self.findexes1.reset() # <<<<<<<<<<<<<<
* sofar = 0
* for i in range(num_chunks):
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes1), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes1), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1515
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1501
*
* self.findexes1.reset()
* sofar = 0 # <<<<<<<<<<<<<<
@@ -55514,7 +54928,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_INCREF(__pyx_int_0);
__pyx_v_sofar = __pyx_int_0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1516
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1502
* self.findexes1.reset()
* sofar = 0
* for i in range(num_chunks): # <<<<<<<<<<<<<<
@@ -55525,7 +54939,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_2; __pyx_t_4+=1) {
__pyx_v_i = __pyx_t_4;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1517
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1503
* sofar = 0
* for i in range(num_chunks):
* for j in range(chunklen[i]): # <<<<<<<<<<<<<<
@@ -55536,34 +54950,34 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
__pyx_v_j = __pyx_t_6;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1518
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1504
* 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_3 = 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_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = 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_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes1), __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes1), __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1504; __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_1); __pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1519
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1505
* 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 = 1519; __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 = 1505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_sofar, __pyx_t_1);
__pyx_t_1 = 0;
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1520
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1506
* self.findexes1.append(matching.arr[matching.start+i]+j-f_sent_start);
* sofar += 1
* if i+1 < num_chunks: # <<<<<<<<<<<<<<
@@ -55573,28 +54987,28 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_7 = (((__pyx_v_i + 1) < __pyx_v_num_chunks) != 0);
if (__pyx_t_7) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1521
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1507
* 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 = 1521; __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 = 1507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes1), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes1), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1522
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1508
* if i+1 < num_chunks:
* self.findexes1.append(phrase[sofar])
* sofar += 1 # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_sofar, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_sofar, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_sofar, __pyx_t_3);
__pyx_t_3 = 0;
@@ -55603,7 +55017,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L7:;
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1525
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1511
*
*
* e_links_low = <int*> malloc(e_sent_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -55612,7 +55026,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_e_links_low = ((int *)malloc((__pyx_v_e_sent_len * (sizeof(int)))));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1526
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1512
*
* e_links_low = <int*> malloc(e_sent_len*sizeof(int))
* e_links_high = <int*> malloc(e_sent_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -55621,7 +55035,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_e_links_high = ((int *)malloc((__pyx_v_e_sent_len * (sizeof(int)))));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1527
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1513
* 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)) # <<<<<<<<<<<<<<
@@ -55630,7 +55044,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_f_links_low = ((int *)malloc((__pyx_v_f_sent_len * (sizeof(int)))));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1528
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1514
* 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)) # <<<<<<<<<<<<<<
@@ -55639,7 +55053,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_f_links_high = ((int *)malloc((__pyx_v_f_sent_len * (sizeof(int)))));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1529
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1515
* 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)) # <<<<<<<<<<<<<<
@@ -55648,7 +55062,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_f_gap_low = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int)))));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1530
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1516
* 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)) # <<<<<<<<<<<<<<
@@ -55657,7 +55071,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_f_gap_high = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int)))));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1531
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1517
* 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)) # <<<<<<<<<<<<<<
@@ -55666,7 +55080,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_e_gap_low = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int)))));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1532
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1518
* 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)) # <<<<<<<<<<<<<<
@@ -55675,7 +55089,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_e_gap_high = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int)))));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1533
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1519
* 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)) # <<<<<<<<<<<<<<
@@ -55684,7 +55098,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
memset(__pyx_v_f_gap_low, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int))));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1534
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1520
* 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)) # <<<<<<<<<<<<<<
@@ -55693,7 +55107,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
memset(__pyx_v_f_gap_high, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int))));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1535
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1521
* 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)) # <<<<<<<<<<<<<<
@@ -55702,7 +55116,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
memset(__pyx_v_e_gap_low, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int))));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1536
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1522
* 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)) # <<<<<<<<<<<<<<
@@ -55711,7 +55125,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
memset(__pyx_v_e_gap_high, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int))));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1538
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1524
* memset(e_gap_high, 0, (num_chunks+1)*sizeof(int))
*
* reason_for_failure = "" # <<<<<<<<<<<<<<
@@ -55721,7 +55135,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_INCREF(((PyObject *)__pyx_kp_s_47));
__pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_47);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1540
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1526
* reason_for_failure = ""
*
* for i from 0 <= i < e_sent_len: # <<<<<<<<<<<<<<
@@ -55731,7 +55145,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_2 = __pyx_v_e_sent_len;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1541
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1527
*
* for i from 0 <= i < e_sent_len:
* e_links_low[i] = -1 # <<<<<<<<<<<<<<
@@ -55740,7 +55154,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
(__pyx_v_e_links_low[__pyx_v_i]) = -1;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1542
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1528
* for i from 0 <= i < e_sent_len:
* e_links_low[i] = -1
* e_links_high[i] = -1 # <<<<<<<<<<<<<<
@@ -55750,7 +55164,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
(__pyx_v_e_links_high[__pyx_v_i]) = -1;
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1543
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1529
* e_links_low[i] = -1
* e_links_high[i] = -1
* for i from 0 <= i < f_sent_len: # <<<<<<<<<<<<<<
@@ -55760,7 +55174,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_2 = __pyx_v_f_sent_len;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1544
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1530
* e_links_high[i] = -1
* for i from 0 <= i < f_sent_len:
* f_links_low[i] = -1 # <<<<<<<<<<<<<<
@@ -55769,7 +55183,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
(__pyx_v_f_links_low[__pyx_v_i]) = -1;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1545
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1531
* for i from 0 <= i < f_sent_len:
* f_links_low[i] = -1
* f_links_high[i] = -1 # <<<<<<<<<<<<<<
@@ -55779,7 +55193,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
(__pyx_v_f_links_high[__pyx_v_i]) = -1;
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1551
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1537
* # links that we care about (but then how to look up
* # when we want to check something on the e side?)
* i = 0 # <<<<<<<<<<<<<<
@@ -55788,7 +55202,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_i = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1552
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1538
* # when we want to check something on the e side?)
* i = 0
* while i < num_links*2: # <<<<<<<<<<<<<<
@@ -55799,7 +55213,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_7 = ((__pyx_v_i < (__pyx_v_num_links * 2)) != 0);
if (!__pyx_t_7) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1553
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1539
* i = 0
* while i < num_links*2:
* f_i = sent_links[i] # <<<<<<<<<<<<<<
@@ -55808,7 +55222,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_f_i = (__pyx_v_sent_links[__pyx_v_i]);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1554
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1540
* while i < num_links*2:
* f_i = sent_links[i]
* e_i = sent_links[i+1] # <<<<<<<<<<<<<<
@@ -55817,7 +55231,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_e_i = (__pyx_v_sent_links[(__pyx_v_i + 1)]);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1555
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1541
* 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: # <<<<<<<<<<<<<<
@@ -55833,7 +55247,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1556
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1542
* 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 # <<<<<<<<<<<<<<
@@ -55845,7 +55259,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L14:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1557
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1543
* 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: # <<<<<<<<<<<<<<
@@ -55861,7 +55275,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
if (__pyx_t_8) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1558
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1544
* 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 # <<<<<<<<<<<<<<
@@ -55873,7 +55287,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L15:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1559
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1545
* 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: # <<<<<<<<<<<<<<
@@ -55889,7 +55303,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
if (__pyx_t_7) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1560
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1546
* 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 # <<<<<<<<<<<<<<
@@ -55901,7 +55315,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L16:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1561
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1547
* 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: # <<<<<<<<<<<<<<
@@ -55917,7 +55331,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1562
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1548
* 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 # <<<<<<<<<<<<<<
@@ -55929,7 +55343,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L17:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1563
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1549
* 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 # <<<<<<<<<<<<<<
@@ -55939,19 +55353,19 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_v_i = (__pyx_v_i + 2);
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1565
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1551
* 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_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1565; __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 = 1551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_als = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1566
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1552
*
* als = []
* for x in range(matching.start,matching.end): # <<<<<<<<<<<<<<
@@ -55962,18 +55376,18 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
for (__pyx_t_4 = __pyx_v_matching->start; __pyx_t_4 < __pyx_t_2; __pyx_t_4+=1) {
__pyx_v_x = __pyx_t_4;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1567
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1553
* 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_3 = PyInt_FromLong(((__pyx_v_matching->arr[__pyx_v_x]) - __pyx_v_f_sent_start)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong(((__pyx_v_matching->arr[__pyx_v_x]) - __pyx_v_f_sent_start)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __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 = 1567; __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 = 1553; __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 = 1567; __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 = 1553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
@@ -55984,17 +55398,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_XDECREF_SET(__pyx_v_al, ((PyObject*)__pyx_t_10));
__pyx_t_10 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1568
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1554
* 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 = __Pyx_PyList_Append(__pyx_v_als, ((PyObject *)__pyx_v_al)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_als, ((PyObject *)__pyx_v_al)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1570
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1556
* als.append(al)
* # check all source-side alignment constraints
* met_constraints = 1 # <<<<<<<<<<<<<<
@@ -56003,7 +55417,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_met_constraints = 1;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1571
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1557
* # check all source-side alignment constraints
* met_constraints = 1
* if self.require_aligned_terminal: # <<<<<<<<<<<<<<
@@ -56013,7 +55427,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = (__pyx_v_self->require_aligned_terminal != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1572
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1558
* met_constraints = 1
* if self.require_aligned_terminal:
* num_aligned_chunks = 0 # <<<<<<<<<<<<<<
@@ -56022,7 +55436,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_num_aligned_chunks = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1573
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1559
* if self.require_aligned_terminal:
* num_aligned_chunks = 0
* for i from 0 <= i < num_chunks: # <<<<<<<<<<<<<<
@@ -56032,7 +55446,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_2 = __pyx_v_num_chunks;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1574
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1560
* num_aligned_chunks = 0
* for i from 0 <= i < num_chunks:
* for j from 0 <= j < chunklen[i]: # <<<<<<<<<<<<<<
@@ -56042,7 +55456,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_4 = (__pyx_v_chunklen[__pyx_v_i]);
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_4; __pyx_v_j++) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1575
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1561
* 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: # <<<<<<<<<<<<<<
@@ -56052,7 +55466,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = (((__pyx_v_f_links_low[(((__pyx_v_matching->arr[(__pyx_v_matching->start + __pyx_v_i)]) + __pyx_v_j) - __pyx_v_f_sent_start)]) > -1) != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1576
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1562
* 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 # <<<<<<<<<<<<<<
@@ -56061,7 +55475,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_num_aligned_chunks = (__pyx_v_num_aligned_chunks + 1);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1577
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1563
* if f_links_low[matching.arr[matching.start+i]+j-f_sent_start] > -1:
* num_aligned_chunks = num_aligned_chunks + 1
* break # <<<<<<<<<<<<<<
@@ -56076,7 +55490,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L24_break:;
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1578
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1564
* num_aligned_chunks = num_aligned_chunks + 1
* break
* if num_aligned_chunks == 0: # <<<<<<<<<<<<<<
@@ -56086,7 +55500,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = ((__pyx_v_num_aligned_chunks == 0) != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1579
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1565
* break
* if num_aligned_chunks == 0:
* reason_for_failure = "No aligned terminals" # <<<<<<<<<<<<<<
@@ -56096,7 +55510,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_INCREF(((PyObject *)__pyx_kp_s_133));
__Pyx_DECREF_SET(__pyx_v_reason_for_failure, ((PyObject *)__pyx_kp_s_133));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1580
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1566
* if num_aligned_chunks == 0:
* reason_for_failure = "No aligned terminals"
* met_constraints = 0 # <<<<<<<<<<<<<<
@@ -56108,7 +55522,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L26:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1581
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1567
* reason_for_failure = "No aligned terminals"
* met_constraints = 0
* if self.require_aligned_chunks and num_aligned_chunks < num_chunks: # <<<<<<<<<<<<<<
@@ -56123,7 +55537,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
if (__pyx_t_7) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1582
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1568
* met_constraints = 0
* if self.require_aligned_chunks and num_aligned_chunks < num_chunks:
* reason_for_failure = "Unaligned chunk" # <<<<<<<<<<<<<<
@@ -56133,7 +55547,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_INCREF(((PyObject *)__pyx_kp_s_134));
__Pyx_DECREF_SET(__pyx_v_reason_for_failure, ((PyObject *)__pyx_kp_s_134));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1583
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1569
* if self.require_aligned_chunks and num_aligned_chunks < num_chunks:
* reason_for_failure = "Unaligned chunk"
* met_constraints = 0 # <<<<<<<<<<<<<<
@@ -56148,7 +55562,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L20:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1585
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1571
* met_constraints = 0
*
* if met_constraints and self.tight_phrases: # <<<<<<<<<<<<<<
@@ -56163,7 +55577,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1587
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1573
* if met_constraints and self.tight_phrases:
* # outside edge constraints are checked later
* for i from 0 <= i < num_chunks-1: # <<<<<<<<<<<<<<
@@ -56173,7 +55587,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_12 = (__pyx_v_num_chunks - 1);
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_12; __pyx_v_i++) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1588
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1574
* # 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: # <<<<<<<<<<<<<<
@@ -56183,7 +55597,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = (((__pyx_v_f_links_low[(((__pyx_v_matching->arr[(__pyx_v_matching->start + __pyx_v_i)]) + (__pyx_v_chunklen[__pyx_v_i])) - __pyx_v_f_sent_start)]) == -1) != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1589
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1575
* 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" # <<<<<<<<<<<<<<
@@ -56193,7 +55607,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_INCREF(((PyObject *)__pyx_kp_s_135));
__Pyx_DECREF_SET(__pyx_v_reason_for_failure, ((PyObject *)__pyx_kp_s_135));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1590
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1576
* 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 # <<<<<<<<<<<<<<
@@ -56202,7 +55616,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_met_constraints = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1591
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1577
* reason_for_failure = "Gaps are not tight phrases"
* met_constraints = 0
* break # <<<<<<<<<<<<<<
@@ -56214,7 +55628,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L31:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1592
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1578
* met_constraints = 0
* break
* if f_links_low[matching.arr[matching.start+i+1]-1-f_sent_start] == -1: # <<<<<<<<<<<<<<
@@ -56224,7 +55638,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = (((__pyx_v_f_links_low[(((__pyx_v_matching->arr[((__pyx_v_matching->start + __pyx_v_i) + 1)]) - 1) - __pyx_v_f_sent_start)]) == -1) != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1593
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1579
* break
* if f_links_low[matching.arr[matching.start+i+1]-1-f_sent_start] == -1:
* reason_for_failure = "Gaps are not tight phrases" # <<<<<<<<<<<<<<
@@ -56234,7 +55648,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_INCREF(((PyObject *)__pyx_kp_s_135));
__Pyx_DECREF_SET(__pyx_v_reason_for_failure, ((PyObject *)__pyx_kp_s_135));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1594
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1580
* 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 # <<<<<<<<<<<<<<
@@ -56243,7 +55657,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_met_constraints = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1595
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1581
* reason_for_failure = "Gaps are not tight phrases"
* met_constraints = 0
* break # <<<<<<<<<<<<<<
@@ -56260,7 +55674,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L28:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1597
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1583
* break
*
* f_low = matching.arr[matching.start] - f_sent_start # <<<<<<<<<<<<<<
@@ -56269,7 +55683,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_f_low = ((__pyx_v_matching->arr[__pyx_v_matching->start]) - __pyx_v_f_sent_start);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1598
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1584
*
* 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 # <<<<<<<<<<<<<<
@@ -56278,7 +55692,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_f_high = (((__pyx_v_matching->arr[((__pyx_v_matching->start + __pyx_v_matching->size) - 1)]) + (__pyx_v_chunklen[(__pyx_v_num_chunks - 1)])) - __pyx_v_f_sent_start);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1599
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1585
* 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: # <<<<<<<<<<<<<<
@@ -56288,17 +55702,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = (__pyx_v_met_constraints != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1601
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1587
* 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 = 1601; __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 = 1587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1605
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1591
* 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): # <<<<<<<<<<<<<<
@@ -56309,7 +55723,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1606
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1592
* self.train_min_gap_size, 0,
* self.max_nonterminals - num_chunks + 1, 1, 1, 0, 0):
* gap_error = 0 # <<<<<<<<<<<<<<
@@ -56318,7 +55732,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_gap_error = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1607
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1593
* self.max_nonterminals - num_chunks + 1, 1, 1, 0, 0):
* gap_error = 0
* num_gaps = 0 # <<<<<<<<<<<<<<
@@ -56327,7 +55741,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_num_gaps = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1609
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1595
* num_gaps = 0
*
* if f_back_low < f_low: # <<<<<<<<<<<<<<
@@ -56337,7 +55751,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = ((__pyx_v_f_back_low < __pyx_v_f_low) != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1610
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1596
*
* if f_back_low < f_low:
* f_gap_low[0] = f_back_low # <<<<<<<<<<<<<<
@@ -56346,7 +55760,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
(__pyx_v_f_gap_low[0]) = __pyx_v_f_back_low;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1611
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1597
* if f_back_low < f_low:
* f_gap_low[0] = f_back_low
* f_gap_high[0] = f_low # <<<<<<<<<<<<<<
@@ -56355,7 +55769,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
(__pyx_v_f_gap_high[0]) = __pyx_v_f_low;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1612
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1598
* f_gap_low[0] = f_back_low
* f_gap_high[0] = f_low
* num_gaps = 1 # <<<<<<<<<<<<<<
@@ -56364,7 +55778,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_num_gaps = 1;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1613
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1599
* f_gap_high[0] = f_low
* num_gaps = 1
* gap_start = 0 # <<<<<<<<<<<<<<
@@ -56373,7 +55787,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_gap_start = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1614
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1600
* num_gaps = 1
* gap_start = 0
* phrase_len = phrase_len+1 # <<<<<<<<<<<<<<
@@ -56382,7 +55796,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_phrase_len = (__pyx_v_phrase_len + 1);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1615
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1601
* gap_start = 0
* phrase_len = phrase_len+1
* if phrase_len > self.max_length: # <<<<<<<<<<<<<<
@@ -56392,7 +55806,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = ((__pyx_v_phrase_len > __pyx_v_self->max_length) != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1616
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1602
* phrase_len = phrase_len+1
* if phrase_len > self.max_length:
* gap_error = 1 # <<<<<<<<<<<<<<
@@ -56404,7 +55818,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L36:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1617
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1603
* if phrase_len > self.max_length:
* gap_error = 1
* if self.tight_phrases: # <<<<<<<<<<<<<<
@@ -56414,7 +55828,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = (__pyx_v_self->tight_phrases != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1618
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1604
* gap_error = 1
* if self.tight_phrases:
* if f_links_low[f_back_low] == -1 or f_links_low[f_low-1] == -1: # <<<<<<<<<<<<<<
@@ -56430,7 +55844,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
if (__pyx_t_8) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1619
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1605
* if self.tight_phrases:
* if f_links_low[f_back_low] == -1 or f_links_low[f_low-1] == -1:
* gap_error = 1 # <<<<<<<<<<<<<<
@@ -56439,7 +55853,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_gap_error = 1;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1620
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1606
* 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" # <<<<<<<<<<<<<<
@@ -56458,7 +55872,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1622
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1608
* reason_for_failure = "Inside edges of preceding subphrase are not tight"
* else:
* gap_start = 1 # <<<<<<<<<<<<<<
@@ -56467,7 +55881,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_gap_start = 1;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1623
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1609
* else:
* gap_start = 1
* if self.tight_phrases and f_links_low[f_low] == -1: # <<<<<<<<<<<<<<
@@ -56482,7 +55896,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1626
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1612
* # 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 # <<<<<<<<<<<<<<
@@ -56496,7 +55910,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L35:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1628
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1614
* met_constraints = 0
*
* for i from 0 <= i < matching.size - 1: # <<<<<<<<<<<<<<
@@ -56506,7 +55920,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_12 = (__pyx_v_matching->size - 1);
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_12; __pyx_v_i++) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1629
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1615
*
* for i from 0 <= i < matching.size - 1:
* f_gap_low[1+i] = matching.arr[matching.start+i] + chunklen[i] - f_sent_start # <<<<<<<<<<<<<<
@@ -56515,7 +55929,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
(__pyx_v_f_gap_low[(1 + __pyx_v_i)]) = (((__pyx_v_matching->arr[(__pyx_v_matching->start + __pyx_v_i)]) + (__pyx_v_chunklen[__pyx_v_i])) - __pyx_v_f_sent_start);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1630
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1616
* 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 # <<<<<<<<<<<<<<
@@ -56524,7 +55938,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
(__pyx_v_f_gap_high[(1 + __pyx_v_i)]) = ((__pyx_v_matching->arr[((__pyx_v_matching->start + __pyx_v_i) + 1)]) - __pyx_v_f_sent_start);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1631
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1617
* 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 # <<<<<<<<<<<<<<
@@ -56534,7 +55948,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_v_num_gaps = (__pyx_v_num_gaps + 1);
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1633
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1619
* num_gaps = num_gaps + 1
*
* if f_high < f_back_high: # <<<<<<<<<<<<<<
@@ -56544,7 +55958,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = ((__pyx_v_f_high < __pyx_v_f_back_high) != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1634
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1620
*
* if f_high < f_back_high:
* f_gap_low[gap_start+num_gaps] = f_high # <<<<<<<<<<<<<<
@@ -56553,7 +55967,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
(__pyx_v_f_gap_low[(__pyx_v_gap_start + __pyx_v_num_gaps)]) = __pyx_v_f_high;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1635
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1621
* 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 # <<<<<<<<<<<<<<
@@ -56562,7 +55976,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
(__pyx_v_f_gap_high[(__pyx_v_gap_start + __pyx_v_num_gaps)]) = __pyx_v_f_back_high;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1636
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1622
* f_gap_low[gap_start+num_gaps] = f_high
* f_gap_high[gap_start+num_gaps] = f_back_high
* num_gaps = num_gaps + 1 # <<<<<<<<<<<<<<
@@ -56571,7 +55985,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_num_gaps = (__pyx_v_num_gaps + 1);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1637
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1623
* f_gap_high[gap_start+num_gaps] = f_back_high
* num_gaps = num_gaps + 1
* phrase_len = phrase_len+1 # <<<<<<<<<<<<<<
@@ -56580,7 +55994,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_phrase_len = (__pyx_v_phrase_len + 1);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1638
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1624
* num_gaps = num_gaps + 1
* phrase_len = phrase_len+1
* if phrase_len > self.max_length: # <<<<<<<<<<<<<<
@@ -56590,7 +56004,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = ((__pyx_v_phrase_len > __pyx_v_self->max_length) != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1639
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1625
* phrase_len = phrase_len+1
* if phrase_len > self.max_length:
* gap_error = 1 # <<<<<<<<<<<<<<
@@ -56602,7 +56016,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L43:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1640
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1626
* if phrase_len > self.max_length:
* gap_error = 1
* if self.tight_phrases: # <<<<<<<<<<<<<<
@@ -56612,7 +56026,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = (__pyx_v_self->tight_phrases != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1641
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1627
* gap_error = 1
* if self.tight_phrases:
* if f_links_low[f_back_high-1] == -1 or f_links_low[f_high] == -1: # <<<<<<<<<<<<<<
@@ -56628,7 +56042,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
if (__pyx_t_7) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1642
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1628
* if self.tight_phrases:
* if f_links_low[f_back_high-1] == -1 or f_links_low[f_high] == -1:
* gap_error = 1 # <<<<<<<<<<<<<<
@@ -56637,7 +56051,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_gap_error = 1;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1643
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1629
* 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" # <<<<<<<<<<<<<<
@@ -56656,7 +56070,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1645
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1631
* reason_for_failure = "Inside edges of following subphrase are not tight"
* else:
* if self.tight_phrases and f_links_low[f_high-1] == -1: # <<<<<<<<<<<<<<
@@ -56671,7 +56085,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1646
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1632
* else:
* if self.tight_phrases and f_links_low[f_high-1] == -1:
* met_constraints = 0 # <<<<<<<<<<<<<<
@@ -56685,7 +56099,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L42:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1648
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1634
* met_constraints = 0
*
* if gap_error == 0: # <<<<<<<<<<<<<<
@@ -56695,7 +56109,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = ((__pyx_v_gap_error == 0) != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1649
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1635
*
* if gap_error == 0:
* e_word_count = e_high - e_low # <<<<<<<<<<<<<<
@@ -56704,7 +56118,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_e_word_count = (__pyx_v_e_high - __pyx_v_e_low);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1650
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1636
* if gap_error == 0:
* e_word_count = e_high - e_low
* for i from 0 <= i < num_gaps: # check integrity of subphrases # <<<<<<<<<<<<<<
@@ -56714,17 +56128,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_2 = __pyx_v_num_gaps;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1651
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1637
* 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 = 1651; __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 = 1637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1656
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1642
* 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, # <<<<<<<<<<<<<<
@@ -56735,7 +56149,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1658
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1644
* self.train_max_initial_size, self.train_max_initial_size,
* 0, 0, 0, 0, 0, 0, 0) == 0:
* gap_error = 1 # <<<<<<<<<<<<<<
@@ -56744,18 +56158,18 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_gap_error = 1;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1659
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1645
* 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 = 1659; __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 = 1645; __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 = 1659; __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 = 1645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1659; __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 = 1645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_10);
__Pyx_GIVEREF(__pyx_t_10);
@@ -56763,13 +56177,13 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_10 = 0;
__pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_138), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_138), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__Pyx_DECREF_SET(__pyx_v_reason_for_failure, ((PyObject *)__pyx_t_1));
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1660
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1646
* 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 # <<<<<<<<<<<<<<
@@ -56786,7 +56200,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L47:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1662
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1648
* break
*
* if gap_error == 0: # <<<<<<<<<<<<<<
@@ -56796,7 +56210,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = ((__pyx_v_gap_error == 0) != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1663
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1649
*
* if gap_error == 0:
* i = 1 # <<<<<<<<<<<<<<
@@ -56805,21 +56219,21 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_i = 1;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1664
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1650
* 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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1665
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1651
* i = 1
* self.findexes.reset()
* if f_back_low < f_low: # <<<<<<<<<<<<<<
@@ -56829,7 +56243,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = ((__pyx_v_f_back_low < __pyx_v_f_low) != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1666
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1652
* self.findexes.reset()
* if f_back_low < f_low:
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -56838,7 +56252,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1667
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1653
* if f_back_low < f_low:
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1 # <<<<<<<<<<<<<<
@@ -56847,16 +56261,16 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_i = (__pyx_v_i + 1);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1668
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1654
* 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_3 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -56864,27 +56278,27 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L52:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1669
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1655
* 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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1669; __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 = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_v_self->findexes1));
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self->findexes1));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->findexes1));
- __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1670
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1656
* self.findexes.append(sym_setindex(self.category, i))
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<<
@@ -56894,7 +56308,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_2 = __pyx_v_phrase->n;
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1671
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1657
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<<
@@ -56904,7 +56318,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j])) != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1672
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1658
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -56913,7 +56327,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1673
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1659
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i))
* i = i + 1 # <<<<<<<<<<<<<<
@@ -56925,7 +56339,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1675
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1661
* i = i + 1
* else:
* fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<<
@@ -56937,7 +56351,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L55:;
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1676
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1662
* else:
* fphr_arr._append(phrase.syms[j])
* if f_back_high > f_high: # <<<<<<<<<<<<<<
@@ -56947,7 +56361,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = ((__pyx_v_f_back_high > __pyx_v_f_high) != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1677
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1663
* fphr_arr._append(phrase.syms[j])
* if f_back_high > f_high:
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -56956,16 +56370,16 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1678
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1664
* 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_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); 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_t_3 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_10); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_10); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -56973,25 +56387,25 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L56:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1680
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1666
* 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_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __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 = 1666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_v_fphr_arr));
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_fphr_arr));
__Pyx_GIVEREF(((PyObject *)__pyx_v_fphr_arr));
- __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_3), NULL); 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_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__pyx_v_fphr = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_10);
__pyx_t_10 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1681
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1667
*
* fphr = Phrase(fphr_arr)
* if met_constraints: # <<<<<<<<<<<<<<
@@ -57001,37 +56415,37 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = (__pyx_v_met_constraints != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1684
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1670
* 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_4cdec_2sa_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 = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__pyx_v_phrase_list = __pyx_t_10;
__pyx_t_10 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1685
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1671
* 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 = 1685; __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 = 1671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_9 = ((__pyx_t_13 > 0) != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1686
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1672
* 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 = 1686; __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 = 1672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (unlikely(__pyx_t_13 == 0)) {
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
@@ -57040,14 +56454,14 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
#ifdef WITH_THREAD
PyGILState_Release(__pyx_gilstate_save);
#endif
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_v_pair_count = (1.0 / __pyx_t_13);
goto __pyx_L58;
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1688
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1674
* pair_count = 1.0 / len(phrase_list)
* else:
* pair_count = 0 # <<<<<<<<<<<<<<
@@ -57056,22 +56470,22 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_pair_count = 0.0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1689
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1675
* 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 = 1689; __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 = 1675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_3 = PyInt_FromLong(__pyx_v_f_back_high); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong(__pyx_v_f_back_high); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = PyInt_FromLong(__pyx_v_e_low); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1689; __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 = 1675; __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 = 1689; __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 = 1675; __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 = 1689; __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 = 1675; __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);
@@ -57085,7 +56499,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_3 = 0;
__pyx_t_1 = 0;
__pyx_t_14 = 0;
- __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_139), ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_139), ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1675; __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_SET(__pyx_v_reason_for_failure, ((PyObject *)__pyx_t_14));
@@ -57093,7 +56507,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L58:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1690
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1676
* 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: # <<<<<<<<<<<<<<
@@ -57104,7 +56518,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__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 = 1690; __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 = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__pyx_t_16 = Py_TYPE(__pyx_t_14)->tp_iternext;
}
@@ -57112,23 +56526,23 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
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 = 1690; __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 = 1676; __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 = 1690; __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 = 1676; __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 = 1690; __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 = 1676; __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 = 1690; __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 = 1676; __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 = 1690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -57144,7 +56558,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(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 = 1690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -57157,16 +56571,16 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_3);
#else
- __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1690; __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 = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
#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 = 1690; __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 = 1676; __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;
@@ -57174,7 +56588,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_GOTREF(__pyx_t_1);
index = 1; __pyx_t_3 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L61_unpacking_failed;
__Pyx_GOTREF(__pyx_t_3);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1690; __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 = 1676; __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;
@@ -57182,7 +56596,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__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 = 1690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L62_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_v_phrase2, __pyx_t_1);
@@ -57190,7 +56604,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_XDECREF_SET(__pyx_v_eindexes, __pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1691
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1677
* 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) # <<<<<<<<<<<<<<
@@ -57199,31 +56613,31 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_t_15 = ((PyObject *)__pyx_v_self->findexes);
__Pyx_INCREF(__pyx_t_15);
- if (!(likely(((__pyx_v_eindexes) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_eindexes, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_15), ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_eindexes))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_v_eindexes) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_eindexes, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_15), ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_eindexes))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_XDECREF_SET(__pyx_v_als1, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_3));
__pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1692
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1678
* for phrase2, eindexes in phrase_list:
* als1 = self.create_alignments(sent_links,num_links,self.findexes,eindexes)
* extracts.append((fphr, phrase2, pair_count, tuple(als1))) # <<<<<<<<<<<<<<
* if (num_gaps < self.max_nonterminals and
* phrase_len < self.max_length and
*/
- __pyx_t_3 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1692; __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 = 1678; __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 = 1692; __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 = 1678; __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 = 1692; __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 = 1678; __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));
@@ -57237,7 +56651,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_3 = 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 = 1692; __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 = 1678; __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;
@@ -57247,7 +56661,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L57:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1693
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1679
* 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 # <<<<<<<<<<<<<<
@@ -57257,7 +56671,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = ((__pyx_v_num_gaps < __pyx_v_self->max_nonterminals) != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1694
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1680
* extracts.append((fphr, phrase2, pair_count, tuple(als1)))
* if (num_gaps < self.max_nonterminals and
* phrase_len < self.max_length and # <<<<<<<<<<<<<<
@@ -57267,7 +56681,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_7 = ((__pyx_v_phrase_len < __pyx_v_self->max_length) != 0);
if (__pyx_t_7) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1695
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1681
* 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): # <<<<<<<<<<<<<<
@@ -57285,7 +56699,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
if (__pyx_t_7) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1696
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1682
* 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 # <<<<<<<<<<<<<<
@@ -57295,7 +56709,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_7 = ((__pyx_v_f_back_low == __pyx_v_f_low) != 0);
if (__pyx_t_7) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1697
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1683
* 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 # <<<<<<<<<<<<<<
@@ -57305,7 +56719,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = ((__pyx_v_f_low >= __pyx_v_self->train_min_gap_size) != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1698
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1684
* 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))): # <<<<<<<<<<<<<<
@@ -57335,7 +56749,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1699
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1685
* 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 # <<<<<<<<<<<<<<
@@ -57344,7 +56758,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_f_x_low = (__pyx_v_f_low - __pyx_v_self->train_min_gap_size);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1700
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1686
* ((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 # <<<<<<<<<<<<<<
@@ -57353,7 +56767,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_met_constraints = 1;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1701
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1687
* f_x_low = f_low-self.train_min_gap_size
* met_constraints = 1
* if self.tight_phrases: # <<<<<<<<<<<<<<
@@ -57363,7 +56777,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = (__pyx_v_self->tight_phrases != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1702
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1688
* met_constraints = 1
* if self.tight_phrases:
* while f_x_low >= 0 and f_links_low[f_x_low] == -1: # <<<<<<<<<<<<<<
@@ -57380,7 +56794,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
if (!__pyx_t_18) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1703
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1689
* if self.tight_phrases:
* while f_x_low >= 0 and f_links_low[f_x_low] == -1:
* f_x_low = f_x_low - 1 # <<<<<<<<<<<<<<
@@ -57393,7 +56807,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L65:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1704
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1690
* 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: # <<<<<<<<<<<<<<
@@ -57409,7 +56823,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
if (__pyx_t_7) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1705
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1691
* 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 # <<<<<<<<<<<<<<
@@ -57421,7 +56835,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L68:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1707
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1693
* met_constraints = 0
*
* if (met_constraints and # <<<<<<<<<<<<<<
@@ -57430,17 +56844,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
if ((__pyx_v_met_constraints != 0)) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1708
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1694
*
* 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 = 1708; __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 = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1712
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1698
* 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, # <<<<<<<<<<<<<<
@@ -57451,7 +56865,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
if (__pyx_t_7) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1714
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1700
* self.train_max_initial_size, self.train_max_initial_size,
* 1, 1, 1, 1, 0, 1, 0) == 1) and
* ((not self.tight_phrases) or f_links_low[f_x_low] != -1) and # <<<<<<<<<<<<<<
@@ -57467,17 +56881,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
if (__pyx_t_8) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1715
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1701
* 1, 1, 1, 1, 0, 1, 0) == 1) and
* ((not self.tight_phrases) or f_links_low[f_x_low] != -1) and
* self.find_fixpoint(f_x_low, f_low, # check integrity of new subphrase # <<<<<<<<<<<<<<
* f_links_low, f_links_high, e_links_low, e_links_high,
* -1, -1, e_gap_low, e_gap_high, f_gap_low, f_gap_high,
*/
- __pyx_t_14 = PyInt_FromLong(__pyx_v_f_low); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyInt_FromLong(__pyx_v_f_low); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1719
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1705
* -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, # <<<<<<<<<<<<<<
@@ -57499,7 +56913,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
if (__pyx_t_7) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1721
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1707
* self.train_max_initial_size, self.train_max_initial_size,
* 0, 0, 0, 0, 0, 0, 0)):
* fphr_arr._clear() # <<<<<<<<<<<<<<
@@ -57508,7 +56922,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_clear(__pyx_v_fphr_arr);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1722
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1708
* 0, 0, 0, 0, 0, 0, 0)):
* fphr_arr._clear()
* i = 1 # <<<<<<<<<<<<<<
@@ -57517,35 +56931,35 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_i = 1;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1723
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1709
* 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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); 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_t_1 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1723; __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 = 1709; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1724
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1710
* 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_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1710; __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 = 1724; __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 = 1710; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1725
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1711
* self.findexes.reset()
* self.findexes.append(sym_setindex(self.category, i))
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -57554,7 +56968,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1726
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1712
* self.findexes.append(sym_setindex(self.category, i))
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1 # <<<<<<<<<<<<<<
@@ -57563,27 +56977,27 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_i = (__pyx_v_i + 1);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1727
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1713
* 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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1713; __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 = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1713; __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 = 1727; __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 = 1713; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1728
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1714
* i = i+1
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<<
@@ -57593,7 +57007,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_2 = __pyx_v_phrase->n;
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1729
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1715
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<<
@@ -57603,7 +57017,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_7 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j])) != 0);
if (__pyx_t_7) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1730
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1716
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -57612,7 +57026,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1731
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1717
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i))
* i = i + 1 # <<<<<<<<<<<<<<
@@ -57624,7 +57038,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1733
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1719
* i = i + 1
* else:
* fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<<
@@ -57636,7 +57050,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L72:;
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1734
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1720
* else:
* fphr_arr._append(phrase.syms[j])
* if f_back_high > f_high: # <<<<<<<<<<<<<<
@@ -57646,7 +57060,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_7 = ((__pyx_v_f_back_high > __pyx_v_f_high) != 0);
if (__pyx_t_7) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1735
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1721
* fphr_arr._append(phrase.syms[j])
* if f_back_high > f_high:
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -57655,16 +57069,16 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1736
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1722
* 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_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); 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_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 = 1736; __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 = 1722; __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;
@@ -57672,55 +57086,55 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L73:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1737
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1723
* 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 = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1723; __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_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_DECREF_SET(__pyx_v_fphr, ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_15));
__pyx_t_15 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1740
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1726
* 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_4cdec_2sa_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 = 1738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_XDECREF_SET(__pyx_v_phrase_list, __pyx_t_15);
__pyx_t_15 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1741
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1727
* 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 = 1741; __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;}
__pyx_t_7 = ((__pyx_t_13 > 0) != 0);
if (__pyx_t_7) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1742
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1728
* 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 = 1742; __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 = 1728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (unlikely(__pyx_t_13 == 0)) {
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
@@ -57729,14 +57143,14 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
#ifdef WITH_THREAD
PyGILState_Release(__pyx_gilstate_save);
#endif
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_v_pair_count = (1.0 / __pyx_t_13);
goto __pyx_L74;
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1744
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1730
* pair_count = 1.0 / len(phrase_list)
* else:
* pair_count = 0 # <<<<<<<<<<<<<<
@@ -57747,7 +57161,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L74:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1745
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1731
* else:
* pair_count = 0
* for phrase2, eindexes in phrase_list: # <<<<<<<<<<<<<<
@@ -57758,7 +57172,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__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 = 1745; __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 = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__pyx_t_16 = Py_TYPE(__pyx_t_15)->tp_iternext;
}
@@ -57766,23 +57180,23 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
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 = 1745; __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 = 1731; __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 = 1745; __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 = 1731; __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 = 1745; __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 = 1731; __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 = 1745; __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 = 1731; __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 = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -57798,7 +57212,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(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 = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -57811,16 +57225,16 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_INCREF(__pyx_t_14);
__Pyx_INCREF(__pyx_t_3);
#else
- __pyx_t_14 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1745; __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 = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
- __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
#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 = 1745; __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 = 1731; __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;
@@ -57828,7 +57242,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_GOTREF(__pyx_t_14);
index = 1; __pyx_t_3 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L77_unpacking_failed;
__Pyx_GOTREF(__pyx_t_3);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1745; __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 = 1731; __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;
@@ -57836,7 +57250,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__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 = 1745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L78_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_v_phrase2, __pyx_t_14);
@@ -57844,7 +57258,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_XDECREF_SET(__pyx_v_eindexes, __pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1746
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1732
* pair_count = 0
* for phrase2, eindexes in phrase_list:
* als2 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) # <<<<<<<<<<<<<<
@@ -57853,31 +57267,31 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_t_1 = ((PyObject *)__pyx_v_self->findexes);
__Pyx_INCREF(__pyx_t_1);
- if (!(likely(((__pyx_v_eindexes) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_eindexes, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1), ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_eindexes))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_v_eindexes) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_eindexes, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_1), ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_eindexes))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF_SET(__pyx_v_als2, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_3));
__pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1747
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1733
* 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_3 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1733; __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 = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_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 = 1747; __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 = 1733; __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 = 1747; __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 = 1733; __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));
@@ -57891,7 +57305,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_GIVEREF(__pyx_t_14);
__pyx_t_3 = 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 = 1747; __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 = 1733; __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;
@@ -57904,7 +57318,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L64:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1749
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1735
* extracts.append((fphr, phrase2, pair_count, tuple(als2)))
*
* if (f_back_high == f_high and # <<<<<<<<<<<<<<
@@ -57914,7 +57328,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_7 = ((__pyx_v_f_back_high == __pyx_v_f_high) != 0);
if (__pyx_t_7) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1750
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1736
*
* if (f_back_high == f_high and
* f_sent_len - f_high >= self.train_min_gap_size and # <<<<<<<<<<<<<<
@@ -57924,7 +57338,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_8 = (((__pyx_v_f_sent_len - __pyx_v_f_high) >= __pyx_v_self->train_min_gap_size) != 0);
if (__pyx_t_8) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1751
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1737
* 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))): # <<<<<<<<<<<<<<
@@ -57954,7 +57368,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
if (__pyx_t_8) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1752
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1738
* 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 # <<<<<<<<<<<<<<
@@ -57963,7 +57377,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_f_x_high = (__pyx_v_f_high + __pyx_v_self->train_min_gap_size);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1753
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1739
* ((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 # <<<<<<<<<<<<<<
@@ -57972,7 +57386,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_met_constraints = 1;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1754
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1740
* f_x_high = f_high+self.train_min_gap_size
* met_constraints = 1
* if self.tight_phrases: # <<<<<<<<<<<<<<
@@ -57982,7 +57396,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_8 = (__pyx_v_self->tight_phrases != 0);
if (__pyx_t_8) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1755
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1741
* met_constraints = 1
* if self.tight_phrases:
* while f_x_high <= f_sent_len and f_links_low[f_x_high-1] == -1: # <<<<<<<<<<<<<<
@@ -57999,7 +57413,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
if (!__pyx_t_18) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1756
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1742
* 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 # <<<<<<<<<<<<<<
@@ -58012,7 +57426,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L80:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1757
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1743
* 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: # <<<<<<<<<<<<<<
@@ -58028,7 +57442,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
if (__pyx_t_7) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1758
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1744
* 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 # <<<<<<<<<<<<<<
@@ -58040,7 +57454,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L83:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1760
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1746
* met_constraints = 0
*
* if (met_constraints and # <<<<<<<<<<<<<<
@@ -58049,17 +57463,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
if ((__pyx_v_met_constraints != 0)) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1761
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1747
*
* 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 = 1761; __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 = 1747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1765
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1751
* 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, # <<<<<<<<<<<<<<
@@ -58069,7 +57483,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
if ((((struct __pyx_vtabstruct_4cdec_2sa_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) != 0)) {
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1767
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1753
* 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 # <<<<<<<<<<<<<<
@@ -58085,17 +57499,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
if (__pyx_t_8) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1768
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1754
* 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 = 1768; __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 = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1773
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1759
* 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, # <<<<<<<<<<<<<<
@@ -58118,7 +57532,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
if (__pyx_t_7) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1775
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1761
* self.train_max_initial_size, self.train_max_initial_size,
* 0, 0, 0, 0, 0, 0, 0)):
* fphr_arr._clear() # <<<<<<<<<<<<<<
@@ -58127,7 +57541,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_clear(__pyx_v_fphr_arr);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1776
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1762
* 0, 0, 0, 0, 0, 0, 0)):
* fphr_arr._clear()
* i = 1 # <<<<<<<<<<<<<<
@@ -58136,21 +57550,21 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_i = 1;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1777
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1763
* 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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1763; __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 = 1777; __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 = 1763; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1778
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1764
* i = 1
* self.findexes.reset()
* if f_back_low < f_low: # <<<<<<<<<<<<<<
@@ -58160,7 +57574,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_7 = ((__pyx_v_f_back_low < __pyx_v_f_low) != 0);
if (__pyx_t_7) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1779
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1765
* self.findexes.reset()
* if f_back_low < f_low:
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -58169,7 +57583,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1780
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1766
* if f_back_low < f_low:
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1 # <<<<<<<<<<<<<<
@@ -58178,16 +57592,16 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_i = (__pyx_v_i + 1);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1781
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1767
* 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_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); 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_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 = 1781; __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 = 1767; __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;
@@ -58195,27 +57609,27 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L85:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1782
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1768
* 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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1768; __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 = 1782; __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 = 1768; __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 = 1782; __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 = 1768; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1783
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1769
* self.findexes.append(sym_setindex(self.category, i))
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<<
@@ -58225,7 +57639,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_2 = __pyx_v_phrase->n;
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1784
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1770
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<<
@@ -58235,7 +57649,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_7 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j])) != 0);
if (__pyx_t_7) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1785
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1771
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -58244,7 +57658,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1786
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1772
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i))
* i = i + 1 # <<<<<<<<<<<<<<
@@ -58256,7 +57670,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1788
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1774
* i = i + 1
* else:
* fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<<
@@ -58268,7 +57682,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L88:;
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1789
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1775
* else:
* fphr_arr._append(phrase.syms[j])
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -58277,69 +57691,69 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1790
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1776
* 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_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); 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_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 = 1790; __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 = 1776; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1791
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1777
* 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 = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1777; __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_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_14), NULL); 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_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
__Pyx_DECREF_SET(__pyx_v_fphr, ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_1));
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1794
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1780
* 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_4cdec_2sa_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 = 1792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_XDECREF_SET(__pyx_v_phrase_list, __pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1795
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1781
* 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 = 1795; __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;}
__pyx_t_7 = ((__pyx_t_13 > 0) != 0);
if (__pyx_t_7) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1796
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1782
* 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 = 1796; __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 = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (unlikely(__pyx_t_13 == 0)) {
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
@@ -58348,14 +57762,14 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
#ifdef WITH_THREAD
PyGILState_Release(__pyx_gilstate_save);
#endif
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_v_pair_count = (1.0 / __pyx_t_13);
goto __pyx_L89;
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1798
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1784
* pair_count = 1.0 / len(phrase_list)
* else:
* pair_count = 0 # <<<<<<<<<<<<<<
@@ -58366,7 +57780,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L89:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1799
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1785
* else:
* pair_count = 0
* for phrase2, eindexes in phrase_list: # <<<<<<<<<<<<<<
@@ -58377,7 +57791,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__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 = 1799; __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 = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_16 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -58385,23 +57799,23 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
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 = 1799; __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 = 1785; __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 = 1799; __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 = 1785; __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 = 1799; __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 = 1785; __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 = 1799; __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 = 1785; __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 = 1799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -58417,7 +57831,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(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 = 1799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -58430,16 +57844,16 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_INCREF(__pyx_t_15);
__Pyx_INCREF(__pyx_t_3);
#else
- __pyx_t_15 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1799; __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 = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
#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 = 1799; __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 = 1785; __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;
@@ -58447,7 +57861,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_GOTREF(__pyx_t_15);
index = 1; __pyx_t_3 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L92_unpacking_failed;
__Pyx_GOTREF(__pyx_t_3);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1799; __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 = 1785; __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;
@@ -58455,7 +57869,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__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 = 1799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L93_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_v_phrase2, __pyx_t_15);
@@ -58463,7 +57877,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_XDECREF_SET(__pyx_v_eindexes, __pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1800
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1786
* pair_count = 0
* for phrase2, eindexes in phrase_list:
* als3 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) # <<<<<<<<<<<<<<
@@ -58472,31 +57886,31 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_t_14 = ((PyObject *)__pyx_v_self->findexes);
__Pyx_INCREF(__pyx_t_14);
- if (!(likely(((__pyx_v_eindexes) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_eindexes, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_14), ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_eindexes))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_v_eindexes) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_eindexes, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_14), ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_eindexes))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__Pyx_XDECREF_SET(__pyx_v_als3, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_3));
__pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1801
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1787
* 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_3 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_INCREF(((PyObject *)__pyx_v_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 = 1801; __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 = 1787; __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 = 1801; __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 = 1787; __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));
@@ -58510,7 +57924,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_GIVEREF(__pyx_t_15);
__pyx_t_3 = 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 = 1801; __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 = 1787; __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;
@@ -58523,7 +57937,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L79:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1802
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1788
* 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 # <<<<<<<<<<<<<<
@@ -58533,7 +57947,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_7 = ((__pyx_v_num_gaps < (__pyx_v_self->max_nonterminals - 1)) != 0);
if (__pyx_t_7) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1803
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1789
* extracts.append((fphr, phrase2, pair_count, tuple(als3)))
* if (num_gaps < self.max_nonterminals - 1 and
* phrase_len+1 < self.max_length and # <<<<<<<<<<<<<<
@@ -58543,7 +57957,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_8 = (((__pyx_v_phrase_len + 1) < __pyx_v_self->max_length) != 0);
if (__pyx_t_8) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1804
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1790
* if (num_gaps < self.max_nonterminals - 1 and
* phrase_len+1 < self.max_length and
* f_back_high == f_high and # <<<<<<<<<<<<<<
@@ -58553,7 +57967,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_18 = ((__pyx_v_f_back_high == __pyx_v_f_high) != 0);
if (__pyx_t_18) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1805
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1791
* phrase_len+1 < self.max_length and
* f_back_high == f_high and
* f_back_low == f_low and # <<<<<<<<<<<<<<
@@ -58563,7 +57977,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_9 = ((__pyx_v_f_back_low == __pyx_v_f_low) != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1806
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1792
* 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 # <<<<<<<<<<<<<<
@@ -58573,7 +57987,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__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) != 0);
if (__pyx_t_19) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1807
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1793
* 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 # <<<<<<<<<<<<<<
@@ -58583,7 +57997,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_20 = ((__pyx_v_f_low >= __pyx_v_self->train_min_gap_size) != 0);
if (__pyx_t_20) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1808
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1794
* 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 # <<<<<<<<<<<<<<
@@ -58593,7 +58007,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_21 = ((__pyx_v_f_high <= (__pyx_v_f_sent_len - __pyx_v_self->train_min_gap_size)) != 0);
if (__pyx_t_21) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1809
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1795
* 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))): # <<<<<<<<<<<<<<
@@ -58643,7 +58057,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
if (__pyx_t_8) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1811
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1797
* ((not self.tight_phrases) or (f_links_low[f_low-1] != -1 and f_links_low[f_high] != -1))):
*
* met_constraints = 1 # <<<<<<<<<<<<<<
@@ -58652,7 +58066,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_met_constraints = 1;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1812
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1798
*
* met_constraints = 1
* f_x_low = f_low-self.train_min_gap_size # <<<<<<<<<<<<<<
@@ -58661,7 +58075,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_f_x_low = (__pyx_v_f_low - __pyx_v_self->train_min_gap_size);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1813
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1799
* met_constraints = 1
* f_x_low = f_low-self.train_min_gap_size
* if self.tight_phrases: # <<<<<<<<<<<<<<
@@ -58671,7 +58085,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_8 = (__pyx_v_self->tight_phrases != 0);
if (__pyx_t_8) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1814
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1800
* 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: # <<<<<<<<<<<<<<
@@ -58688,7 +58102,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
if (!__pyx_t_18) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1815
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1801
* if self.tight_phrases:
* while f_x_low >= 0 and f_links_low[f_x_low] == -1:
* f_x_low = f_x_low - 1 # <<<<<<<<<<<<<<
@@ -58701,7 +58115,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L95:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1816
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1802
* 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: # <<<<<<<<<<<<<<
@@ -58711,7 +58125,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_18 = ((__pyx_v_f_x_low < 0) != 0);
if (__pyx_t_18) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1817
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1803
* f_x_low = f_x_low - 1
* if f_x_low < 0:
* met_constraints = 0 # <<<<<<<<<<<<<<
@@ -58723,7 +58137,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L98:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1819
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1805
* met_constraints = 0
*
* f_x_high = f_high+self.train_min_gap_size # <<<<<<<<<<<<<<
@@ -58732,7 +58146,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_f_x_high = (__pyx_v_f_high + __pyx_v_self->train_min_gap_size);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1820
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1806
*
* f_x_high = f_high+self.train_min_gap_size
* if self.tight_phrases: # <<<<<<<<<<<<<<
@@ -58742,7 +58156,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_18 = (__pyx_v_self->tight_phrases != 0);
if (__pyx_t_18) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1821
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1807
* 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: # <<<<<<<<<<<<<<
@@ -58759,7 +58173,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
if (!__pyx_t_7) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1822
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1808
* 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 # <<<<<<<<<<<<<<
@@ -58772,7 +58186,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L99:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1823
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1809
* 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: # <<<<<<<<<<<<<<
@@ -58788,7 +58202,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
if (__pyx_t_8) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1824
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1810
* 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 # <<<<<<<<<<<<<<
@@ -58800,7 +58214,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L102:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1826
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1812
* met_constraints = 0
*
* if (met_constraints and # <<<<<<<<<<<<<<
@@ -58809,17 +58223,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
if ((__pyx_v_met_constraints != 0)) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1827
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1813
*
* 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 = 1827; __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 = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1831
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1817
* 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, # <<<<<<<<<<<<<<
@@ -58830,7 +58244,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_8) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1833
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1819
* self.train_max_initial_size, self.train_max_initial_size,
* 1, 1, 2, 1, 1, 1, 1) == 1) and
* ((not self.tight_phrases) or (f_links_low[f_x_low] != -1 and f_links_low[f_x_high-1] != -1)) and # <<<<<<<<<<<<<<
@@ -58852,17 +58266,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
if (__pyx_t_18) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1834
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1820
* 1, 1, 2, 1, 1, 1, 1) == 1) and
* ((not self.tight_phrases) or (f_links_low[f_x_low] != -1 and f_links_low[f_x_high-1] != -1)) and
* self.find_fixpoint(f_x_low, f_low, # <<<<<<<<<<<<<<
* f_links_low, f_links_high, e_links_low, e_links_high,
* -1, -1, e_gap_low, e_gap_high, f_gap_low, f_gap_high,
*/
- __pyx_t_1 = PyInt_FromLong(__pyx_v_f_low); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1834; __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 = 1820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1838
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1824
* -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, # <<<<<<<<<<<<<<
@@ -58873,17 +58287,17 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_7) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1840
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1826
* self.train_max_initial_size, self.train_max_initial_size,
* 0, 0, 0, 0, 0, 0, 0) and
* self.find_fixpoint(f_high, f_x_high, # <<<<<<<<<<<<<<
* f_links_low, f_links_high, e_links_low, e_links_high,
* -1, -1, e_gap_low+1+num_gaps, e_gap_high+1+num_gaps,
*/
- __pyx_t_1 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1840; __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 = 1826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1845
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1831
* 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, # <<<<<<<<<<<<<<
@@ -58910,7 +58324,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
if (__pyx_t_8) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1847
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1833
* self.train_max_initial_size, self.train_max_initial_size,
* 0, 0, 0, 0, 0, 0, 0)):
* fphr_arr._clear() # <<<<<<<<<<<<<<
@@ -58919,7 +58333,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_clear(__pyx_v_fphr_arr);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1848
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1834
* 0, 0, 0, 0, 0, 0, 0)):
* fphr_arr._clear()
* i = 1 # <<<<<<<<<<<<<<
@@ -58928,35 +58342,35 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_i = 1;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1849
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1835
* 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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); 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_t_15 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1849; __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 = 1835; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1850
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1836
* 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_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1836; __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 = 1850; __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 = 1836; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1851
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1837
* self.findexes.reset()
* self.findexes.append(sym_setindex(self.category, i))
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -58965,7 +58379,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1852
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1838
* self.findexes.append(sym_setindex(self.category, i))
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1 # <<<<<<<<<<<<<<
@@ -58974,27 +58388,27 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_v_i = (__pyx_v_i + 1);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1853
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1839
* 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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1839; __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 = 1853; __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 = 1839; __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 = 1853; __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 = 1839; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1854
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1840
* i = i+1
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<<
@@ -59004,7 +58418,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_2 = __pyx_v_phrase->n;
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1855
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1841
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<<
@@ -59014,7 +58428,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_t_8 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j])) != 0);
if (__pyx_t_8) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1856
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1842
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -59023,7 +58437,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1857
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1843
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i))
* i = i + 1 # <<<<<<<<<<<<<<
@@ -59035,7 +58449,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1859
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1845
* i = i + 1
* else:
* fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<<
@@ -59047,7 +58461,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__pyx_L106:;
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1860
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1846
* else:
* fphr_arr._append(phrase.syms[j])
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -59056,69 +58470,69 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
((struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1861
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1847
* 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_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); 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_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 = 1861; __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 = 1847; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1862
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1848
* 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 = 1862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1848; __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_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_15), NULL); 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_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
__Pyx_DECREF_SET(__pyx_v_fphr, ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_14));
__pyx_t_14 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1865
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1851
* 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_4cdec_2sa_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 = 1863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = ((struct __pyx_vtabstruct_4cdec_2sa_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 = 1849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_XDECREF_SET(__pyx_v_phrase_list, __pyx_t_14);
__pyx_t_14 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1866
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1852
* 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 = 1866; __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;}
__pyx_t_8 = ((__pyx_t_13 > 0) != 0);
if (__pyx_t_8) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1867
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1853
* 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 = 1867; __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 = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (unlikely(__pyx_t_13 == 0)) {
#ifdef WITH_THREAD
PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
@@ -59127,14 +58541,14 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
#ifdef WITH_THREAD
PyGILState_Release(__pyx_gilstate_save);
#endif
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_v_pair_count = (1.0 / __pyx_t_13);
goto __pyx_L107;
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1869
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1855
* pair_count = 1.0 / len(phrase_list)
* else:
* pair_count = 0 # <<<<<<<<<<<<<<
@@ -59145,7 +58559,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L107:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1870
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1856
* else:
* pair_count = 0
* for phrase2, eindexes in phrase_list: # <<<<<<<<<<<<<<
@@ -59156,7 +58570,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__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 = 1870; __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 = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__pyx_t_16 = Py_TYPE(__pyx_t_14)->tp_iternext;
}
@@ -59164,23 +58578,23 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
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 = 1870; __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 = 1856; __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 = 1870; __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 = 1856; __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 = 1870; __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 = 1856; __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 = 1870; __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 = 1856; __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 = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -59196,7 +58610,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(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 = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -59209,16 +58623,16 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_3);
#else
- __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1870; __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 = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
#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 = 1870; __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 = 1856; __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;
@@ -59226,7 +58640,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_GOTREF(__pyx_t_1);
index = 1; __pyx_t_3 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L110_unpacking_failed;
__Pyx_GOTREF(__pyx_t_3);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1870; __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 = 1856; __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;
@@ -59234,7 +58648,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__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 = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L111_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_v_phrase2, __pyx_t_1);
@@ -59242,7 +58656,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_XDECREF_SET(__pyx_v_eindexes, __pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1871
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1857
* pair_count = 0
* for phrase2, eindexes in phrase_list:
* als4 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) # <<<<<<<<<<<<<<
@@ -59251,31 +58665,31 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
__pyx_t_15 = ((PyObject *)__pyx_v_self->findexes);
__Pyx_INCREF(__pyx_t_15);
- if (!(likely(((__pyx_v_eindexes) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_eindexes, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_15), ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_eindexes))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_v_eindexes) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_eindexes, __pyx_ptype_4cdec_2sa_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_4cdec_2sa_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_15), ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_v_eindexes))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_XDECREF_SET(__pyx_v_als4, ((struct __pyx_obj_4cdec_2sa_3_sa_IntList *)__pyx_t_3));
__pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1872
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1858
* 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_3 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(((PyObject *)__pyx_v_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 = 1872; __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 = 1858; __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 = 1872; __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 = 1858; __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));
@@ -59289,7 +58703,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_3 = 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 = 1872; __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 = 1858; __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;
@@ -59311,7 +58725,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1874
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1860
* extracts.append((fphr, phrase2, pair_count, tuple(als4)))
* else:
* reason_for_failure = "Unable to extract basic phrase" # <<<<<<<<<<<<<<
@@ -59326,7 +58740,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
}
__pyx_L33:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1876
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1862
* reason_for_failure = "Unable to extract basic phrase"
*
* free(sent_links) # <<<<<<<<<<<<<<
@@ -59335,7 +58749,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
free(__pyx_v_sent_links);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1877
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1863
*
* free(sent_links)
* free(f_links_low) # <<<<<<<<<<<<<<
@@ -59344,7 +58758,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
free(__pyx_v_f_links_low);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1878
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1864
* free(sent_links)
* free(f_links_low)
* free(f_links_high) # <<<<<<<<<<<<<<
@@ -59353,7 +58767,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
free(__pyx_v_f_links_high);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1879
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1865
* free(f_links_low)
* free(f_links_high)
* free(e_links_low) # <<<<<<<<<<<<<<
@@ -59362,7 +58776,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
free(__pyx_v_e_links_low);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1880
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1866
* free(f_links_high)
* free(e_links_low)
* free(e_links_high) # <<<<<<<<<<<<<<
@@ -59371,7 +58785,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
free(__pyx_v_e_links_high);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1881
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1867
* free(e_links_low)
* free(e_links_high)
* free(f_gap_low) # <<<<<<<<<<<<<<
@@ -59380,7 +58794,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
free(__pyx_v_f_gap_low);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1882
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1868
* free(e_links_high)
* free(f_gap_low)
* free(f_gap_high) # <<<<<<<<<<<<<<
@@ -59389,7 +58803,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
free(__pyx_v_f_gap_high);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1883
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1869
* free(f_gap_low)
* free(f_gap_high)
* free(e_gap_low) # <<<<<<<<<<<<<<
@@ -59398,7 +58812,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
free(__pyx_v_e_gap_low);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1884
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1870
* free(f_gap_high)
* free(e_gap_low)
* free(e_gap_high) # <<<<<<<<<<<<<<
@@ -59407,7 +58821,7 @@ static PyObject *__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract(struct
*/
free(__pyx_v_e_gap_high);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1886
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1872
* free(e_gap_high)
*
* return extracts # <<<<<<<<<<<<<<
@@ -59466,7 +58880,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_26add_instanc
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__f_words,&__pyx_n_s__e_words,&__pyx_n_s__alignment,&__pyx_n_s__ctx_name,0};
PyObject* values[4] = {0,0,0,0};
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1894
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1880
* # Aggregate stats from a training instance
* # (Extract rules, update counts)
* def add_instance(self, f_words, e_words, alignment, ctx_name=None): # <<<<<<<<<<<<<<
@@ -59493,12 +58907,12 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_26add_instanc
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e_words)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("add_instance", 0, 3, 4, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("add_instance", 0, 3, 4, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1880; __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", 0, 3, 4, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("add_instance", 0, 3, 4, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1880; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 3:
if (kw_args > 0) {
@@ -59507,7 +58921,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_26add_instanc
}
}
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 = 1894; __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 = 1880; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -59526,7 +58940,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_26add_instanc
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("add_instance", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("add_instance", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1880; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.add_instance", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -59583,46 +58997,46 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
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 = 1928; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __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 = 1928; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __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 = 1928; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __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 = 1928; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __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 = 1928; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __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 = 1928; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 6); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __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 = 1928; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 7); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __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 = 1928; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 8); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __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 = 1928; __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 = 1914; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -59649,7 +59063,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
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 = 1928; __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 = 1914; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.add_instance.extract", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -59660,7 +59074,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1928
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1914
* # 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): # <<<<<<<<<<<<<<
@@ -59705,33 +59119,33 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__pyx_outer_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance *) __Pyx_CyFunction_GetClosure(__pyx_self);
__pyx_cur_scope = __pyx_outer_scope;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1930
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1916
* 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 = 1930; __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 = 1930; __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 = 1916; __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 = 1916; __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 = 1930; __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 = 1916; __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 = 1930; __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 = 1916; __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 = 1930; __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 = 1916; __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 = 1930; __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 = 1916; __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 = 1930; __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 = 1930; __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 = 1916; __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 = 1916; __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 = 1930; __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 = 1916; __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 = 1930; __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 = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_6 = __pyx_t_5;
} else {
@@ -59739,7 +59153,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
if (__pyx_t_6) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1931
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1917
* # Phrase extraction limits
* if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size:
* return # <<<<<<<<<<<<<<
@@ -59753,41 +59167,41 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
__pyx_L3:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1933
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1919
* 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 = 1933; __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 = 1933; __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 = 1919; __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 = 1919; __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 = 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 = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_3 = ((!__pyx_t_6) != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1935
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1921
* 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 = 1935; __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 = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_3) {
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); 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 = __Pyx_GetItemInt(__pyx_t_4, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__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;
- __pyx_t_4 = PyNumber_Subtract(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1935; __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 = 1921; __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 = 1935; __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 = 1921; __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 = 1935; __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 = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_5 = __pyx_t_6;
} else {
@@ -59795,80 +59209,80 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
if (__pyx_t_5) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1936
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1922
* # 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, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__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_7 = 2;
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, __pyx_t_7, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, __pyx_t_7, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __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 = 1936; __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 = 1922; __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, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1936; __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, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1937
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1923
* 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
*/
- __pyx_t_1 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1937; __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 = 1923; __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 = 1937; __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 = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_4 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_1, __pyx_v_e_i, __pyx_v_e_j, __pyx_v_min_bound, __pyx_v_wc, __pyx_v_links, __pyx_v_nt, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1937; __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 = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_4 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_1, __pyx_v_e_i, __pyx_v_e_j, __pyx_v_min_bound, __pyx_v_wc, __pyx_v_links, __pyx_v_nt, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1938
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1924
* 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_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__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, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_7 = 2;
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, __pyx_t_7, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, __pyx_t_7, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__Pyx_SetItemInt(__pyx_t_4, __pyx_t_7, __pyx_t_1, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_t_4, __pyx_t_7, __pyx_t_1, sizeof(Py_ssize_t), PyInt_FromSsize_t, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1924; __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;
goto __pyx_L5;
}
__pyx_L5:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1941
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1927
* # 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 = 1941; __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 = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_3 = (!__pyx_t_5);
if (__pyx_t_3) {
- __pyx_t_4 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); 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_1 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __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 = 1941; __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 = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_6 = __pyx_t_5;
} else {
@@ -59876,21 +59290,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
if (__pyx_t_6) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1942
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1928
* # 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
*/
- __pyx_t_1 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1942; __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 = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1942; __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 = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- 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_8 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_1, __pyx_v_e_i, __pyx_v_e_j, __pyx_v_min_bound, __pyx_t_4, __pyx_v_links, __pyx_v_nt, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__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 = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_8 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_1, __pyx_v_e_i, __pyx_v_e_j, __pyx_v_min_bound, __pyx_t_4, __pyx_v_links, __pyx_v_nt, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __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_4); __pyx_t_4 = 0;
@@ -59900,7 +59314,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
__pyx_L6:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1943
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1929
* 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 # <<<<<<<<<<<<<<
@@ -59914,27 +59328,27 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
__pyx_L4:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1945
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1931
* 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 = 1945; __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 = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_fe_span) == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fe_span), __pyx_v_f_j); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_GetItem(((PyObject *)__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_2 = __Pyx_GetItemInt(__pyx_t_8, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_v_link_i = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1946
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1932
* # Aligned word
* link_i = fe_span[f_j][0]
* link_j = fe_span[f_j][1] # <<<<<<<<<<<<<<
@@ -59943,17 +59357,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
*/
if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_fe_span) == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fe_span), __pyx_v_f_j); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fe_span), __pyx_v_f_j); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_link_j = __pyx_t_8;
__pyx_t_8 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1947
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1933
* link_i = fe_span[f_j][0]
* link_j = fe_span[f_j][1]
* new_e_i = min(link_i, e_i) # <<<<<<<<<<<<<<
@@ -59964,8 +59378,8 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__pyx_t_8 = __pyx_v_e_i;
__Pyx_INCREF(__pyx_v_link_i);
__pyx_t_2 = __pyx_v_link_i;
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_8, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_8, __pyx_t_2, Py_LT); __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_8);
@@ -59982,7 +59396,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__pyx_v_new_e_i = __pyx_t_8;
__pyx_t_8 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1948
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1934
* link_j = fe_span[f_j][1]
* new_e_i = min(link_i, e_i)
* new_e_j = max(link_j, e_j) # <<<<<<<<<<<<<<
@@ -59993,8 +59407,8 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__pyx_t_8 = __pyx_v_e_j;
__Pyx_INCREF(__pyx_v_link_j);
__pyx_t_4 = __pyx_v_link_j;
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_8, __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_t_1 = PyObject_RichCompare(__pyx_t_8, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1934; __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 = 1934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_6) {
__Pyx_INCREF(__pyx_t_8);
@@ -60011,7 +59425,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__pyx_v_new_e_j = __pyx_t_8;
__pyx_t_8 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1951
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1937
* # 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 # <<<<<<<<<<<<<<
@@ -60021,57 +59435,57 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_INCREF(__pyx_v_min_bound);
__pyx_v_new_min_bound = __pyx_v_min_bound;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1953
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1939
* 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 = 1953; __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 = 1953; __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 = 1939; __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 = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (__pyx_t_6) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1954
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1940
* # 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 = 1954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_v_new_e_j); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_v_new_e_i); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1940; __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 = 1940; __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 = 1954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_8);
__pyx_t_8 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1955
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1941
* 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 = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (unlikely(!__pyx_cur_scope->__pyx_v_ef_span)) { __Pyx_RaiseClosureNameError("ef_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span) == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_v_f_i, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_v_f_i, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (__pyx_t_6) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1956
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1942
* for i from new_e_i <= i <= new_e_j:
* if ef_span[i][0] < f_i:
* return # <<<<<<<<<<<<<<
@@ -60085,7 +59499,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
__pyx_L10:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1957
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1943
* if ef_span[i][0] < f_i:
* return
* new_min_bound = max(new_min_bound, ef_span[i][1]) # <<<<<<<<<<<<<<
@@ -60094,17 +59508,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
*/
if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span) == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1943; __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 = 1957; __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 = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_8, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_6) {
__Pyx_INCREF(__pyx_t_2);
@@ -60120,17 +59534,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF_SET(__pyx_v_new_min_bound, __pyx_t_2);
__pyx_t_2 = 0;
- __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1954
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1940
* # 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_2 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
__pyx_t_2 = 0;
@@ -60138,45 +59552,45 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
/*else*/ {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1960
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1946
* # 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 = 1960; __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 = 1960; __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 = 1946; __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 = 1946; __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_2 = PyInt_FromLong(__pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong(__pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1961
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1947
* 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 = 1961; __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 = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span) == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __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_RichCompare(__pyx_t_4, __pyx_v_f_i, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_v_f_i, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_6) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1962
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1948
* for i from new_e_i <= i < e_i:
* if ef_span[i][0] < f_i:
* return # <<<<<<<<<<<<<<
@@ -60190,7 +59604,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
__pyx_L13:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1963
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1949
* if ef_span[i][0] < f_i:
* return
* new_min_bound = max(new_min_bound, ef_span[i][1]) # <<<<<<<<<<<<<<
@@ -60199,17 +59613,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
*/
if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span) == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_INCREF(__pyx_v_new_min_bound);
__pyx_t_2 = __pyx_v_new_min_bound;
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __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 = 1949; __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);
@@ -60225,60 +59639,60 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF_SET(__pyx_v_new_min_bound, __pyx_t_4);
__pyx_t_4 = 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 = 1960; __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 = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1960
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1946
* # 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_4 = PyInt_FromLong(__pyx_t_9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1960; __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 = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
__pyx_t_4 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1964
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1950
* 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 = 1964; __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 = 1964; __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 = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_v_new_e_j); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
for (__pyx_t_11 = __pyx_t_9+1; __pyx_t_11 <= __pyx_t_10; __pyx_t_11++) {
- __pyx_t_4 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
__pyx_t_4 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1965
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1951
* 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 = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (unlikely(!__pyx_cur_scope->__pyx_v_ef_span)) { __Pyx_RaiseClosureNameError("ef_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span) == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_RichCompare(__pyx_t_8, __pyx_v_f_i, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_t_8, __pyx_v_f_i, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_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 = 1965; __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 = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_6) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1966
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1952
* for i from e_j < i <= new_e_j:
* if ef_span[i][0] < f_i:
* return # <<<<<<<<<<<<<<
@@ -60292,7 +59706,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
__pyx_L16:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1967
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1953
* if ef_span[i][0] < f_i:
* return
* new_min_bound = max(new_min_bound, ef_span[i][1]) # <<<<<<<<<<<<<<
@@ -60301,17 +59715,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
*/
if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span) == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_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_8, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1967; __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 = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_8, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_6) {
__Pyx_INCREF(__pyx_t_8);
@@ -60327,35 +59741,35 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF_SET(__pyx_v_new_min_bound, __pyx_t_8);
__pyx_t_8 = 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 = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1964
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1950
* 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_8 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_8);
__pyx_t_8 = 0;
}
__pyx_L7:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1969
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1955
* 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 = 1969; __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 = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_3 = ((!__pyx_t_6) != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1970
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1956
* # Extract, extend with word (unless non-terminal open)
* if not nt_open:
* nt_collision = False # <<<<<<<<<<<<<<
@@ -60364,20 +59778,20 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
*/
__pyx_v_nt_collision = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1971
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1957
* if not nt_open:
* nt_collision = False
* for link in al[f_j]: # <<<<<<<<<<<<<<
* if e_nt_cover[link]:
* nt_collision = True
*/
- __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __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_2 = __pyx_t_8; __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_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_12 = Py_TYPE(__pyx_t_2)->tp_iternext;
}
@@ -60386,23 +59800,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
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_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_8); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_8); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __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_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_8); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_8); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_8 = __pyx_t_12(__pyx_t_2);
if (unlikely(!__pyx_t_8)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -60411,25 +59825,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_8);
__pyx_t_8 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1972
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1958
* 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 = 1972; __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 = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover) == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover), __pyx_v_link); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover), __pyx_v_link); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __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 = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1973
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1959
* for link in al[f_j]:
* if e_nt_cover[link]:
* nt_collision = True # <<<<<<<<<<<<<<
@@ -60443,7 +59857,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1976
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1962
* # 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: # <<<<<<<<<<<<<<
@@ -60452,11 +59866,11 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
*/
__pyx_t_3 = (!(__pyx_v_nt_collision != 0));
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 = 1976; __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 = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_8 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1962; __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 = 1976; __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 = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_5 = __pyx_t_6;
} else {
@@ -60464,32 +59878,32 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
if (__pyx_t_5) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1977
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1963
* # 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_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__pyx_v_plus_links = ((PyObject*)__pyx_t_8);
__pyx_t_8 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1978
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1964
* 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_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __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_2 = __pyx_t_8; __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_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_12 = Py_TYPE(__pyx_t_2)->tp_iternext;
}
@@ -60498,23 +59912,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
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_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_8); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_8); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __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_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_8); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_8); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_8 = __pyx_t_12(__pyx_t_2);
if (unlikely(!__pyx_t_8)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -60523,14 +59937,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_8);
__pyx_t_8 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1979
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1965
* plus_links = []
* for link in al[f_j]:
* plus_links.append((f_j, link)) # <<<<<<<<<<<<<<
* cover[link] += 1
* links.append(plus_links)
*/
- __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(__pyx_v_f_j);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_f_j);
@@ -60538,20 +59952,20 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_INCREF(__pyx_v_link);
PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_link);
__Pyx_GIVEREF(__pyx_v_link);
- __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_plus_links, ((PyObject *)__pyx_t_8)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_plus_links, ((PyObject *)__pyx_t_8)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1980
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1966
* for link in al[f_j]:
* plus_links.append((f_j, link))
* cover[link] += 1 # <<<<<<<<<<<<<<
* links.append(plus_links)
* if links and f_j >= new_min_bound:
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __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 = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_cover) == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover));
__pyx_t_14 = __pyx_cur_scope->__pyx_v_cover;
@@ -60559,46 +59973,46 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__pyx_t_8 = __pyx_v_link;
if (unlikely(((PyObject *)__pyx_t_14) == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_t_14), __pyx_t_8); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_t_14), __pyx_t_8); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (unlikely(((PyObject *)__pyx_t_14) == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- if (PyObject_SetItem(((PyObject *)__pyx_t_14), __pyx_t_8, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(((PyObject *)__pyx_t_14), __pyx_t_8, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1981
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1967
* 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 = 1981; __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 = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1982
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1968
* 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 = 1982; __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 = 1968; __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 = 1982; __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 = 1982; __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 = 1968; __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 = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_6 = __pyx_t_3;
} else {
@@ -60606,33 +60020,33 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
if (__pyx_t_6) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1983
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1969
* 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 = 1983; __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 = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_rules) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "add");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__form_rule); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__form_rule); 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);
- if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __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 = 1983; __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 = 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_1 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_f_words, 0, 0, &__pyx_v_f_i, &__pyx_t_8, NULL, 0, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_f_words, 0, 0, &__pyx_v_f_i, &__pyx_t_8, NULL, 0, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __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_e_words)) { __Pyx_RaiseClosureNameError("e_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __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 = 1983; __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 = 1969; __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 = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_e_words, 0, 0, &__pyx_v_new_e_i, &__pyx_t_8, NULL, 0, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_e_words, 0, 0, &__pyx_v_new_e_i, &__pyx_t_8, NULL, 0, 0, 1); 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_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyTuple_New(6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_New(6); 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_INCREF(__pyx_v_f_i);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_f_i);
@@ -60652,62 +60066,62 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_GIVEREF(__pyx_v_links);
__pyx_t_1 = 0;
__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 = 1983; __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 = 1969; __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_t_13 = PySet_Add(__pyx_cur_scope->__pyx_v_rules, __pyx_t_4); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PySet_Add(__pyx_cur_scope->__pyx_v_rules, __pyx_t_4); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
goto __pyx_L24;
}
__pyx_L24:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1984
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1970
* 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]:
*/
- __pyx_t_4 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __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 = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __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 = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_1 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_4, __pyx_v_new_e_i, __pyx_v_new_e_j, __pyx_v_new_min_bound, __pyx_t_8, __pyx_v_links, __pyx_v_nt, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __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 = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_1 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_4, __pyx_v_new_e_i, __pyx_v_new_e_j, __pyx_v_new_min_bound, __pyx_t_8, __pyx_v_links, __pyx_v_nt, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1985
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1971
* 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_1 = __Pyx_PyObject_Pop(__pyx_v_links); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Pop(__pyx_v_links); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1986
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1972
* 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_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
__pyx_t_2 = __pyx_t_1; __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_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_12 = Py_TYPE(__pyx_t_2)->tp_iternext;
}
@@ -60716,23 +60130,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
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_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __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_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_1 = __pyx_t_12(__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 = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -60741,17 +60155,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1987
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1973
* links.pop()
* for link in al[f_j]:
* 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:
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __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 = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_cover) == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover));
__pyx_t_14 = __pyx_cur_scope->__pyx_v_cover;
@@ -60759,18 +60173,18 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__pyx_t_1 = __pyx_v_link;
if (unlikely(((PyObject *)__pyx_t_14) == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_t_14), __pyx_t_1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_GetItem(((PyObject *)__pyx_t_14), __pyx_t_1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (unlikely(((PyObject *)__pyx_t_14) == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- if (PyObject_SetItem(((PyObject *)__pyx_t_14), __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(((PyObject *)__pyx_t_14), __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __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;
__Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
@@ -60783,26 +60197,26 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
__pyx_L17:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1989
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1975
* 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 = 1989; __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 = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_6) {
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Subtract(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Subtract(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __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 = 1989; __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 = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_3 = __pyx_t_5;
} else {
@@ -60810,70 +60224,70 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1991
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1977
* 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_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_4, 0, 0, NULL, NULL, &__pyx_k_slice_141, 0, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_4, 0, 0, NULL, NULL, &__pyx_k_slice_141, 0, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_old_last_nt = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1992
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1978
* # 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_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- if (__Pyx_SetItemInt(__pyx_t_2, 2, __pyx_v_f_j, sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_t_2, 2, __pyx_v_f_j, sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1993
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1979
* 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_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); 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_t_4 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); 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_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_RichCompare(__pyx_v_link_i, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_RichCompare(__pyx_v_link_i, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__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_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __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 = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1994
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1980
* 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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_check); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_check); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __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 = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_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 = 1994; __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 = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_cover));
@@ -60884,25 +60298,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
__Pyx_GIVEREF(__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 = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __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_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __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 = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_6 = ((!__pyx_t_3) != 0);
if (__pyx_t_6) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1995
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1981
* 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, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, sizeof(long), PyInt_FromLong, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1996
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1982
* if not span_check(cover, link_i, nt[-1][3] - 1):
* nt[-1] = old_last_nt
* return # <<<<<<<<<<<<<<
@@ -60916,24 +60330,24 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
__pyx_L29:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1997
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1983
* 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_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_inc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_inc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __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_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__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 = 1997; __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 = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_cover));
@@ -60944,31 +60358,31 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __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_2)); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1998
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1984
* 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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_inc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_inc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __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 = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __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, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __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 = 1998; __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 = 1984; __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 = 1998; __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 = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover));
@@ -60979,64 +60393,64 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
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_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __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 = 1984; __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;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1999
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1985
* 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_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); 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_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- if (__Pyx_SetItemInt(__pyx_t_2, 3, __pyx_v_link_i, sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_t_2, 3, __pyx_v_link_i, sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
goto __pyx_L28;
}
__pyx_L28:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2000
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1986
* 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_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); 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_t_4 = __Pyx_GetItemInt(__pyx_t_2, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __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_RichCompare(__pyx_v_link_j, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_RichCompare(__pyx_v_link_j, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); 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_2); __pyx_t_2 = 0;
if (__pyx_t_6) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2001
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1987
* 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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_check); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_check); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("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, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __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 = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__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_1 = __Pyx_GetItemInt(__pyx_t_4, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __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 = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_cover));
@@ -61047,25 +60461,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
PyTuple_SET_ITEM(__pyx_t_1, 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_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __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 = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_3 = ((!__pyx_t_6) != 0);
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2002
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1988
* 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, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, sizeof(long), PyInt_FromLong, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2003
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1989
* if not span_check(cover, nt[-1][4] + 1, link_j):
* nt[-1] = old_last_nt
* return # <<<<<<<<<<<<<<
@@ -61079,24 +60493,24 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
__pyx_L31:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2004
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1990
* 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_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_inc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_inc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); 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_t_1, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __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 = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__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 = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_cover));
@@ -61107,31 +60521,31 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_link_j);
__Pyx_GIVEREF(__pyx_v_link_j);
__pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __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_2)); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2005
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1991
* 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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_inc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_inc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __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 = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __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 = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __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, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __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 = 2005; __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 = 1991; __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 = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover));
@@ -61142,38 +60556,38 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
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_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __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 = 1991; __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;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2006
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1992
* 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_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- if (__Pyx_SetItemInt(__pyx_t_2, 4, __pyx_v_link_j, sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_t_2, 4, __pyx_v_link_j, sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
goto __pyx_L30;
}
__pyx_L30:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2007
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1993
* 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 = 2007; __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 = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_3) {
- __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 = 2007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2007; __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 = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__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_5 = __pyx_t_6;
} else {
@@ -61181,33 +60595,33 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
if (__pyx_t_5) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2008
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1994
* 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 = 2008; __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 = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_rules) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "add");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__form_rule); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__form_rule); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __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 = 2008; __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 = 1994; __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 = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_f_words, 0, 0, &__pyx_v_f_i, &__pyx_t_4, NULL, 0, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_f_words, 0, 0, &__pyx_v_f_i, &__pyx_t_4, NULL, 0, 0, 1); 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(__pyx_t_4); __pyx_t_4 = 0;
- if (unlikely(!__pyx_cur_scope->__pyx_v_e_words)) { __Pyx_RaiseClosureNameError("e_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_4 = PyNumber_Add(__pyx_v_new_e_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __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 = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_4 = PyNumber_Add(__pyx_v_new_e_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_e_words, 0, 0, &__pyx_v_new_e_i, &__pyx_t_4, NULL, 0, 0, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_e_words, 0, 0, &__pyx_v_new_e_i, &__pyx_t_4, NULL, 0, 0, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(6); 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);
@@ -61227,80 +60641,80 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_GIVEREF(__pyx_v_links);
__pyx_t_1 = 0;
__pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_13 = PySet_Add(__pyx_cur_scope->__pyx_v_rules, __pyx_t_8); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PySet_Add(__pyx_cur_scope->__pyx_v_rules, __pyx_t_8); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
goto __pyx_L32;
}
__pyx_L32:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2009
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1995
* 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]:
*/
- __pyx_t_8 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __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 = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __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 = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_2 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_8, __pyx_v_new_e_i, __pyx_v_new_e_j, __pyx_v_new_min_bound, __pyx_v_wc, __pyx_v_links, __pyx_v_nt, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __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 = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_2 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_8, __pyx_v_new_e_i, __pyx_v_new_e_j, __pyx_v_new_min_bound, __pyx_v_wc, __pyx_v_links, __pyx_v_nt, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __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_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2010
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1996
* 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, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, sizeof(long), PyInt_FromLong, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2011
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1997
* 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_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); 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_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_RichCompare(__pyx_v_link_i, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_RichCompare(__pyx_v_link_i, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_5) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2012
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1998
* 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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_dec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_dec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __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 = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __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, 0, 0, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __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 = 2012; __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 = 1998; __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 = 2012; __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 = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover));
PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_cover));
@@ -61311,31 +60725,31 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
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 = 2012; __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 = 1998; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2013
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1999
* 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_GetModuleGlobalName(__pyx_n_s__span_dec); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_dec); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __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, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __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 = 2013; __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 = 1999; __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 = 2013; __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 = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover));
@@ -61346,7 +60760,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
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 = 2013; __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 = 1999; __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;
@@ -61355,43 +60769,43 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
__pyx_L33:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2014
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2000
* 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_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); 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_t_8, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyObject_RichCompare(__pyx_v_link_j, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_RichCompare(__pyx_v_link_j, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __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 = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (__pyx_t_5) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2015
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2001
* 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_8 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_dec); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_dec); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2015; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2015; __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 = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __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, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_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 = 2015; __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 = 2001; __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 = 2015; __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 = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_cover));
@@ -61402,31 +60816,31 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
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 = 2015; __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 = 2001; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2016
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2002
* 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_2 = __Pyx_GetModuleGlobalName(__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_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_dec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __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 = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2016; __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 = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __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, 0, 0, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __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 = 2016; __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 = 2002; __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 = 2016; __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 = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover));
PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover));
@@ -61437,7 +60851,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
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 = 2016; __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 = 2002; __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;
@@ -61449,41 +60863,41 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
__pyx_L27:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2018
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2004
* 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 = 2018; __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 = 2004; __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, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __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_v_f_j, __pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Subtract(__pyx_v_f_j, __pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyObject_RichCompare(__pyx_t_4, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_RichCompare(__pyx_t_4, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__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 = 2018; __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 = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_6 = __pyx_t_5;
} else {
__pyx_t_6 = __pyx_t_3;
}
if (__pyx_t_6) {
- __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_8, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_8, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __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 = 2018; __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 = 2004; __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 = 2018; __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 = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_5 = (__pyx_t_7 < __pyx_cur_scope->__pyx_v_self->max_nonterminals);
__pyx_t_15 = __pyx_t_5;
} else {
@@ -61495,17 +60909,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2020
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2006
* 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_GetModuleGlobalName(__pyx_n_s__span_check); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_check); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __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 = 2020; __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 = 2020; __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 = 2006; __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 = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover));
PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_cover));
@@ -61516,16 +60930,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_INCREF(__pyx_v_link_j);
PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_link_j);
__Pyx_GIVEREF(__pyx_v_link_j);
- __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2020; __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 = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_6 = ((!__pyx_t_3) != 0);
if (__pyx_t_6) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2021
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2007
* # Check for collisions
* if not span_check(cover, link_i, link_j):
* return # <<<<<<<<<<<<<<
@@ -61539,16 +60953,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
__pyx_L36:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2022
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2008
* 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_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_inc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_inc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2022; __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 = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover));
PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_cover));
@@ -61559,23 +60973,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_INCREF(__pyx_v_link_j);
PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_link_j);
__Pyx_GIVEREF(__pyx_v_link_j);
- __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 = 2022; __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 = 2008; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2023
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2009
* 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_GetModuleGlobalName(__pyx_n_s__span_inc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_inc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2023; __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 = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover));
PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover));
@@ -61586,27 +61000,27 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_INCREF(__pyx_v_link_j);
PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_link_j);
__Pyx_GIVEREF(__pyx_v_link_j);
- __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2024
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2010
* 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 = 2024; __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 = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_6) {
- __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_8, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_8, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_2 = __pyx_t_8;
@@ -61615,7 +61029,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_INCREF(__pyx_int_1);
__pyx_t_2 = __pyx_int_1;
}
- __pyx_t_8 = PyList_New(5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyList_New(5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
@@ -61632,22 +61046,22 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
PyList_SET_ITEM(__pyx_t_8, 4, __pyx_v_link_j);
__Pyx_GIVEREF(__pyx_v_link_j);
__pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_nt, ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_nt, ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2026
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2012
* 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 = 2026; __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 = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_6) {
- __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 = 2026; __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 = 2026; __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 = 2012; __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 = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_15 = __pyx_t_3;
} else {
@@ -61655,33 +61069,33 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
}
if (__pyx_t_15) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2027
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2013
* # 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 = 2027; __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 = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_rules) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "add");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__form_rule); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__form_rule); 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);
- if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2027; __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 = 2027; __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 = 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_4 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_f_words, 0, 0, &__pyx_v_f_i, &__pyx_t_8, NULL, 0, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_f_words, 0, 0, &__pyx_v_f_i, &__pyx_t_8, NULL, 0, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (unlikely(!__pyx_cur_scope->__pyx_v_e_words)) { __Pyx_RaiseClosureNameError("e_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2027; __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 = 2027; __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 = 2013; __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 = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_e_words, 0, 0, &__pyx_v_new_e_i, &__pyx_t_8, NULL, 0, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_cur_scope->__pyx_v_e_words, 0, 0, &__pyx_v_new_e_i, &__pyx_t_8, NULL, 0, 0, 1); 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(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyTuple_New(6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_New(6); 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_INCREF(__pyx_v_f_i);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_f_i);
@@ -61701,58 +61115,58 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_GIVEREF(__pyx_v_links);
__pyx_t_4 = 0;
__pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_8), 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(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
- __pyx_t_13 = PySet_Add(__pyx_cur_scope->__pyx_v_rules, __pyx_t_1); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PySet_Add(__pyx_cur_scope->__pyx_v_rules, __pyx_t_1); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L37;
}
__pyx_L37:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2028
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2014
* 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)
*/
- __pyx_t_1 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __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 = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_8 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __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 = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_4 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_1, __pyx_v_new_e_i, __pyx_v_new_e_j, __pyx_v_new_min_bound, __pyx_t_8, __pyx_v_links, __pyx_v_nt, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __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 = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_4 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_1, __pyx_v_new_e_i, __pyx_v_new_e_j, __pyx_v_new_min_bound, __pyx_t_8, __pyx_v_links, __pyx_v_nt, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2029
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2015
* 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_4 = __Pyx_PyObject_Pop(__pyx_v_nt); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Pop(__pyx_v_nt); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2030
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2016
* 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_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_dec); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_dec); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2030; __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 = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_cover));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_cover));
@@ -61763,22 +61177,22 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_INCREF(__pyx_v_link_j);
PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_link_j);
__Pyx_GIVEREF(__pyx_v_link_j);
- __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 = 2030; __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 = 2016; __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_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2031
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2017
* 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_8 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_dec); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s__span_dec); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __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 = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_e_nt_cover));
@@ -61789,7 +61203,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
__Pyx_INCREF(__pyx_v_link_j);
PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_link_j);
__Pyx_GIVEREF(__pyx_v_link_j);
- __pyx_t_4 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
@@ -61823,7 +61237,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instanc
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1894
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1880
* # Aggregate stats from a training instance
* # (Extract rules, update counts)
* def add_instance(self, f_words, e_words, alignment, ctx_name=None): # <<<<<<<<<<<<<<
@@ -61837,23 +61251,14 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
PyObject *__pyx_v_f = NULL;
PyObject *__pyx_v_e = NULL;
CYTHON_UNUSED PyObject *__pyx_v_f_nt_cover = NULL;
- PyObject *__pyx_v_f_i = NULL;
+ long __pyx_v_f_i;
PyObject *__pyx_v_stats = NULL;
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;
- PyObject *__pyx_v_aligned_fe = NULL;
- PyObject *__pyx_v_aligned_ef = NULL;
- int __pyx_v_null_word;
- PyObject *__pyx_v_i = NULL;
- PyObject *__pyx_v_j = NULL;
- PyObject *__pyx_v_e_i_aligned = NULL;
- PyObject *__pyx_v_lc = NULL;
- PyObject *__pyx_v_e_i = NULL;
- PyObject *__pyx_v_f_i_aligned = NULL;
- CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
+ CYTHON_UNUSED PyObject *__pyx_v_i = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
@@ -61866,13 +61271,10 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
PyObject *(*__pyx_t_8)(PyObject *);
int __pyx_t_9;
long __pyx_t_10;
- long __pyx_t_11;
- int __pyx_t_12;
+ int __pyx_t_11;
+ PyObject *__pyx_t_12 = NULL;
PyObject *__pyx_t_13 = NULL;
- Py_ssize_t __pyx_t_14;
- PyObject *(*__pyx_t_15)(PyObject *);
- PyObject *__pyx_t_16 = NULL;
- int __pyx_t_17;
+ PyObject *__pyx_t_14 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
@@ -61893,7 +61295,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_e_words);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e_words);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1896
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1882
* def add_instance(self, f_words, e_words, alignment, ctx_name=None):
*
* self.online = True # <<<<<<<<<<<<<<
@@ -61902,20 +61304,20 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
*/
__pyx_cur_scope->__pyx_v_self->online = 1;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1903
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1889
* # 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 = 1903; __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 = 1889; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1905
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1891
* rules = set()
*
* f_len = len(f_words) # <<<<<<<<<<<<<<
@@ -61924,15 +61326,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
*/
__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 = 1905; __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 = 1905; __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_GIVEREF(__pyx_t_1);
__pyx_cur_scope->__pyx_v_f_len = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1906
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1892
*
* f_len = len(f_words)
* e_len = len(e_words) # <<<<<<<<<<<<<<
@@ -61941,35 +61343,35 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
*/
__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 = 1906; __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 = 1892; __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 = 1906; __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 = 1892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_e_len = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1909
+ /* "/home/mdenkows/cdec/python/cdec/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)]
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1909; __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 = 1909; __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 = 1909; __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 = 1909; __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;
}
@@ -61978,23 +61380,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
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 = 1909; __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 = 1909; __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 = 1909; __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 = 1909; __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 = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -62002,9 +61404,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
}
__Pyx_XDECREF_SET(__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 = 1909; __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 = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __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;
@@ -62012,28 +61414,28 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__pyx_cur_scope->__pyx_v_al = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1910
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1896
* # 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 = 1910; __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 = 1910; __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_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 = 1910; __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 = 1896; __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 = 1910; __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 = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
}
@@ -62042,23 +61444,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
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 = 1910; __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 = 1896; __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 = 1910; __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 = 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_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 = 1910; __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 = 1896; __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 = 1910; __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 = 1896; __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 = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -62066,9 +61468,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
}
__Pyx_XDECREF_SET(__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 = 1910; __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 = 1896; __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 = 1910; __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 = 1896; __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);
@@ -62076,7 +61478,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
PyList_SET_ITEM(__pyx_t_6, 1, __pyx_int_neg_1);
__Pyx_GIVEREF(__pyx_int_neg_1);
__pyx_t_4 = 0;
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __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;
@@ -62084,28 +61486,28 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__pyx_cur_scope->__pyx_v_fe_span = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1911
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1897
* 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 = 1911; __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 = 1897; __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 = 1911; __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 = 1897; __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 = 1911; __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 = 1897; __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 = 1911; __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 = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
}
@@ -62114,23 +61516,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
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 = 1911; __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 = 1897; __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 = 1911; __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 = 1897; __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 = 1911; __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 = 1897; __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 = 1911; __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 = 1897; __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 = 1911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -62138,9 +61540,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
}
__Pyx_XDECREF_SET(__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 = 1911; __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 = 1897; __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 = 1911; __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 = 1897; __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);
@@ -62148,7 +61550,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
PyList_SET_ITEM(__pyx_t_4, 1, __pyx_int_neg_1);
__Pyx_GIVEREF(__pyx_int_neg_1);
__pyx_t_6 = 0;
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __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;
@@ -62156,7 +61558,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__pyx_cur_scope->__pyx_v_ef_span = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1912
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1898
* 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: # <<<<<<<<<<<<<<
@@ -62167,7 +61569,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__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 = 1912; __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 = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -62175,23 +61577,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
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 = 1912; __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 = 1898; __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 = 1912; __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 = 1898; __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 = 1912; __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 = 1898; __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 = 1912; __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 = 1898; __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 = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -62207,7 +61609,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -62220,16 +61622,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__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 = 1912; __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 = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1912; __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 = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
#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 = 1912; __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 = 1898; __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;
@@ -62237,7 +61639,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__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 = 1912; __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 = 1898; __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;
@@ -62245,7 +61647,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__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 = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L12_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_4);
@@ -62253,21 +61655,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__Pyx_XDECREF_SET(__pyx_v_e, __pyx_t_6);
__pyx_t_6 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1913
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1899
* 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 = 1913; __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 = 1899; __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 = 1913; __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 = 1899; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1914
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1900
* for f, e in alignment:
* al[f].append(e)
* fe_span[f][0] = min(fe_span[f][0], e) # <<<<<<<<<<<<<<
@@ -62276,13 +61678,13 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
*/
__Pyx_INCREF(__pyx_v_e);
__pyx_t_6 = __pyx_v_e;
- __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fe_span), __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(((PyObject *)__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);
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); 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_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 = 1914; __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 = 1914; __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 = 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_6);
@@ -62296,13 +61698,13 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__pyx_t_6 = __pyx_t_3;
__Pyx_INCREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fe_span), __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(((PyObject *)__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, 0, __pyx_t_6, sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_t_3, 0, __pyx_t_6, sizeof(long), PyInt_FromLong, 0, 0, 1) < 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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1915
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1901
* al[f].append(e)
* fe_span[f][0] = min(fe_span[f][0], e)
* fe_span[f][1] = max(fe_span[f][1], e) # <<<<<<<<<<<<<<
@@ -62311,13 +61713,13 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
*/
__Pyx_INCREF(__pyx_v_e);
__pyx_t_6 = __pyx_v_e;
- __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fe_span), __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fe_span), __pyx_v_f); 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, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); 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_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __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 = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_GT); __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);
@@ -62331,13 +61733,13 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__pyx_t_6 = __pyx_t_3;
__Pyx_INCREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fe_span), __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_fe_span), __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __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, 0, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_t_3, 1, __pyx_t_6, sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1916
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1902
* 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) # <<<<<<<<<<<<<<
@@ -62346,13 +61748,13 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
*/
__Pyx_INCREF(__pyx_v_f);
__pyx_t_6 = __pyx_v_f;
- __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_e); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(((PyObject *)__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);
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); 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_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 = 1916; __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 = 1916; __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 = 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_6);
@@ -62366,13 +61768,13 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__pyx_t_6 = __pyx_t_3;
__Pyx_INCREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_e); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(((PyObject *)__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, 0, __pyx_t_6, sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_t_3, 0, __pyx_t_6, sizeof(long), PyInt_FromLong, 0, 0, 1) < 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;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1917
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1903
* 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) # <<<<<<<<<<<<<<
@@ -62381,13 +61783,13 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
*/
__Pyx_INCREF(__pyx_v_f);
__pyx_t_6 = __pyx_v_f;
- __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_e); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_e); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1903; __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_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1917; __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 = 1917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1903; __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 = 1903; __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);
@@ -62401,27 +61803,27 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__pyx_t_6 = __pyx_t_3;
__Pyx_INCREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_e); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_ef_span), __pyx_v_e); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1903; __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, 0, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_t_3, 1, __pyx_t_6, sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1903; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1920
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1906
*
* # 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 = 1920; __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 = 1906; __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 = 1920; __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 = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_temp);
__Pyx_DECREF(__pyx_t_1);
__pyx_t_1 = __pyx_temp;
@@ -62430,19 +61832,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__pyx_cur_scope->__pyx_v_cover = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1922
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1908
* 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 = 1922; __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_cur_scope->__pyx_v_f_len); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __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 = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_temp);
__Pyx_DECREF(__pyx_t_1);
__pyx_t_1 = __pyx_temp;
@@ -62450,19 +61852,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__pyx_v_f_nt_cover = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1923
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1909
* # 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 = 1923; __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 = 1909; __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 = 1923; __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 = 1909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_temp);
__Pyx_DECREF(__pyx_t_1);
__pyx_t_1 = __pyx_temp;
@@ -62471,48 +61873,44 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__pyx_cur_scope->__pyx_v_e_nt_cover = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1928
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1914
* # 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_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_1extract, 0, __pyx_n_s_145, ((PyObject*)__pyx_cur_scope), __pyx_n_s_102, ((PyObject *)__pyx_k_codeobj_143)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_1extract, 0, __pyx_n_s_145, ((PyObject*)__pyx_cur_scope), __pyx_n_s_102, ((PyObject *)__pyx_k_codeobj_143)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2034
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2020
*
* # 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 = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11++) {
- __pyx_t_1 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_XDECREF_SET(__pyx_v_f_i, __pyx_t_1);
- __pyx_t_1 = 0;
+ __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 = 2020; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2036
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2022
* 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 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_i); 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_cur_scope->__pyx_v_al, __pyx_v_f_i, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2022; __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 = 2036; __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 = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_12 = ((!__pyx_t_9) != 0);
- if (__pyx_t_12) {
+ __pyx_t_11 = ((!__pyx_t_9) != 0);
+ if (__pyx_t_11) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2037
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2023
* # Skip if phrases won't be tight on left side
* if not al[f_i]:
* continue # <<<<<<<<<<<<<<
@@ -62524,111 +61922,107 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
}
__pyx_L15:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2038
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2024
* if not al[f_i]:
* continue
* extract(f_i, f_i, f_len + 1, -1, f_i, 0, [], [], False) # <<<<<<<<<<<<<<
*
* stats = self.online_stats[ctx_name]
*/
- __pyx_t_1 = PyNumber_Add(__pyx_cur_scope->__pyx_v_f_len, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __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 = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __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 = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __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 = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __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 = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_v_f_i, __pyx_t_1, __pyx_int_neg_1, __pyx_v_f_i, __pyx_int_0, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_3), __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __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 = 2024; __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 = 2024; __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 = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_14 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_12add_instance_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_t_1, __pyx_t_6, __pyx_t_3, __pyx_int_neg_1, __pyx_t_4, __pyx_int_0, ((PyObject *)__pyx_t_7), ((PyObject *)__pyx_t_12), __pyx_t_13); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2024; __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_6)); __pyx_t_6 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__pyx_L13_continue:;
- __pyx_t_11 = __Pyx_PyInt_AsLong(__pyx_v_f_i); if (unlikely((__pyx_t_11 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2034
- *
- * # 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_7 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_XDECREF_SET(__pyx_v_f_i, __pyx_t_7);
- __pyx_t_7 = 0;
-
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2040
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2026
* extract(f_i, f_i, f_len + 1, -1, f_i, 0, [], [], False)
*
* stats = self.online_stats[ctx_name] # <<<<<<<<<<<<<<
*
* # Update possible phrases (samples)
*/
- __pyx_t_7 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->online_stats, __pyx_v_ctx_name); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_v_stats = __pyx_t_7;
- __pyx_t_7 = 0;
+ __pyx_t_14 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->online_stats, __pyx_v_ctx_name); if (!__pyx_t_14) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __pyx_v_stats = __pyx_t_14;
+ __pyx_t_14 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2045
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2031
* # 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): # <<<<<<<<<<<<<<
* stats.samples_f[f] += 1
*
*/
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__get_f_phrases); 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_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__get_f_phrases); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_13);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_f_words);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_f_words);
+ PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_cur_scope->__pyx_v_f_words);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f_words);
- __pyx_t_3 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
- __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0;
+ __pyx_t_12 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
+ if (PyList_CheckExact(__pyx_t_12) || PyTuple_CheckExact(__pyx_t_12)) {
+ __pyx_t_13 = __pyx_t_12; __Pyx_INCREF(__pyx_t_13); __pyx_t_2 = 0;
__pyx_t_5 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
+ __pyx_t_2 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_5 = Py_TYPE(__pyx_t_13)->tp_iternext;
}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
for (;;) {
- if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_4)) {
- if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break;
+ if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_13)) {
+ if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_13)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PySequence_ITEM(__pyx_t_13, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
- } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_4)) {
- if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
+ } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_13)) {
+ if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_13)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PySequence_ITEM(__pyx_t_13, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
- __pyx_t_3 = __pyx_t_5(__pyx_t_4);
- if (unlikely(!__pyx_t_3)) {
+ __pyx_t_12 = __pyx_t_5(__pyx_t_13);
+ if (unlikely(!__pyx_t_12)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
- __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GOTREF(__pyx_t_12);
}
- if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
- PyObject* sequence = __pyx_t_3;
+ 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
@@ -62637,120 +62031,120 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
- __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2);
+ __pyx_t_14 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
+ __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
} else {
- __pyx_t_7 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_6 = PyList_GET_ITEM(sequence, 1);
- __pyx_t_1 = PyList_GET_ITEM(sequence, 2);
+ __pyx_t_14 = 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_14);
__Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_t_4);
#else
- __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __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 = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_1 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
#endif
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_13 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_8 = Py_TYPE(__pyx_t_13)->tp_iternext;
- index = 0; __pyx_t_7 = __pyx_t_8(__pyx_t_13); if (unlikely(!__pyx_t_7)) goto __pyx_L18_unpacking_failed;
+ __pyx_t_3 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __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_14 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_14)) goto __pyx_L18_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_14);
+ 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 = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_13); if (unlikely(!__pyx_t_6)) goto __pyx_L18_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_6);
- index = 2; __pyx_t_1 = __pyx_t_8(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L18_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_1);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_13), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ 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 = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_8 = NULL;
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L19_unpacking_done;
__pyx_L18_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __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 = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L19_unpacking_done:;
}
- __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_7);
+ __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_14);
+ __pyx_t_14 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_lex_i, __pyx_t_7);
__pyx_t_7 = 0;
- __Pyx_XDECREF_SET(__pyx_v_lex_i, __pyx_t_6);
- __pyx_t_6 = 0;
- __Pyx_XDECREF_SET(__pyx_v_lex_j, __pyx_t_1);
- __pyx_t_1 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_lex_j, __pyx_t_4);
+ __pyx_t_4 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2046
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2032
* # at the cost of readability
* for f, lex_i, lex_j in self.get_f_phrases(f_words):
* stats.samples_f[f] += 1 # <<<<<<<<<<<<<<
*
* # Update phrase counts
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__samples_f); 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_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__samples_f); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
__Pyx_INCREF(__pyx_v_f);
- __pyx_t_1 = __pyx_v_f;
- __pyx_t_6 = PyObject_GetItem(__pyx_t_3, __pyx_t_1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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 = 2032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyObject_SetItem(__pyx_t_3, __pyx_t_1, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_int_1); 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_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (PyObject_SetItem(__pyx_t_12, __pyx_t_4, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2049
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2035
*
* # Update phrase counts
* for rule in rules: # <<<<<<<<<<<<<<
* (f_ph, e_ph, al) = rule[:3]
* stats.phrases_f[f_ph] += 1
*/
- __pyx_t_4 = PyObject_GetIter(((PyObject *)__pyx_cur_scope->__pyx_v_rules)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
+ __pyx_t_13 = PyObject_GetIter(((PyObject *)__pyx_cur_scope->__pyx_v_rules)); 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_t_5 = Py_TYPE(__pyx_t_13)->tp_iternext;
for (;;) {
{
- __pyx_t_3 = __pyx_t_5(__pyx_t_4);
- if (unlikely(!__pyx_t_3)) {
+ __pyx_t_12 = __pyx_t_5(__pyx_t_13);
+ if (unlikely(!__pyx_t_12)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
- __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GOTREF(__pyx_t_12);
}
- __Pyx_XDECREF_SET(__pyx_v_rule, __pyx_t_3);
- __pyx_t_3 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_rule, __pyx_t_12);
+ __pyx_t_12 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2050
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2036
* # Update phrase counts
* for rule in rules:
* (f_ph, e_ph, al) = rule[:3] # <<<<<<<<<<<<<<
* stats.phrases_f[f_ph] += 1
* stats.phrases_e[e_ph] += 1
*/
- __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_rule, 0, 3, NULL, NULL, &__pyx_k_slice_146, 0, 1, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
- PyObject* sequence = __pyx_t_3;
+ __pyx_t_12 = __Pyx_PyObject_GetSlice(__pyx_v_rule, 0, 3, NULL, NULL, &__pyx_k_slice_146, 0, 1, 1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __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
@@ -62759,898 +62153,168 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
- __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2);
+ __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_14 = PyTuple_GET_ITEM(sequence, 1);
+ __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2);
} else {
- __pyx_t_1 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_7 = PyList_GET_ITEM(sequence, 1);
- __pyx_t_6 = PyList_GET_ITEM(sequence, 2);
+ __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
+ __pyx_t_14 = PyList_GET_ITEM(sequence, 1);
+ __pyx_t_7 = PyList_GET_ITEM(sequence, 2);
}
- __Pyx_INCREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_14);
__Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(__pyx_t_6);
#else
- __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __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 = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_14 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
#endif
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_13 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_8 = Py_TYPE(__pyx_t_13)->tp_iternext;
- index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L22_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_1);
- index = 1; __pyx_t_7 = __pyx_t_8(__pyx_t_13); if (unlikely(!__pyx_t_7)) goto __pyx_L22_unpacking_failed;
+ __pyx_t_3 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __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_4 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L22_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_4);
+ index = 1; __pyx_t_14 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_14)) goto __pyx_L22_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_14);
+ 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);
- index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_13); if (unlikely(!__pyx_t_6)) goto __pyx_L22_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_6);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_13), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_3), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_8 = NULL;
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L23_unpacking_done;
__pyx_L22_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __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 = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L23_unpacking_done:;
}
- __Pyx_XDECREF_SET(__pyx_v_f_ph, __pyx_t_1);
- __pyx_t_1 = 0;
- __Pyx_XDECREF_SET(__pyx_v_e_ph, __pyx_t_7);
- __pyx_t_7 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_f_ph, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_e_ph, __pyx_t_14);
+ __pyx_t_14 = 0;
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_al);
- __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_al, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- __pyx_t_6 = 0;
+ __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_al, __pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_7);
+ __pyx_t_7 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2051
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2037
* for rule in rules:
* (f_ph, e_ph, al) = rule[:3]
* stats.phrases_f[f_ph] += 1 # <<<<<<<<<<<<<<
* stats.phrases_e[e_ph] += 1
* stats.phrases_fe[f_ph][e_ph] += 1
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_f); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_f); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
__Pyx_INCREF(__pyx_v_f_ph);
- __pyx_t_6 = __pyx_v_f_ph;
- __pyx_t_7 = PyObject_GetItem(__pyx_t_3, __pyx_t_6); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_7 = __pyx_v_f_ph;
+ __pyx_t_14 = PyObject_GetItem(__pyx_t_12, __pyx_t_7); if (!__pyx_t_14) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_14, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ if (PyObject_SetItem(__pyx_t_12, __pyx_t_7, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __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_3, __pyx_t_6, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2052
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2038
* (f_ph, e_ph, al) = rule[:3]
* stats.phrases_f[f_ph] += 1
* stats.phrases_e[e_ph] += 1 # <<<<<<<<<<<<<<
* stats.phrases_fe[f_ph][e_ph] += 1
* if not stats.phrases_al[f_ph][e_ph]:
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_e); 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_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_e); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
__Pyx_INCREF(__pyx_v_e_ph);
- __pyx_t_6 = __pyx_v_e_ph;
- __pyx_t_1 = PyObject_GetItem(__pyx_t_3, __pyx_t_6); 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_7 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyObject_SetItem(__pyx_t_3, __pyx_t_6, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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 = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_14 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (PyObject_SetItem(__pyx_t_12, __pyx_t_7, __pyx_t_14) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2053
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2039
* stats.phrases_f[f_ph] += 1
* stats.phrases_e[e_ph] += 1
* stats.phrases_fe[f_ph][e_ph] += 1 # <<<<<<<<<<<<<<
* if not stats.phrases_al[f_ph][e_ph]:
* stats.phrases_al[f_ph][e_ph] = al
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_fe); 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_6 = PyObject_GetItem(__pyx_t_3, __pyx_v_f_ph); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_INCREF(__pyx_v_e_ph);
- __pyx_t_3 = __pyx_v_e_ph;
- __pyx_t_7 = PyObject_GetItem(__pyx_t_6, __pyx_t_3); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_fe); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ __pyx_t_7 = PyObject_GetItem(__pyx_t_12, __pyx_v_f_ph); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_INCREF(__pyx_v_e_ph);
+ __pyx_t_12 = __pyx_v_e_ph;
+ __pyx_t_14 = PyObject_GetItem(__pyx_t_7, __pyx_t_12); if (!__pyx_t_14) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_14, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ if (PyObject_SetItem(__pyx_t_7, __pyx_t_12, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2039; __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;
- if (PyObject_SetItem(__pyx_t_6, __pyx_t_3, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2054
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2040
* stats.phrases_e[e_ph] += 1
* stats.phrases_fe[f_ph][e_ph] += 1
* if not stats.phrases_al[f_ph][e_ph]: # <<<<<<<<<<<<<<
* stats.phrases_al[f_ph][e_ph] = al
*
*/
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_al); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = PyObject_GetItem(__pyx_t_6, __pyx_v_f_ph); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyObject_GetItem(__pyx_t_3, __pyx_v_e_ph); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_9 = ((!__pyx_t_12) != 0);
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_al); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_12 = PyObject_GetItem(__pyx_t_7, __pyx_v_f_ph); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_7 = PyObject_GetItem(__pyx_t_12, __pyx_v_e_ph); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_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 = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_9 = ((!__pyx_t_11) != 0);
if (__pyx_t_9) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2055
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2041
* stats.phrases_fe[f_ph][e_ph] += 1
* if not stats.phrases_al[f_ph][e_ph]:
* stats.phrases_al[f_ph][e_ph] = al # <<<<<<<<<<<<<<
*
- * # Update Bilexical counts
- */
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_al); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = PyObject_GetItem(__pyx_t_6, __pyx_v_f_ph); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyObject_SetItem(__pyx_t_3, __pyx_v_e_ph, __pyx_cur_scope->__pyx_v_al) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- goto __pyx_L24;
- }
- __pyx_L24:;
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2058
- *
- * # Update Bilexical counts
- * aligned_fe = [list() for _ in range(len(f_words))] # <<<<<<<<<<<<<<
- * aligned_ef = [list() for _ in range(len(e_words))]
- * null_word = sym_fromstring('NULL', True)
- */
- __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = __pyx_cur_scope->__pyx_v_f_words;
- __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 = 2058; __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 = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __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_GOTREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
- if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
- __pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6); __pyx_t_2 = 0;
- __pyx_t_5 = NULL;
- } else {
- __pyx_t_2 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = Py_TYPE(__pyx_t_6)->tp_iternext;
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- for (;;) {
- if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_6)) {
- if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_6)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_6)) {
- if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- } else {
- __pyx_t_3 = __pyx_t_5(__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 = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_3);
- }
- __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_3))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_aligned_fe = ((PyObject*)__pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2059
- * # Update Bilexical counts
- * aligned_fe = [list() for _ in range(len(f_words))]
- * aligned_ef = [list() for _ in range(len(e_words))] # <<<<<<<<<<<<<<
- * null_word = sym_fromstring('NULL', True)
- * for (i, j) in alignment:
- */
- __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __pyx_cur_scope->__pyx_v_e_words;
- __Pyx_INCREF(__pyx_t_6);
- __pyx_t_2 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_2); 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);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- __pyx_t_6 = 0;
- __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 = 2059; __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 = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- for (;;) {
- if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
- if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __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 = 2059; __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 = 2059; __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 = 2059; __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 = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_6);
- }
- __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_6);
- __pyx_t_6 = 0;
- __pyx_t_6 = PyList_New(0); 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);
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __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;
- __pyx_v_aligned_ef = ((PyObject*)__pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2060
- * aligned_fe = [list() for _ in range(len(f_words))]
- * aligned_ef = [list() for _ in range(len(e_words))]
- * null_word = sym_fromstring('NULL', True) # <<<<<<<<<<<<<<
- * for (i, j) in alignment:
- * aligned_fe[i].append(j)
- */
- __pyx_v_null_word = __pyx_f_4cdec_2sa_3_sa_sym_fromstring(__pyx_k__NULL, 1);
-
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2061
- * aligned_ef = [list() for _ in range(len(e_words))]
- * null_word = sym_fromstring('NULL', True)
- * for (i, j) in alignment: # <<<<<<<<<<<<<<
- * aligned_fe[i].append(j)
- * aligned_ef[j].append(i)
- */
- if (PyList_CheckExact(__pyx_v_alignment) || PyTuple_CheckExact(__pyx_v_alignment)) {
- __pyx_t_4 = __pyx_v_alignment; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0;
- __pyx_t_5 = NULL;
- } else {
- __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_alignment); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
- }
- for (;;) {
- if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_4)) {
- if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_4)) {
- if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- } else {
- __pyx_t_3 = __pyx_t_5(__pyx_t_4);
- if (unlikely(!__pyx_t_3)) {
- if (PyErr_Occurred()) {
- if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_3);
- }
- if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
- PyObject* sequence = __pyx_t_3;
- #if CYTHON_COMPILING_IN_CPYTHON
- Py_ssize_t size = Py_SIZE(sequence);
- #else
- Py_ssize_t size = PySequence_Size(sequence);
- #endif
- if (unlikely(size != 2)) {
- if (size > 2) __Pyx_RaiseTooManyValuesError(2);
- else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- #if CYTHON_COMPILING_IN_CPYTHON
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
- } else {
- __pyx_t_6 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_1 = PyList_GET_ITEM(sequence, 1);
- }
- __Pyx_INCREF(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_1);
- #else
- __pyx_t_6 = PySequence_ITEM(sequence, 0); 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_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- #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 = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
- index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L31_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_6);
- index = 1; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L31_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_1);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_8 = NULL;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- goto __pyx_L32_unpacking_done;
- __pyx_L31_unpacking_failed:;
- __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 = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_L32_unpacking_done:;
- }
- __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6);
- __pyx_t_6 = 0;
- __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2062
- * null_word = sym_fromstring('NULL', True)
- * for (i, j) in alignment:
- * aligned_fe[i].append(j) # <<<<<<<<<<<<<<
- * aligned_ef[j].append(i)
- * for f_i in range(len(f_words)):
- */
- __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_aligned_fe), __pyx_v_i); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_v_j); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2062; __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_1); __pyx_t_1 = 0;
-
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2063
- * for (i, j) in alignment:
- * aligned_fe[i].append(j)
- * aligned_ef[j].append(i) # <<<<<<<<<<<<<<
- * for f_i in range(len(f_words)):
- * stats.bilex_f[f_words[f_i]] += 1
- */
- __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_aligned_ef), __pyx_v_j); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_v_i); 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(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2064
- * aligned_fe[i].append(j)
- * aligned_ef[j].append(i)
- * for f_i in range(len(f_words)): # <<<<<<<<<<<<<<
- * stats.bilex_f[f_words[f_i]] += 1
- * e_i_aligned = aligned_fe[f_i]
- */
- __pyx_t_4 = __pyx_cur_scope->__pyx_v_f_words;
- __Pyx_INCREF(__pyx_t_4);
- __pyx_t_2 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __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 = 2064; __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 = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- for (;;) {
- if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
- if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __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 = 2064; __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 = 2064; __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 = 2064; __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 = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_4);
- }
- __Pyx_XDECREF_SET(__pyx_v_f_i, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2065
- * aligned_ef[j].append(i)
- * for f_i in range(len(f_words)):
- * stats.bilex_f[f_words[f_i]] += 1 # <<<<<<<<<<<<<<
- * e_i_aligned = aligned_fe[f_i]
- * lc = len(e_i_aligned)
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__bilex_f); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_f_words, __pyx_v_f_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = PyObject_GetItem(__pyx_t_4, __pyx_t_1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyObject_SetItem(__pyx_t_4, __pyx_t_1, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2066
- * for f_i in range(len(f_words)):
- * stats.bilex_f[f_words[f_i]] += 1
- * e_i_aligned = aligned_fe[f_i] # <<<<<<<<<<<<<<
- * lc = len(e_i_aligned)
- * if lc > 0:
- */
- __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_aligned_fe), __pyx_v_f_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_XDECREF_SET(__pyx_v_e_i_aligned, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2067
- * stats.bilex_f[f_words[f_i]] += 1
- * e_i_aligned = aligned_fe[f_i]
- * lc = len(e_i_aligned) # <<<<<<<<<<<<<<
- * if lc > 0:
- * for e_i in e_i_aligned:
- */
- __pyx_t_14 = PyObject_Length(__pyx_v_e_i_aligned); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_14); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_XDECREF_SET(__pyx_v_lc, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2068
- * e_i_aligned = aligned_fe[f_i]
- * lc = len(e_i_aligned)
- * if lc > 0: # <<<<<<<<<<<<<<
- * for e_i in e_i_aligned:
- * stats.bilex_fe[f_words[f_i]][e_words[e_i]] += (1.0) / lc
- */
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_lc, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__pyx_t_9) {
-
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2069
- * lc = len(e_i_aligned)
- * if lc > 0:
- * for e_i in e_i_aligned: # <<<<<<<<<<<<<<
- * stats.bilex_fe[f_words[f_i]][e_words[e_i]] += (1.0) / lc
- * else:
- */
- if (PyList_CheckExact(__pyx_v_e_i_aligned) || PyTuple_CheckExact(__pyx_v_e_i_aligned)) {
- __pyx_t_4 = __pyx_v_e_i_aligned; __Pyx_INCREF(__pyx_t_4); __pyx_t_14 = 0;
- __pyx_t_15 = NULL;
- } else {
- __pyx_t_14 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_e_i_aligned); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_15 = Py_TYPE(__pyx_t_4)->tp_iternext;
- }
- for (;;) {
- if (!__pyx_t_15 && PyList_CheckExact(__pyx_t_4)) {
- if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_14); __Pyx_INCREF(__pyx_t_1); __pyx_t_14++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- } else if (!__pyx_t_15 && PyTuple_CheckExact(__pyx_t_4)) {
- if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_14); __Pyx_INCREF(__pyx_t_1); __pyx_t_14++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- } else {
- __pyx_t_1 = __pyx_t_15(__pyx_t_4);
- if (unlikely(!__pyx_t_1)) {
- if (PyErr_Occurred()) {
- if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_1);
- }
- __Pyx_XDECREF_SET(__pyx_v_e_i, __pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2070
- * if lc > 0:
- * for e_i in e_i_aligned:
- * stats.bilex_fe[f_words[f_i]][e_words[e_i]] += (1.0) / lc # <<<<<<<<<<<<<<
- * else:
- * stats.bilex_fe[f_words[f_i]][null_word] += 1
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__bilex_fe); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_f_words, __pyx_v_f_i); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = PyObject_GetItem(__pyx_t_1, __pyx_t_7); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_e_words, __pyx_v_e_i); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_1 = PyObject_GetItem(__pyx_t_6, __pyx_t_7); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_13 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_16 = __Pyx_PyNumber_Divide(__pyx_t_13, __pyx_v_lc); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_16); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- if (PyObject_SetItem(__pyx_t_6, __pyx_t_7, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __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_6); __pyx_t_6 = 0;
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- goto __pyx_L35;
- }
- /*else*/ {
-
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2072
- * stats.bilex_fe[f_words[f_i]][e_words[e_i]] += (1.0) / lc
- * else:
- * stats.bilex_fe[f_words[f_i]][null_word] += 1 # <<<<<<<<<<<<<<
- * for e_i in range(len(e_words)):
- * stats.bilex_e[e_words[e_i]] += 1
+ * # Create a rule from source, target, non-terminals, and alignments
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__bilex_fe); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_f_words, __pyx_v_f_i); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = PyObject_GetItem(__pyx_t_4, __pyx_t_6); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_al); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_17 = __pyx_v_null_word;
- __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_7, __pyx_t_17, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (__Pyx_SetItemInt(__pyx_t_7, __pyx_t_17, __pyx_t_4, sizeof(int), PyInt_FromLong, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_12 = PyObject_GetItem(__pyx_t_7, __pyx_v_f_ph); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2041; __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_12, __pyx_v_e_ph, __pyx_cur_scope->__pyx_v_al) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ goto __pyx_L24;
}
- __pyx_L35:;
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2073
- * else:
- * stats.bilex_fe[f_words[f_i]][null_word] += 1
- * for e_i in range(len(e_words)): # <<<<<<<<<<<<<<
- * stats.bilex_e[e_words[e_i]] += 1
- * f_i_aligned = aligned_ef[e_i]
- */
- __pyx_t_3 = __pyx_cur_scope->__pyx_v_e_words;
- __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 = 2073; __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 = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
- if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
- __pyx_t_7 = __pyx_t_3; __Pyx_INCREF(__pyx_t_7); __pyx_t_2 = 0;
- __pyx_t_5 = NULL;
- } else {
- __pyx_t_2 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = Py_TYPE(__pyx_t_7)->tp_iternext;
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- for (;;) {
- if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_7)) {
- if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_7)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_7, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_7)) {
- if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_7, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- } else {
- __pyx_t_3 = __pyx_t_5(__pyx_t_7);
- if (unlikely(!__pyx_t_3)) {
- 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;}
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_3);
- }
- __Pyx_XDECREF_SET(__pyx_v_e_i, __pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2074
- * stats.bilex_fe[f_words[f_i]][null_word] += 1
- * for e_i in range(len(e_words)):
- * stats.bilex_e[e_words[e_i]] += 1 # <<<<<<<<<<<<<<
- * f_i_aligned = aligned_ef[e_i]
- * lc = len(f_i_aligned)
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__bilex_e); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_e_words, __pyx_v_e_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = PyObject_GetItem(__pyx_t_3, __pyx_t_4); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyObject_SetItem(__pyx_t_3, __pyx_t_4, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2074; __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_3); __pyx_t_3 = 0;
-
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2075
- * for e_i in range(len(e_words)):
- * stats.bilex_e[e_words[e_i]] += 1
- * f_i_aligned = aligned_ef[e_i] # <<<<<<<<<<<<<<
- * lc = len(f_i_aligned)
- * if lc > 0:
- */
- __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_aligned_ef), __pyx_v_e_i); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_XDECREF_SET(__pyx_v_f_i_aligned, __pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2076
- * stats.bilex_e[e_words[e_i]] += 1
- * f_i_aligned = aligned_ef[e_i]
- * lc = len(f_i_aligned) # <<<<<<<<<<<<<<
- * if lc > 0:
- * for f_i in f_i_aligned:
- */
- __pyx_t_14 = PyObject_Length(__pyx_v_f_i_aligned); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_14); 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_XDECREF_SET(__pyx_v_lc, __pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2077
- * f_i_aligned = aligned_ef[e_i]
- * lc = len(f_i_aligned)
- * if lc > 0: # <<<<<<<<<<<<<<
- * for f_i in f_i_aligned:
- * stats.bilex_ef[e_words[e_i]][f_words[f_i]] += (1.0) / lc
- */
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_lc, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_9) {
-
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2078
- * lc = len(f_i_aligned)
- * if lc > 0:
- * for f_i in f_i_aligned: # <<<<<<<<<<<<<<
- * stats.bilex_ef[e_words[e_i]][f_words[f_i]] += (1.0) / lc
- * else:
- */
- if (PyList_CheckExact(__pyx_v_f_i_aligned) || PyTuple_CheckExact(__pyx_v_f_i_aligned)) {
- __pyx_t_3 = __pyx_v_f_i_aligned; __Pyx_INCREF(__pyx_t_3); __pyx_t_14 = 0;
- __pyx_t_15 = NULL;
- } else {
- __pyx_t_14 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_f_i_aligned); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_15 = Py_TYPE(__pyx_t_3)->tp_iternext;
- }
- for (;;) {
- if (!__pyx_t_15 && PyList_CheckExact(__pyx_t_3)) {
- if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_3)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_14); __Pyx_INCREF(__pyx_t_4); __pyx_t_14++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- } else if (!__pyx_t_15 && PyTuple_CheckExact(__pyx_t_3)) {
- if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_14); __Pyx_INCREF(__pyx_t_4); __pyx_t_14++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- } else {
- __pyx_t_4 = __pyx_t_15(__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 = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_4);
- }
- __Pyx_XDECREF_SET(__pyx_v_f_i, __pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2079
- * if lc > 0:
- * for f_i in f_i_aligned:
- * stats.bilex_ef[e_words[e_i]][f_words[f_i]] += (1.0) / lc # <<<<<<<<<<<<<<
- * else:
- * stats.bilex_ef[e_words[e_i]][null_word] += 1
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__bilex_ef); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_13 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_e_words, __pyx_v_e_i); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_6 = PyObject_GetItem(__pyx_t_4, __pyx_t_13); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __pyx_t_13 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_f_words, __pyx_v_f_i); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_4 = PyObject_GetItem(__pyx_t_6, __pyx_t_13); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_16 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_16, __pyx_v_lc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __pyx_t_16 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyObject_SetItem(__pyx_t_6, __pyx_t_13, __pyx_t_16) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- goto __pyx_L40;
- }
- /*else*/ {
-
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2081
- * stats.bilex_ef[e_words[e_i]][f_words[f_i]] += (1.0) / lc
- * else:
- * stats.bilex_ef[e_words[e_i]][null_word] += 1 # <<<<<<<<<<<<<<
- *
- * # Create a rule from source, target, non-terminals, and alignments
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__bilex_ef); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_e_words, __pyx_v_e_i); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_13 = PyObject_GetItem(__pyx_t_3, __pyx_t_6); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_17 = __pyx_v_null_word;
- __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_13, __pyx_t_17, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (__Pyx_SetItemInt(__pyx_t_13, __pyx_t_17, __pyx_t_3, sizeof(int), PyInt_FromLong, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- }
- __pyx_L40:;
+ __pyx_L24:;
}
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
@@ -63660,8 +62324,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_12);
__Pyx_XDECREF(__pyx_t_13);
- __Pyx_XDECREF(__pyx_t_16);
+ __Pyx_XDECREF(__pyx_t_14);
__Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.add_instance", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -63669,22 +62334,13 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_25add_instanc
__Pyx_XDECREF(__pyx_v_f);
__Pyx_XDECREF(__pyx_v_e);
__Pyx_XDECREF(__pyx_v_f_nt_cover);
- __Pyx_XDECREF(__pyx_v_f_i);
__Pyx_XDECREF(__pyx_v_stats);
__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);
- __Pyx_XDECREF(__pyx_v_aligned_fe);
- __Pyx_XDECREF(__pyx_v_aligned_ef);
__Pyx_XDECREF(__pyx_v_i);
- __Pyx_XDECREF(__pyx_v_j);
- __Pyx_XDECREF(__pyx_v_e_i_aligned);
- __Pyx_XDECREF(__pyx_v_lc);
- __Pyx_XDECREF(__pyx_v_e_i);
- __Pyx_XDECREF(__pyx_v_f_i_aligned);
- __Pyx_XDECREF(__pyx_v__);
__Pyx_DECREF(((PyObject *)__pyx_cur_scope));
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
@@ -63730,31 +62386,31 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_28form_rule(P
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 = 2084; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __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 = 2084; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __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 = 2084; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __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 = 2084; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __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 = 2084; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __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 = 2084; __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 = 2044; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
goto __pyx_L5_argtuple_error;
@@ -63775,7 +62431,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_28form_rule(P
}
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 = 2084; __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 = 2044; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.form_rule", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -63787,9 +62443,9 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_28form_rule(P
}
/* Python wrapper */
-static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda8 = {__Pyx_NAMESTR("lambda8"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda8, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda6(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda6 = {__Pyx_NAMESTR("lambda6"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda6, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
+static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda6(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_x = 0;
PyObject *__pyx_v_y = 0;
int __pyx_lineno = 0;
@@ -63797,7 +62453,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_la
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("lambda8 (wrapper)", 0);
+ __Pyx_RefNannySetupContext("lambda6 (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__x,&__pyx_n_s__y,0};
PyObject* values[2] = {0,0};
@@ -63818,11 +62474,11 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_la
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__y)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("lambda8", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("lambda6", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __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 = 2087; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda6") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
@@ -63835,18 +62491,18 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_la
}
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 = 2087; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("lambda6", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
- __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.form_rule.lambda8", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.form_rule.lambda6", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_lambda_funcdef_lambda8(__pyx_self, __pyx_v_x, __pyx_v_y);
+ __pyx_r = __pyx_lambda_funcdef_lambda6(__pyx_self, __pyx_v_x, __pyx_v_y);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2087
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2047
*
* # Substitute in non-terminals
* nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3])) # <<<<<<<<<<<<<<
@@ -63854,7 +62510,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_la
* off = f_i
*/
-static PyObject *__pyx_lambda_funcdef_lambda8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
+static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
@@ -63863,13 +62519,13 @@ static PyObject *__pyx_lambda_funcdef_lambda8(CYTHON_UNUSED PyObject *__pyx_self
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("lambda8", 0);
+ __Pyx_RefNannySetupContext("lambda6", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __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, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_y, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __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 = 2087; __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 = 2047; __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);
@@ -63877,7 +62533,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 = 2087; __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 = 2047; __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;
@@ -63890,7 +62546,7 @@ static PyObject *__pyx_lambda_funcdef_lambda8(CYTHON_UNUSED PyObject *__pyx_self
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.form_rule.lambda8", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.form_rule.lambda6", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -63899,9 +62555,9 @@ static PyObject *__pyx_lambda_funcdef_lambda8(CYTHON_UNUSED PyObject *__pyx_self
}
/* Python wrapper */
-static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda9(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda9 = {__Pyx_NAMESTR("lambda9"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda9, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda9(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda7(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda7 = {__Pyx_NAMESTR("lambda7"), (PyCFunction)__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda7, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
+static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda7(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_x = 0;
PyObject *__pyx_v_y = 0;
int __pyx_lineno = 0;
@@ -63909,7 +62565,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1l
int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("lambda9 (wrapper)", 0);
+ __Pyx_RefNannySetupContext("lambda7 (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__x,&__pyx_n_s__y,0};
PyObject* values[2] = {0,0};
@@ -63930,11 +62586,11 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1l
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__y)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("lambda9", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("lambda7", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda9") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __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 = 2071; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
@@ -63947,18 +62603,18 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1l
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("lambda9", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __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 = 2071; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
- __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.form_rule.lambda9", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.form_rule.lambda7", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_lambda_funcdef_lambda9(__pyx_self, __pyx_v_x, __pyx_v_y);
+ __pyx_r = __pyx_lambda_funcdef_lambda7(__pyx_self, __pyx_v_x, __pyx_v_y);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2111
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2071
* # 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])) # <<<<<<<<<<<<<<
@@ -63966,7 +62622,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1l
* nt_len = len(nt)
*/
-static PyObject *__pyx_lambda_funcdef_lambda9(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
+static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
@@ -63975,13 +62631,13 @@ static PyObject *__pyx_lambda_funcdef_lambda9(CYTHON_UNUSED PyObject *__pyx_self
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("lambda9", 0);
+ __Pyx_RefNannySetupContext("lambda7", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); 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_2 = __Pyx_GetItemInt(__pyx_v_y, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_y, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); 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_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __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 = 2071; __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);
@@ -63989,7 +62645,7 @@ static PyObject *__pyx_lambda_funcdef_lambda9(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 = 2111; __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 = 2071; __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;
@@ -64002,7 +62658,7 @@ static PyObject *__pyx_lambda_funcdef_lambda9(CYTHON_UNUSED PyObject *__pyx_self
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.form_rule.lambda9", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.form_rule.lambda7", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -64011,7 +62667,7 @@ static PyObject *__pyx_lambda_funcdef_lambda9(CYTHON_UNUSED PyObject *__pyx_self
}
static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2145
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2105
* f = Phrase(f_sym)
* e = Phrase(e_sym)
* a = tuple(self.alignment.link(i, j) for i, j in links) # <<<<<<<<<<<<<<
@@ -64037,7 +62693,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_2g
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -64081,19 +62737,19 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4g
return NULL;
}
__pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __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 = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __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 = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_links) == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_t_1 = ((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_links); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
for (;;) {
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 = 2145; __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 = 2105; __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 = 2145; __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 = 2105; __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;
@@ -64105,7 +62761,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4g
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -64118,16 +62774,16 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4g
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
#else
- __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __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 = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
#endif
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
@@ -64135,7 +62791,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4g
__Pyx_GOTREF(__pyx_t_4);
index = 1; __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), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __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;
@@ -64143,7 +62799,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4g
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_7 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L7_unpacking_done:;
}
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i);
@@ -64154,10 +62810,10 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4g
__Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_j, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
__pyx_t_5 = 0;
- if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_i); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_j); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_3 = PyInt_FromLong(((struct __pyx_vtabstruct_4cdec_2sa_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_8, __pyx_t_9)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __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 = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_i); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_j); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong(((struct __pyx_vtabstruct_4cdec_2sa_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_8, __pyx_t_9)); 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_r = __pyx_t_3;
__pyx_t_3 = 0;
@@ -64174,7 +62830,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4g
__pyx_cur_scope->__pyx_t_0 = 0;
__Pyx_XGOTREF(__pyx_t_1);
__pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyErr_SetNone(PyExc_StopIteration);
@@ -64194,7 +62850,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_4g
return NULL;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2084
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2044
*
* # Create a rule from source, target, non-terminals, and alignments
* def form_rule(self, f_i, e_i, f_span, e_span, nt, al): # <<<<<<<<<<<<<<
@@ -64251,52 +62907,52 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
__Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2087
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2047
*
* # 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 = 2087; __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 = 2047; __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 = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
- __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda8, 0, __pyx_n_s_147, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_lambda6, 0, __pyx_n_s_147, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __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 = 2087; __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 = 2047; __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 = 2087; __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 = 2047; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2088
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2048
* # 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_PyObject_GetSlice(__pyx_v_f_span, 0, 0, NULL, NULL, &__pyx_k_slice_148, 0, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_f_span, 0, 0, NULL, NULL, &__pyx_k_slice_148, 0, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2048; __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 = 2088; __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 = 2048; __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 = 2088; __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 = 2048; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2089
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2049
* nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3]))
* f_sym = list(f_span[:])
* off = f_i # <<<<<<<<<<<<<<
@@ -64306,7 +62962,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_INCREF(__pyx_v_f_i);
__pyx_v_off = __pyx_v_f_i;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2090
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2050
* f_sym = list(f_span[:])
* off = f_i
* for next_nt in nt: # <<<<<<<<<<<<<<
@@ -64317,7 +62973,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__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 = 2090; __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 = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
}
@@ -64325,23 +62981,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
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 = 2090; __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 = 2050; __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 = 2090; __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 = 2050; __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 = 2090; __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 = 2050; __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 = 2090; __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 = 2050; __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 = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -64350,28 +63006,28 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_XDECREF_SET(__pyx_v_next_nt, __pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2091
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2051
* 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, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2051; __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, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2051; __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 = 2091; __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 = 2051; __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 = 2091; __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 = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF_SET(__pyx_v_nt_len, __pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2092
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2052
* for next_nt in nt:
* nt_len = (next_nt[2] - next_nt[1]) + 1
* i = 0 # <<<<<<<<<<<<<<
@@ -64381,7 +63037,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_INCREF(__pyx_int_0);
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_int_0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2093
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2053
* nt_len = (next_nt[2] - next_nt[1]) + 1
* i = 0
* while i < nt_len: # <<<<<<<<<<<<<<
@@ -64389,82 +63045,82 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
* 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 = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_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 = 2053; __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 = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!__pyx_t_7) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2094
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2054
* 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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_f_sym), __pyx_n_s__pop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_f_sym), __pyx_n_s__pop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __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, 0, 0, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __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 = 2094; __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 = 2054; __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 = 2094; __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 = 2054; __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 = 2094; __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 = 2054; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2095
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2055
* 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 = 2095; __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 = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF_SET(__pyx_v_i, __pyx_t_2);
__pyx_t_2 = 0;
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2096
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2056
* 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, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); 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_6 = PyNumber_Subtract(__pyx_t_2, __pyx_v_off); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __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 = 2056; __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 = 2096; __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 = 2056; __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, 0, 0, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __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 = 2096; __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 = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyInt_FromLong(__pyx_f_4cdec_2sa_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 = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyInt_FromLong(__pyx_f_4cdec_2sa_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 = 2056; __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 = 2096; __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 = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2097
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2057
* 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 = 2097; __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 = 2057; __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 = 2097; __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 = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF_SET(__pyx_v_off, __pyx_t_2);
@@ -64472,27 +63128,27 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2098
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2058
* 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_PyObject_GetSlice(__pyx_v_e_span, 0, 0, NULL, NULL, &__pyx_k_slice_149, 0, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_e_span, 0, 0, NULL, NULL, &__pyx_k_slice_149, 0, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __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 = 2098; __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 = 2058; __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 = 2098; __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 = 2058; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2099
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2059
* off += (nt_len - 1)
* e_sym = list(e_span[:])
* off = e_i # <<<<<<<<<<<<<<
@@ -64502,7 +63158,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_INCREF(__pyx_v_e_i);
__Pyx_DECREF_SET(__pyx_v_off, __pyx_v_e_i);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2100
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2060
* e_sym = list(e_span[:])
* off = e_i
* for next_nt in nt_inv: # <<<<<<<<<<<<<<
@@ -64513,7 +63169,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__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 = 2100; __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 = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
}
@@ -64521,23 +63177,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
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 = 2100; __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 = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __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 = 2060; __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 = 2100; __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 = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __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 = 2060; __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 = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -64546,28 +63202,28 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_XDECREF_SET(__pyx_v_next_nt, __pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2101
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2061
* 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, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); 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 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); 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_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2101; __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 = 2061; __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 = 2101; __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 = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF_SET(__pyx_v_nt_len, __pyx_t_6);
__pyx_t_6 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2102
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2062
* for next_nt in nt_inv:
* nt_len = (next_nt[4] - next_nt[3]) + 1
* i = 0 # <<<<<<<<<<<<<<
@@ -64577,7 +63233,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_INCREF(__pyx_int_0);
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_int_0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2103
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2063
* nt_len = (next_nt[4] - next_nt[3]) + 1
* i = 0
* while i < nt_len: # <<<<<<<<<<<<<<
@@ -64585,82 +63241,82 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
* 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 = 2103; __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 = 2103; __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 = 2063; __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 = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (!__pyx_t_7) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2104
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2064
* 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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_e_sym), __pyx_n_s__pop); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_e_sym), __pyx_n_s__pop); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __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, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __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 = 2104; __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 = 2064; __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 = 2104; __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 = 2064; __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 = 2104; __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 = 2064; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2105
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2065
* 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 = 2105; __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 = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF_SET(__pyx_v_i, __pyx_t_2);
__pyx_t_2 = 0;
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2106
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2066
* 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, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); 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_1 = PyNumber_Subtract(__pyx_t_2, __pyx_v_off); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_v_off); 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_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 = 2106; __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 = 2066; __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, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __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 = 2106; __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 = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyInt_FromLong(__pyx_f_4cdec_2sa_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 = 2106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_f_4cdec_2sa_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 = 2066; __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 = 2106; __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 = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2107
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2067
* 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 = 2107; __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 = 2067; __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 = 2107; __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 = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF_SET(__pyx_v_off, __pyx_t_2);
@@ -64668,20 +63324,20 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2110
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2070
*
* # 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 = 2110; __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 = 2070; __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 = 2110; __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 = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext;
}
@@ -64689,23 +63345,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
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 = 2110; __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 = 2070; __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 = 2110; __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 = 2070; __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 = 2110; __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 = 2070; __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 = 2110; __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 = 2070; __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 = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -64717,7 +63373,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__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 = 2110; __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 = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_11 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -64725,23 +63381,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
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 = 2110; __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 = 2070; __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 = 2110; __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 = 2070; __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 = 2110; __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 = 2070; __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 = 2110; __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 = 2070; __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 = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -64749,15 +63405,15 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
}
__Pyx_XDECREF_SET(__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 = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__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 = 2110; __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 = 2070; __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_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_12))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_12))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __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;
@@ -64767,32 +63423,32 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__pyx_cur_scope->__pyx_v_links = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2111
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2071
* # 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 = 2111; __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 = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_links));
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_links));
__Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_links));
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
- __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda9, 0, __pyx_n_s_147, NULL, __pyx_n_s_102, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda7, 0, __pyx_n_s_147, NULL, __pyx_n_s_102, NULL); 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);
- if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__cmp), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __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 = 2071; __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 = 2111; __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 = 2071; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2112
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2072
* 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) # <<<<<<<<<<<<<<
@@ -64803,29 +63459,29 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_INCREF(__pyx_t_1);
if (unlikely(__pyx_t_1 == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_t_4 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __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 = 2112; __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 = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_links_len = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2113
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2073
* 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 = 2113; __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 = 2113; __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 = 2073; __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 = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_XDECREF_SET(__pyx_v_nt_len, __pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2114
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2074
* links_len = len(links)
* nt_len = len(nt)
* nt_i = 0 # <<<<<<<<<<<<<<
@@ -64835,7 +63491,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_INCREF(__pyx_int_0);
__pyx_v_nt_i = __pyx_int_0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2115
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2075
* nt_len = len(nt)
* nt_i = 0
* off = f_i # <<<<<<<<<<<<<<
@@ -64845,7 +63501,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_INCREF(__pyx_v_f_i);
__Pyx_DECREF_SET(__pyx_v_off, __pyx_v_f_i);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2116
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2076
* nt_i = 0
* off = f_i
* i = 0 # <<<<<<<<<<<<<<
@@ -64855,7 +63511,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_INCREF(__pyx_int_0);
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_int_0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2117
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2077
* off = f_i
* i = 0
* while i < links_len: # <<<<<<<<<<<<<<
@@ -64863,12 +63519,12 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
* 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 = 2117; __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 = 2117; __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 = 2077; __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 = 2077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!__pyx_t_7) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2118
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2078
* i = 0
* while i < links_len:
* while nt_i < nt_len and links[i][0] > nt[nt_i][1]: # <<<<<<<<<<<<<<
@@ -64876,24 +63532,24 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
* 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 = 2118; __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 = 2118; __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 = 2078; __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 = 2078; __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(((PyObject *)__pyx_cur_scope->__pyx_v_links), __pyx_v_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_links), __pyx_v_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __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, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __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 = 2118; __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 = 2078; __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, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __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 = 2118; __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 = 2078; __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 = 2118; __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 = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_14 = __pyx_t_13;
} else {
@@ -64901,79 +63557,79 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
}
if (!__pyx_t_14) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2119
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2079
* 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 = 2119; __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 = 2079; __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, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __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 = 2119; __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 = 2079; __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, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2079; __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 = 2119; __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 = 2079; __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 = 2119; __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 = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF_SET(__pyx_v_off, __pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2120
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2080
* 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 = 2120; __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 = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF_SET(__pyx_v_nt_i, __pyx_t_2);
__pyx_t_2 = 0;
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2121
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2081
* 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(((PyObject *)__pyx_cur_scope->__pyx_v_links), __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_links), __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __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, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __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, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __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 = 2121; __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 = 2081; __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, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __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, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2122
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2082
* 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 = 2122; __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 = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF_SET(__pyx_v_i, __pyx_t_2);
__pyx_t_2 = 0;
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2123
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2083
* links[i][0] -= off
* i += 1
* nt_i = 0 # <<<<<<<<<<<<<<
@@ -64983,7 +63639,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_INCREF(__pyx_int_0);
__Pyx_DECREF_SET(__pyx_v_nt_i, __pyx_int_0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2124
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2084
* i += 1
* nt_i = 0
* off = e_i # <<<<<<<<<<<<<<
@@ -64993,7 +63649,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_INCREF(__pyx_v_e_i);
__Pyx_DECREF_SET(__pyx_v_off, __pyx_v_e_i);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2125
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2085
* nt_i = 0
* off = e_i
* i = 0 # <<<<<<<<<<<<<<
@@ -65003,7 +63659,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_INCREF(__pyx_int_0);
__Pyx_DECREF_SET(__pyx_v_i, __pyx_int_0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2126
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2086
* off = e_i
* i = 0
* while i < links_len: # <<<<<<<<<<<<<<
@@ -65011,12 +63667,12 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
* 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 = 2126; __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 = 2126; __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 = 2086; __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 = 2086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (!__pyx_t_14) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2127
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2087
* i = 0
* while i < links_len:
* while nt_i < nt_len and links_inv[i][1] > nt_inv[nt_i][3]: # <<<<<<<<<<<<<<
@@ -65024,24 +63680,24 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
* 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 = 2127; __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 = 2127; __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 = 2087; __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 = 2087; __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 = 2127; __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 = 2087; __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, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __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 = 2127; __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 = 2087; __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, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_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 = 2127; __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 = 2087; __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 = 2127; __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 = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_13 = __pyx_t_7;
} else {
@@ -65049,79 +63705,79 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
}
if (!__pyx_t_13) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2128
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2088
* 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 = 2128; __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 = 2088; __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, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 4, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_GetItem(__pyx_v_nt_inv, __pyx_v_nt_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __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 = 2088; __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, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_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 = 2128; __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 = 2088; __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 = 2128; __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 = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF_SET(__pyx_v_off, __pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2129
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2089
* 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 = 2129; __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 = 2089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_nt_i, __pyx_t_3);
__pyx_t_3 = 0;
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2130
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2090
* 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 = 2130; __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 = 2090; __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, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __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, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2090; __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 = 2130; __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 = 2090; __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, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __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, 1, 1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2090; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2131
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2091
* 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 = 2131; __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 = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_i, __pyx_t_3);
__pyx_t_3 = 0;
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2134
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2094
*
* # Find lexical span
* lex_f_i = f_i # <<<<<<<<<<<<<<
@@ -65131,75 +63787,75 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
__Pyx_INCREF(__pyx_v_f_i);
__pyx_v_lex_f_i = __pyx_v_f_i;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2135
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2095
* # 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 = 2135; __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 = 2135; __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 = 2095; __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 = 2095; __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 = 2135; __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 = 2095; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2136
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2096
* 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 = 2136; __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 = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_13) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2137
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2097
* 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, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __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 = 2137; __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 = 2097; __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 = 2137; __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 = 2097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_13) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2138
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2098
* 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, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __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, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __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, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __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, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_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 = 2138; __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 = 2098; __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 = 2138; __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 = 2098; __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 = 2138; __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 = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF_SET(__pyx_v_lex_f_i, __pyx_t_1);
@@ -65208,49 +63864,49 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
}
__pyx_L24:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2139
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2099
* 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, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2099; __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, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2099; __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 = 2139; __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 = 2099; __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 = 2139; __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 = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_13) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2140
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2100
* 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, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __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, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __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, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __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, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __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 = 2140; __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 = 2100; __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 = 2140; __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 = 2100; __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 = 2140; __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 = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF_SET(__pyx_v_lex_f_j, __pyx_t_1);
@@ -65262,63 +63918,63 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
}
__pyx_L23:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2143
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2103
*
* # 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 = 2143; __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 = 2103; __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_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__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(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__pyx_v_f = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2144
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2104
* # 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 = 2144; __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 = 2104; __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_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__pyx_v_e = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2145
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2105
* 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_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_2genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_9form_rule_2genexpr(((PyObject*)__pyx_cur_scope)); 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_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __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 = 2105; __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 = 2145; __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 = 2105; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2146
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2106
* 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) # <<<<<<<<<<<<<<
@@ -65326,7 +63982,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_27form_rule(s
* # 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 = 2146; __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 = 2106; __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));
@@ -65414,16 +64070,16 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_30fmt_rule(Py
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 = 2149; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2109; __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 = 2149; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2109; __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 = 2149; __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 = 2109; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
@@ -65438,7 +64094,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_30fmt_rule(Py
}
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 = 2149; __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 = 2109; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.fmt_rule", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -65450,7 +64106,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_30fmt_rule(Py
}
static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2150
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2110
* # 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) # <<<<<<<<<<<<<<
@@ -65476,7 +64132,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_gen
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16, (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;
@@ -65518,13 +64174,13 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2ge
return NULL;
}
__pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __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 = 2150; __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_a)) { __Pyx_RaiseClosureNameError("a"); {__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_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 = 2150; __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 = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -65532,23 +64188,23 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2ge
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 = 2150; __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 = 2150; __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 = 2150; __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 = 2150; __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 = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -65558,24 +64214,24 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2ge
__Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_packed, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_150), __pyx_n_s__format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_150), __pyx_n_s__format); 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);
- if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((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 = 2150; __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_5 = __Pyx_PyObject_GetAttrStr(((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 = 2110; __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 = 2150; __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 = 2110; __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 = 2150; __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 = 2110; __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 = 2150; __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 = 2110; __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 = 2150; __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 = 2110; __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;
@@ -65596,7 +64252,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2ge
__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 = 2150; __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);
@@ -65616,7 +64272,7 @@ static PyObject *__pyx_gb_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_2ge
return NULL;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2149
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2109
*
* # Rule string from rule
* def fmt_rule(self, f, e, a): # <<<<<<<<<<<<<<
@@ -65649,30 +64305,30 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_29fmt_rule(st
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_a);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_a);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2150
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2110
* # 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 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_69), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_69), __pyx_n_s__join); 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_2 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_8fmt_rule_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __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 = 2150; __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_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 = 2150; __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 = 2110; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2151
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2111
* 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) # <<<<<<<<<<<<<<
@@ -65680,9 +64336,9 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_29fmt_rule(st
* # Lookup online stats for phrase pair (f, e). Return None if no match.
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_151), __pyx_n_s__format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_151), __pyx_n_s__format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __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 = 2151; __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 = 2111; __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);
@@ -65693,7 +64349,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_29fmt_rule(st
__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 = 2151; __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 = 2111; __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;
@@ -65733,7 +64389,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_32online_ctx_
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__f,&__pyx_n_s__e,&__pyx_n_s__ctx_name,0};
PyObject* values[3] = {0,0,0};
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2155
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2115
* # Lookup online stats for phrase pair (f, e). Return None if no match.
* # IMPORTANT: use get() to avoid adding items to defaultdict
* def online_ctx_lookup(self, f, e, ctx_name=None): # <<<<<<<<<<<<<<
@@ -65759,7 +64415,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_32online_ctx_
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("online_ctx_lookup", 0, 2, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("online_ctx_lookup", 0, 2, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (kw_args > 0) {
@@ -65768,7 +64424,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_32online_ctx_
}
}
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 = 2155; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "online_ctx_lookup") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -65785,7 +64441,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_32online_ctx_
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("online_ctx_lookup", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("online_ctx_lookup", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.online_ctx_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -65809,13 +64465,12 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_
PyObject *__pyx_t_3 = NULL;
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("online_ctx_lookup", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2156
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2116
* # IMPORTANT: use get() to avoid adding items to defaultdict
* def online_ctx_lookup(self, f, e, ctx_name=None):
* if self.online: # <<<<<<<<<<<<<<
@@ -65825,31 +64480,31 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_
__pyx_t_1 = (__pyx_v_self->online != 0);
if (__pyx_t_1) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2157
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2117
* def online_ctx_lookup(self, f, e, ctx_name=None):
* if self.online:
* stats = self.online_stats[ctx_name] # <<<<<<<<<<<<<<
* fcount = stats.phrases_f.get(f, 0)
* fsample_count = stats.samples_f.get(f, 0)
*/
- __pyx_t_2 = PyObject_GetItem(__pyx_v_self->online_stats, __pyx_v_ctx_name); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetItem(__pyx_v_self->online_stats, __pyx_v_ctx_name); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_stats = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2158
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2118
* if self.online:
* stats = self.online_stats[ctx_name]
* fcount = stats.phrases_f.get(f, 0) # <<<<<<<<<<<<<<
* fsample_count = stats.samples_f.get(f, 0)
* d = stats.phrases_fe.get(f, None)
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_f); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_f); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2118; __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 = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2118; __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);
@@ -65857,26 +64512,26 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_
__Pyx_INCREF(__pyx_int_0);
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0);
__Pyx_GIVEREF(__pyx_int_0);
- __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2158; __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 = 2118; __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_v_fcount = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2159
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2119
* stats = self.online_stats[ctx_name]
* fcount = stats.phrases_f.get(f, 0)
* fsample_count = stats.samples_f.get(f, 0) # <<<<<<<<<<<<<<
* d = stats.phrases_fe.get(f, None)
* paircount = d.get(e, 0) if d else 0
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__samples_f); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__samples_f); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__get); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__get); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2119; __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(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2159; __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 = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_f);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_f);
@@ -65884,26 +64539,26 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_
__Pyx_INCREF(__pyx_int_0);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_0);
__Pyx_GIVEREF(__pyx_int_0);
- __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__pyx_v_fsample_count = __pyx_t_3;
__pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2160
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2120
* fcount = stats.phrases_f.get(f, 0)
* fsample_count = stats.samples_f.get(f, 0)
* d = stats.phrases_fe.get(f, None) # <<<<<<<<<<<<<<
* paircount = d.get(e, 0) if d else 0
- * return OnlineFeatureContext(fcount, fsample_count, paircount, stats.bilex_f, stats.bilex_e, stats.bilex_fe)
+ * return OnlineFeatureContext(fcount, fsample_count, paircount)
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_fe); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__phrases_fe); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__get); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__get); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2160; __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 = 2120; __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);
@@ -65911,25 +64566,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_
__Pyx_INCREF(Py_None);
PyTuple_SET_ITEM(__pyx_t_3, 1, Py_None);
__Pyx_GIVEREF(Py_None);
- __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__pyx_v_d = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2161
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2121
* fsample_count = stats.samples_f.get(f, 0)
* d = stats.phrases_fe.get(f, None)
* paircount = d.get(e, 0) if d else 0 # <<<<<<<<<<<<<<
- * return OnlineFeatureContext(fcount, fsample_count, paircount, stats.bilex_f, stats.bilex_e, stats.bilex_fe)
+ * return OnlineFeatureContext(fcount, fsample_count, paircount)
* return None
*/
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_d); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_d); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_1) {
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s__get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s__get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2161; __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 = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_e);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_e);
@@ -65937,7 +64592,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_
__Pyx_INCREF(__pyx_int_0);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_0);
__Pyx_GIVEREF(__pyx_int_0);
- __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __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_4)); __pyx_t_4 = 0;
@@ -65950,56 +64605,41 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_
__pyx_v_paircount = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2162
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2122
* d = stats.phrases_fe.get(f, None)
* paircount = d.get(e, 0) if d else 0
- * return OnlineFeatureContext(fcount, fsample_count, paircount, stats.bilex_f, stats.bilex_e, stats.bilex_fe) # <<<<<<<<<<<<<<
+ * return OnlineFeatureContext(fcount, fsample_count, paircount) # <<<<<<<<<<<<<<
* return None
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_152); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_152); 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_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__bilex_f); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2162; __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 = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__bilex_e); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_stats, __pyx_n_s__bilex_fe); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = PyTuple_New(6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(__pyx_v_fcount);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __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_6, 1, __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_6, 2, __pyx_v_paircount);
+ PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_paircount);
__Pyx_GIVEREF(__pyx_v_paircount);
- PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_5 = 0;
- __pyx_t_4 = 0;
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __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_6)); __pyx_t_6 = 0;
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+ __pyx_r = __pyx_t_4;
+ __pyx_t_4 = 0;
goto __pyx_L0;
goto __pyx_L3;
}
__pyx_L3:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2163
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2123
* paircount = d.get(e, 0) if d else 0
- * return OnlineFeatureContext(fcount, fsample_count, paircount, stats.bilex_f, stats.bilex_e, stats.bilex_fe)
+ * return OnlineFeatureContext(fcount, fsample_count, paircount)
* return None # <<<<<<<<<<<<<<
*
* # Find all phrases that we might try to extract
@@ -66016,7 +64656,6 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_31online_ctx_
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.online_ctx_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -66083,36 +64722,36 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
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 = 2173; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __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 = 2173; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __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 = 2173; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __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 = 2173; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __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 = 2173; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __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 = 2173; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 6); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __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 = 2173; __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 = 2133; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
goto __pyx_L5_argtuple_error;
@@ -66135,7 +64774,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
}
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 = 2173; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.get_f_phrases.extract", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -66146,7 +64785,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2173
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2133
* phrases = set() # (fphrase, lex_i, lex_j)
*
* def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms): # <<<<<<<<<<<<<<
@@ -66179,33 +64818,33 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
__pyx_outer_scope = (struct __pyx_obj_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases *) __Pyx_CyFunction_GetClosure(__pyx_self);
__pyx_cur_scope = __pyx_outer_scope;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2175
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2135
* 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 = 2175; __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 = 2175; __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 = 2135; __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 = 2135; __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 = 2175; __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 = 2135; __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 = 2175; __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 = 2135; __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 = 2175; __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 = 2135; __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 = 2175; __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 = 2135; __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 = 2175; __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 = 2175; __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 = 2135; __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 = 2135; __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 = 2175; __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 = 2135; __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 = 2175; __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 = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_6 = __pyx_t_5;
} else {
@@ -66213,7 +64852,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
}
if (__pyx_t_6) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2176
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2136
* # Phrase extraction limits
* if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size:
* return # <<<<<<<<<<<<<<
@@ -66227,58 +64866,58 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
}
__pyx_L3:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2178
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2138
* 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 = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Add(__pyx_v_wc, __pyx_v_ntc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __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 = 2178; __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 = 2138; __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 = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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 = 2138; __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 = 2178; __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 = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_6) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2179
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2139
* # 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 = 2179; __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 = 2179; __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 = 2139; __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 = 2139; __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 = 2179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_syms, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2180
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2140
* 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 = 2180; __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 = 2140; __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_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__pyx_v_f = ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2181
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2141
* syms.append(f_words[f_j])
* f = Phrase(syms)
* new_lex_i = min(lex_i, f_j) # <<<<<<<<<<<<<<
@@ -66289,8 +64928,8 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
__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 = 2181; __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 = 2181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2141; __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 = 2141; __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);
@@ -66307,7 +64946,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
__pyx_v_new_lex_i = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2182
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2142
* f = Phrase(syms)
* new_lex_i = min(lex_i, f_j)
* new_lex_j = max(lex_j, f_j) # <<<<<<<<<<<<<<
@@ -66318,8 +64957,8 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
__pyx_t_1 = __pyx_v_f_j;
__Pyx_INCREF(__pyx_v_lex_j);
__pyx_t_4 = __pyx_v_lex_j;
- __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2182; __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 = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2142; __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 = 2142; __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);
@@ -66336,19 +64975,19 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
__pyx_v_new_lex_j = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2183
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2143
* 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 = 2183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (unlikely(!__pyx_cur_scope->__pyx_v_phrases)) { __Pyx_RaiseClosureNameError("phrases"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_phrases) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "add");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __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 = 2183; __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 = 2143; __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));
@@ -66359,53 +64998,53 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
__Pyx_INCREF(__pyx_v_new_lex_j);
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_new_lex_j);
__Pyx_GIVEREF(__pyx_v_new_lex_j);
- __pyx_t_8 = PySet_Add(__pyx_cur_scope->__pyx_v_phrases, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PySet_Add(__pyx_cur_scope->__pyx_v_phrases, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2184
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2144
* 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
*/
- __pyx_t_1 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2184; __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 = 2144; __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 = 2184; __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 = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_4 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_1, __pyx_v_new_lex_i, __pyx_v_new_lex_j, __pyx_t_2, __pyx_v_ntc, __pyx_v_syms); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2184; __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 = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_4 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_1, __pyx_v_new_lex_i, __pyx_v_new_lex_j, __pyx_t_2, __pyx_v_ntc, __pyx_v_syms); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2185
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2145
* 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_4 = __Pyx_PyObject_Pop(__pyx_v_syms); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Pop(__pyx_v_syms); 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(__pyx_t_4); __pyx_t_4 = 0;
goto __pyx_L4;
}
__pyx_L4:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2187
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2147
* 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 = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_syms); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_6) {
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_syms, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_syms, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_3 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar(__pyx_t_9) != 0);
} else {
@@ -66413,17 +65052,17 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
}
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2189
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2149
* 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:
*/
- __pyx_t_4 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2189; __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 = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_2 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_4, __pyx_v_lex_i, __pyx_v_lex_j, __pyx_v_wc, __pyx_v_ntc, __pyx_v_syms); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2189; __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 = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_2 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_4, __pyx_v_lex_i, __pyx_v_lex_j, __pyx_v_wc, __pyx_v_ntc, __pyx_v_syms); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -66431,44 +65070,44 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
}
__pyx_L5:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2191
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2151
* 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_2 = PyNumber_Add(__pyx_v_wc, __pyx_v_ntc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_v_wc, __pyx_v_ntc); 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_t_4 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2151; __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_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2191; __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 = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2192
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2152
* # 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 = 2192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_syms); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_6 = (!__pyx_t_3);
if (!__pyx_t_6) {
- __pyx_t_1 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_nonterminals); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_nonterminals); 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_t_4 = PyObject_RichCompare(__pyx_v_ntc, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_v_ntc, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2192; __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 = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_3) {
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_syms, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_syms, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_5 = (!(__pyx_f_4cdec_2sa_3_sa_sym_isvar(__pyx_t_9) != 0));
__pyx_t_10 = __pyx_t_5;
@@ -66481,67 +65120,67 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
}
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2193
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2153
* 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_4 = PyNumber_Add(__pyx_v_ntc, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Add(__pyx_v_ntc, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_9)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_f_4cdec_2sa_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_9)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_syms, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_syms, __pyx_t_4); 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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2194
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2154
* 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_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_syms);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_syms);
__Pyx_GIVEREF(__pyx_v_syms);
- __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_2sa_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_XDECREF_SET(__pyx_v_f, ((struct __pyx_obj_4cdec_2sa_3_sa_Phrase *)__pyx_t_4));
__pyx_t_4 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2195
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2155
* 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_4 = PyObject_RichCompare(__pyx_v_wc, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_v_wc, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2155; __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 = 2155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_3) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2196
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2156
* 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 = 2196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (unlikely(!__pyx_cur_scope->__pyx_v_phrases)) { __Pyx_RaiseClosureNameError("phrases"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
if (unlikely(((PyObject *)__pyx_cur_scope->__pyx_v_phrases) == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "add");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __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 = 2196; __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 = 2156; __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));
@@ -66552,38 +65191,38 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
__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_8 = PySet_Add(__pyx_cur_scope->__pyx_v_phrases, ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PySet_Add(__pyx_cur_scope->__pyx_v_phrases, ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
goto __pyx_L8;
}
__pyx_L8:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2197
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2157
* 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()
*
*/
- __pyx_t_4 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2197; __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 = 2157; __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 = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Add(__pyx_v_ntc, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_2 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_4, __pyx_v_lex_i, __pyx_v_lex_j, __pyx_v_wc, __pyx_t_1, __pyx_v_syms); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2197; __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 = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_2 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_v_f_i, __pyx_t_4, __pyx_v_lex_i, __pyx_v_lex_j, __pyx_v_wc, __pyx_t_1, __pyx_v_syms); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2157; __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_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2198
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2158
* 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_2 = __Pyx_PyObject_Pop(__pyx_v_syms); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Pop(__pyx_v_syms); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
goto __pyx_L7;
@@ -66611,7 +65250,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phras
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2168
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2128
* # (Used for EGivenFCoherent)
* # Return set of (fphrase, lex_i, lex_j)
* def get_f_phrases(self, f_words): # <<<<<<<<<<<<<<
@@ -66648,7 +65287,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_33get_f_phras
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_f_words);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f_words);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2170
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2130
* def get_f_phrases(self, f_words):
*
* f_len = len(f_words) # <<<<<<<<<<<<<<
@@ -66657,66 +65296,66 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_33get_f_phras
*/
__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 = 2170; __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 = 2130; __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 = 2170; __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 = 2130; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2171
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2131
*
* 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 = 2171; __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 = 2131; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2173
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2133
* 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_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_1extract, 0, __pyx_n_s_155, ((PyObject*)__pyx_cur_scope), __pyx_n_s_102, ((PyObject *)__pyx_k_codeobj_154)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_1extract, 0, __pyx_n_s_155, ((PyObject*)__pyx_cur_scope), __pyx_n_s_102, ((PyObject *)__pyx_k_codeobj_154)); 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_GIVEREF(__pyx_t_1);
__pyx_cur_scope->__pyx_v_extract = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2201
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2161
*
* # 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 = 2201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_AsLong(__pyx_cur_scope->__pyx_v_f_len); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2161; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2202
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2162
* # 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 = 2202; __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 = 2162; __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 = 2202; __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 = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = __pyx_cur_scope->__pyx_v_f_len;
__Pyx_INCREF(__pyx_t_5);
- __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_t_1, __pyx_t_4, __pyx_t_5, __pyx_int_neg_1, __pyx_int_0, __pyx_int_0, ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(__pyx_cur_scope->__pyx_v_extract, __pyx_t_1, __pyx_t_4, __pyx_t_5, __pyx_int_neg_1, __pyx_int_0, __pyx_int_0, ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -66725,7 +65364,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_33get_f_phras
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2204
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2164
* extract(f_i, f_i, f_len, -1, 0, 0, [])
*
* return phrases # <<<<<<<<<<<<<<
@@ -66768,7 +65407,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_36drop_ctx(Py
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__ctx_name,0};
PyObject* values[1] = {0};
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2207
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2167
*
* # Drop online stats for a context
* def drop_ctx(self, ctx_name=None): # <<<<<<<<<<<<<<
@@ -66793,7 +65432,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_36drop_ctx(Py
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "drop_ctx") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "drop_ctx") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -66806,7 +65445,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_23HieroCachingRuleFactory_36drop_ctx(Py
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("drop_ctx", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("drop_ctx", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("cdec.sa._sa.HieroCachingRuleFactory.drop_ctx", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -66828,16 +65467,16 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_35drop_ctx(st
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("drop_ctx", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2208
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2168
* # Drop online stats for a context
* def drop_ctx(self, ctx_name=None):
* self.online_stats.pop(ctx_name, None) # <<<<<<<<<<<<<<
*
* # Spans are _inclusive_ on both ends [i, j]
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->online_stats, __pyx_n_s__pop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->online_stats, __pyx_n_s__pop); 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 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2208; __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 = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_ctx_name);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_ctx_name);
@@ -66845,7 +65484,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_23HieroCachingRuleFactory_35drop_ctx(st
__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 = 2208; __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 = 2168; __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;
@@ -66899,16 +65538,16 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_17span_check(PyObject *__pyx_self, PyOb
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 = 2211; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__j)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2211; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __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 = 2211; __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 = 2171; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
@@ -66923,7 +65562,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_17span_check(PyObject *__pyx_self, PyOb
}
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 = 2211; __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 = 2171; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("cdec.sa._sa.span_check", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -66934,7 +65573,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_17span_check(PyObject *__pyx_self, PyOb
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2211
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2171
*
* # Spans are _inclusive_ on both ends [i, j]
* def span_check(vec, i, j): # <<<<<<<<<<<<<<
@@ -66953,7 +65592,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_16span_check(CYTHON_UNUSED PyObject *__
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("span_check", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2212
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2172
* # Spans are _inclusive_ on both ends [i, j]
* def span_check(vec, i, j):
* k = i # <<<<<<<<<<<<<<
@@ -66963,7 +65602,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_16span_check(CYTHON_UNUSED PyObject *__
__Pyx_INCREF(__pyx_v_i);
__pyx_v_k = __pyx_v_i;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2213
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2173
* def span_check(vec, i, j):
* k = i
* while k <= j: # <<<<<<<<<<<<<<
@@ -66971,25 +65610,25 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_16span_check(CYTHON_UNUSED PyObject *__
* 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 = 2213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_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 = 2173; __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 = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!__pyx_t_2) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2214
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2174
* 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 = 2214; __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 = 2174; __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 = 2214; __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 = 2174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2215
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2175
* while k <= j:
* if vec[k]:
* return False # <<<<<<<<<<<<<<
@@ -66997,7 +65636,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_16span_check(CYTHON_UNUSED PyObject *__
* 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 = 2215; __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 = 2175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -67006,20 +65645,20 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_16span_check(CYTHON_UNUSED PyObject *__
}
__pyx_L5:;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2216
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2176
* 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 = 2216; __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 = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_k, __pyx_t_1);
__pyx_t_1 = 0;
}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2217
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2177
* return False
* k += 1
* return True # <<<<<<<<<<<<<<
@@ -67027,7 +65666,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_16span_check(CYTHON_UNUSED PyObject *__
* 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 = 2217; __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 = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -67080,16 +65719,16 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_19span_inc(PyObject *__pyx_self, PyObje
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 = 2219; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("span_inc", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __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 = 2219; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("span_inc", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __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 = 2219; __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 = 2179; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
@@ -67104,7 +65743,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_19span_inc(PyObject *__pyx_self, PyObje
}
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 = 2219; __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 = 2179; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("cdec.sa._sa.span_inc", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -67115,7 +65754,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_19span_inc(PyObject *__pyx_self, PyObje
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2219
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2179
* return True
*
* def span_inc(vec, i, j): # <<<<<<<<<<<<<<
@@ -67136,7 +65775,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_18span_inc(CYTHON_UNUSED PyObject *__py
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("span_inc", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2220
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2180
*
* def span_inc(vec, i, j):
* k = i # <<<<<<<<<<<<<<
@@ -67146,7 +65785,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_18span_inc(CYTHON_UNUSED PyObject *__py
__Pyx_INCREF(__pyx_v_i);
__pyx_v_k = __pyx_v_i;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2221
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2181
* def span_inc(vec, i, j):
* k = i
* while k <= j: # <<<<<<<<<<<<<<
@@ -67154,12 +65793,12 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_18span_inc(CYTHON_UNUSED PyObject *__py
* k += 1
*/
while (1) {
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2181; __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 = 2181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!__pyx_t_2) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2222
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2182
* k = i
* while k <= j:
* vec[k] += 1 # <<<<<<<<<<<<<<
@@ -67168,23 +65807,23 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_18span_inc(CYTHON_UNUSED PyObject *__py
*/
__Pyx_INCREF(__pyx_v_k);
__pyx_t_1 = __pyx_v_k;
- __pyx_t_3 = PyObject_GetItem(__pyx_v_vec, __pyx_t_1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_v_vec, __pyx_t_1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2182; __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 = 2222; __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 = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyObject_SetItem(__pyx_v_vec, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_v_vec, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2182; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2223
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2183
* 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 = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_k, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_k, __pyx_t_1);
__pyx_t_1 = 0;
@@ -67239,16 +65878,16 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_21span_dec(PyObject *__pyx_self, PyObje
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 = 2225; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("span_dec", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __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 = 2225; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("span_dec", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __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 = 2225; __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 = 2185; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
@@ -67263,7 +65902,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_21span_dec(PyObject *__pyx_self, PyObje
}
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 = 2225; __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 = 2185; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("cdec.sa._sa.span_dec", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -67274,7 +65913,7 @@ static PyObject *__pyx_pw_4cdec_2sa_3_sa_21span_dec(PyObject *__pyx_self, PyObje
return __pyx_r;
}
-/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2225
+/* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2185
* k += 1
*
* def span_dec(vec, i, j): # <<<<<<<<<<<<<<
@@ -67295,7 +65934,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_20span_dec(CYTHON_UNUSED PyObject *__py
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("span_dec", 0);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2226
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2186
*
* def span_dec(vec, i, j):
* k = i # <<<<<<<<<<<<<<
@@ -67305,7 +65944,7 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_20span_dec(CYTHON_UNUSED PyObject *__py
__Pyx_INCREF(__pyx_v_i);
__pyx_v_k = __pyx_v_i;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2227
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2187
* def span_dec(vec, i, j):
* k = i
* while k <= j: # <<<<<<<<<<<<<<
@@ -67313,12 +65952,12 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_20span_dec(CYTHON_UNUSED PyObject *__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 = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_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 = 2187; __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 = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!__pyx_t_2) break;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2228
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2188
* k = i
* while k <= j:
* vec[k] -= 1 # <<<<<<<<<<<<<<
@@ -67326,21 +65965,21 @@ static PyObject *__pyx_pf_4cdec_2sa_3_sa_20span_dec(CYTHON_UNUSED PyObject *__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 = 2228; __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 = 2188; __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 = 2228; __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 = 2188; __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 = 2228; __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 = 2188; __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2229
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2189
* 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 = 2229; __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 = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_k, __pyx_t_1);
__pyx_t_1 = 0;
@@ -69005,10 +67644,6 @@ static PyObject *__pyx_tp_new_4cdec_2sa_3_sa_OnlineStats(PyTypeObject *t, CYTHON
p->phrases_e = Py_None; Py_INCREF(Py_None);
p->phrases_fe = Py_None; Py_INCREF(Py_None);
p->phrases_al = Py_None; Py_INCREF(Py_None);
- p->bilex_f = Py_None; Py_INCREF(Py_None);
- p->bilex_e = Py_None; Py_INCREF(Py_None);
- p->bilex_fe = Py_None; Py_INCREF(Py_None);
- p->bilex_ef = Py_None; Py_INCREF(Py_None);
if (unlikely(__pyx_pw_4cdec_2sa_3_sa_11OnlineStats_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) {
Py_DECREF(o); o = 0;
}
@@ -69023,10 +67658,6 @@ static void __pyx_tp_dealloc_4cdec_2sa_3_sa_OnlineStats(PyObject *o) {
Py_CLEAR(p->phrases_e);
Py_CLEAR(p->phrases_fe);
Py_CLEAR(p->phrases_al);
- Py_CLEAR(p->bilex_f);
- Py_CLEAR(p->bilex_e);
- Py_CLEAR(p->bilex_fe);
- Py_CLEAR(p->bilex_ef);
(*Py_TYPE(o)->tp_free)(o);
}
@@ -69048,18 +67679,6 @@ static int __pyx_tp_traverse_4cdec_2sa_3_sa_OnlineStats(PyObject *o, visitproc v
if (p->phrases_al) {
e = (*v)(p->phrases_al, a); if (e) return e;
}
- if (p->bilex_f) {
- e = (*v)(p->bilex_f, a); if (e) return e;
- }
- if (p->bilex_e) {
- e = (*v)(p->bilex_e, a); if (e) return e;
- }
- if (p->bilex_fe) {
- e = (*v)(p->bilex_fe, a); if (e) return e;
- }
- if (p->bilex_ef) {
- e = (*v)(p->bilex_ef, a); if (e) return e;
- }
return 0;
}
@@ -69081,18 +67700,6 @@ static int __pyx_tp_clear_4cdec_2sa_3_sa_OnlineStats(PyObject *o) {
tmp = ((PyObject*)p->phrases_al);
p->phrases_al = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
- tmp = ((PyObject*)p->bilex_f);
- p->bilex_f = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->bilex_e);
- p->bilex_e = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->bilex_fe);
- p->bilex_fe = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->bilex_ef);
- p->bilex_ef = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
return 0;
}
@@ -69161,58 +67768,6 @@ static int __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_phrases_al(PyObject *o, Py
}
}
-static PyObject *__pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_bilex_f(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_f_1__get__(o);
-}
-
-static int __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_bilex_f(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_f_3__set__(o, v);
- }
- else {
- return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_f_5__del__(o);
- }
-}
-
-static PyObject *__pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_bilex_e(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_e_1__get__(o);
-}
-
-static int __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_bilex_e(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_e_3__set__(o, v);
- }
- else {
- return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_7bilex_e_5__del__(o);
- }
-}
-
-static PyObject *__pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_bilex_fe(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe_1__get__(o);
-}
-
-static int __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_bilex_fe(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe_3__set__(o, v);
- }
- else {
- return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_fe_5__del__(o);
- }
-}
-
-static PyObject *__pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_bilex_ef(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef_1__get__(o);
-}
-
-static int __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_bilex_ef(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
- if (v) {
- return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef_3__set__(o, v);
- }
- else {
- return __pyx_pw_4cdec_2sa_3_sa_11OnlineStats_8bilex_ef_5__del__(o);
- }
-}
-
static PyMethodDef __pyx_methods_4cdec_2sa_3_sa_OnlineStats[] = {
{0, 0, 0, 0}
};
@@ -69223,10 +67778,6 @@ static struct PyGetSetDef __pyx_getsets_4cdec_2sa_3_sa_OnlineStats[] = {
{(char *)"phrases_e", __pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_phrases_e, __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_phrases_e, 0, 0},
{(char *)"phrases_fe", __pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_phrases_fe, __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_phrases_fe, 0, 0},
{(char *)"phrases_al", __pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_phrases_al, __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_phrases_al, 0, 0},
- {(char *)"bilex_f", __pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_bilex_f, __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_bilex_f, 0, 0},
- {(char *)"bilex_e", __pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_bilex_e, __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_bilex_e, 0, 0},
- {(char *)"bilex_fe", __pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_bilex_fe, __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_bilex_fe, 0, 0},
- {(char *)"bilex_ef", __pyx_getprop_4cdec_2sa_3_sa_11OnlineStats_bilex_ef, __pyx_setprop_4cdec_2sa_3_sa_11OnlineStats_bilex_ef, 0, 0},
{0, 0, 0, 0, 0}
};
@@ -76224,10 +74775,6 @@ 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_ef, __pyx_k__bilex_ef, sizeof(__pyx_k__bilex_ef), 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},
@@ -76462,8 +75009,8 @@ static int __Pyx_InitCachedBuiltins(void) {
__pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s__zip); if (!__pyx_builtin_zip) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s__StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_builtin_cmp = __Pyx_GetBuiltinName(__pyx_n_s__cmp); if (!__pyx_builtin_cmp) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_sorted = __Pyx_GetBuiltinName(__pyx_n_s__sorted); if (!__pyx_builtin_sorted) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s__max); if (!__pyx_builtin_max) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_sorted = __Pyx_GetBuiltinName(__pyx_n_s__sorted); if (!__pyx_builtin_sorted) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s__max); if (!__pyx_builtin_max) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
return 0;
__pyx_L1_error:;
return -1;
@@ -76978,106 +75525,106 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_k_tuple_100);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_100));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":147
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":133
* 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_106 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_105)); if (unlikely(!__pyx_k_tuple_106)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_106 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_105)); if (unlikely(!__pyx_k_tuple_106)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_106);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_106));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":360
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":346
* self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation())
* if alignment is None:
* raise Exception("Must specify an alignment object") # <<<<<<<<<<<<<<
* self.alignment = alignment
*
*/
- __pyx_k_tuple_111 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_110)); if (unlikely(!__pyx_k_tuple_111)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_111 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_110)); if (unlikely(!__pyx_k_tuple_111)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_111);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_111));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1072
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1058
* else:
* #ERROR: We never get here
* raise Exception("Keyword trie error") # <<<<<<<<<<<<<<
* # checking whether lookup_required
* if lookup_required:
*/
- __pyx_k_tuple_127 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_126)); if (unlikely(!__pyx_k_tuple_127)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_127 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_126)); if (unlikely(!__pyx_k_tuple_127)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_127);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_127));
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1991
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1977
* 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_k_slice_141 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_slice_141)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_slice_141 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_slice_141)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_slice_141);
__Pyx_GIVEREF(__pyx_k_slice_141);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1928
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":1914
* # 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_142 = PyTuple_Pack(19, ((PyObject *)__pyx_n_s__f_i), ((PyObject *)__pyx_n_s__f_j), ((PyObject *)__pyx_n_s__e_i), ((PyObject *)__pyx_n_s__e_j), ((PyObject *)__pyx_n_s__min_bound), ((PyObject *)__pyx_n_s__wc), ((PyObject *)__pyx_n_s__links), ((PyObject *)__pyx_n_s__nt), ((PyObject *)__pyx_n_s__nt_open), ((PyObject *)__pyx_n_s__link_i), ((PyObject *)__pyx_n_s__link_j), ((PyObject *)__pyx_n_s__new_e_i), ((PyObject *)__pyx_n_s__new_e_j), ((PyObject *)__pyx_n_s__new_min_bound), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__nt_collision), ((PyObject *)__pyx_n_s__link), ((PyObject *)__pyx_n_s__plus_links), ((PyObject *)__pyx_n_s__old_last_nt)); if (unlikely(!__pyx_k_tuple_142)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_142 = PyTuple_Pack(19, ((PyObject *)__pyx_n_s__f_i), ((PyObject *)__pyx_n_s__f_j), ((PyObject *)__pyx_n_s__e_i), ((PyObject *)__pyx_n_s__e_j), ((PyObject *)__pyx_n_s__min_bound), ((PyObject *)__pyx_n_s__wc), ((PyObject *)__pyx_n_s__links), ((PyObject *)__pyx_n_s__nt), ((PyObject *)__pyx_n_s__nt_open), ((PyObject *)__pyx_n_s__link_i), ((PyObject *)__pyx_n_s__link_j), ((PyObject *)__pyx_n_s__new_e_i), ((PyObject *)__pyx_n_s__new_e_j), ((PyObject *)__pyx_n_s__new_min_bound), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__nt_collision), ((PyObject *)__pyx_n_s__link), ((PyObject *)__pyx_n_s__plus_links), ((PyObject *)__pyx_n_s__old_last_nt)); if (unlikely(!__pyx_k_tuple_142)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_142);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_142));
- __pyx_k_codeobj_143 = (PyObject*)__Pyx_PyCode_New(9, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_142, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_144, __pyx_n_s__extract, 1928, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_143)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_codeobj_143 = (PyObject*)__Pyx_PyCode_New(9, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_142, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_144, __pyx_n_s__extract, 1914, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_143)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2050
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2036
* # Update phrase counts
* for rule in rules:
* (f_ph, e_ph, al) = rule[:3] # <<<<<<<<<<<<<<
* stats.phrases_f[f_ph] += 1
* stats.phrases_e[e_ph] += 1
*/
- __pyx_k_slice_146 = PySlice_New(Py_None, __pyx_int_3, Py_None); if (unlikely(!__pyx_k_slice_146)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_slice_146 = PySlice_New(Py_None, __pyx_int_3, Py_None); if (unlikely(!__pyx_k_slice_146)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_slice_146);
__Pyx_GIVEREF(__pyx_k_slice_146);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2088
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2048
* # 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_k_slice_148 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_slice_148)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_slice_148 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_slice_148)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_slice_148);
__Pyx_GIVEREF(__pyx_k_slice_148);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2098
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2058
* 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_k_slice_149 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_slice_149)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_slice_149 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_slice_149)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_slice_149);
__Pyx_GIVEREF(__pyx_k_slice_149);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2173
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2133
* phrases = set() # (fphrase, lex_i, lex_j)
*
* def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms): # <<<<<<<<<<<<<<
* # Phrase extraction limits
* if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size:
*/
- __pyx_k_tuple_153 = PyTuple_Pack(10, ((PyObject *)__pyx_n_s__f_i), ((PyObject *)__pyx_n_s__f_j), ((PyObject *)__pyx_n_s__lex_i), ((PyObject *)__pyx_n_s__lex_j), ((PyObject *)__pyx_n_s__wc), ((PyObject *)__pyx_n_s__ntc), ((PyObject *)__pyx_n_s__syms), ((PyObject *)__pyx_n_s__f), ((PyObject *)__pyx_n_s__new_lex_i), ((PyObject *)__pyx_n_s__new_lex_j)); if (unlikely(!__pyx_k_tuple_153)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_153 = PyTuple_Pack(10, ((PyObject *)__pyx_n_s__f_i), ((PyObject *)__pyx_n_s__f_j), ((PyObject *)__pyx_n_s__lex_i), ((PyObject *)__pyx_n_s__lex_j), ((PyObject *)__pyx_n_s__wc), ((PyObject *)__pyx_n_s__ntc), ((PyObject *)__pyx_n_s__syms), ((PyObject *)__pyx_n_s__f), ((PyObject *)__pyx_n_s__new_lex_i), ((PyObject *)__pyx_n_s__new_lex_j)); if (unlikely(!__pyx_k_tuple_153)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_153);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_153));
- __pyx_k_codeobj_154 = (PyObject*)__Pyx_PyCode_New(7, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_153, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_144, __pyx_n_s__extract, 2173, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_154)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_codeobj_154 = (PyObject*)__Pyx_PyCode_New(7, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_153, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_144, __pyx_n_s__extract, 2133, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_154)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
/* "cdec/sa/_sa.pyx":5
* import gzip
@@ -77182,41 +75729,41 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_174));
__pyx_k_codeobj_175 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_174, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_165, __pyx_n_s__decode_words, 124, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_175)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2211
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2171
*
* # Spans are _inclusive_ on both ends [i, j]
* def span_check(vec, i, j): # <<<<<<<<<<<<<<
* k = i
* while k <= j:
*/
- __pyx_k_tuple_177 = PyTuple_Pack(4, ((PyObject *)__pyx_n_s__vec), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__j), ((PyObject *)__pyx_n_s__k)); if (unlikely(!__pyx_k_tuple_177)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_177 = PyTuple_Pack(4, ((PyObject *)__pyx_n_s__vec), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__j), ((PyObject *)__pyx_n_s__k)); if (unlikely(!__pyx_k_tuple_177)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_177);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_177));
- __pyx_k_codeobj_178 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_177, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_144, __pyx_n_s__span_check, 2211, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_178)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_codeobj_178 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_177, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_144, __pyx_n_s__span_check, 2171, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_178)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2219
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2179
* return True
*
* def span_inc(vec, i, j): # <<<<<<<<<<<<<<
* k = i
* while k <= j:
*/
- __pyx_k_tuple_179 = PyTuple_Pack(4, ((PyObject *)__pyx_n_s__vec), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__j), ((PyObject *)__pyx_n_s__k)); if (unlikely(!__pyx_k_tuple_179)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_179 = PyTuple_Pack(4, ((PyObject *)__pyx_n_s__vec), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__j), ((PyObject *)__pyx_n_s__k)); if (unlikely(!__pyx_k_tuple_179)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_179);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_179));
- __pyx_k_codeobj_180 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_179, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_144, __pyx_n_s__span_inc, 2219, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_180)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_codeobj_180 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_179, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_144, __pyx_n_s__span_inc, 2179, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_180)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2225
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2185
* k += 1
*
* def span_dec(vec, i, j): # <<<<<<<<<<<<<<
* k = i
* while k <= j:
*/
- __pyx_k_tuple_181 = PyTuple_Pack(4, ((PyObject *)__pyx_n_s__vec), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__j), ((PyObject *)__pyx_n_s__k)); if (unlikely(!__pyx_k_tuple_181)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_181 = PyTuple_Pack(4, ((PyObject *)__pyx_n_s__vec), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__j), ((PyObject *)__pyx_n_s__k)); if (unlikely(!__pyx_k_tuple_181)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_181);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_181));
- __pyx_k_codeobj_182 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_181, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_144, __pyx_n_s__span_dec, 2225, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_182)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_codeobj_182 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_181, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_144, __pyx_n_s__span_dec, 2185, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_182)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_RefNannyFinishContext();
return 0;
__pyx_L1_error:;
@@ -77343,15 +75890,15 @@ PyMODINIT_FUNC PyInit__sa(void)
__pyx_ptype_4cdec_2sa_3_sa_SuffixArray = &__pyx_type_4cdec_2sa_3_sa_SuffixArray;
if (PyType_Ready(&__pyx_type_4cdec_2sa_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_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_4_make_lattice;
- if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_24_fmt_rule;
if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_LCP) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__Pyx_SetAttrString(__pyx_m, "LCP", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_LCP) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_2sa_3_sa_LCP = &__pyx_type_4cdec_2sa_3_sa_LCP;
if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_17_genexpr;
- if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_OnlineStats) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__Pyx_SetAttrString(__pyx_m, "OnlineStats", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_OnlineStats) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_OnlineStats) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetAttrString(__pyx_m, "OnlineStats", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_OnlineStats) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_2sa_3_sa_OnlineStats = &__pyx_type_4cdec_2sa_3_sa_OnlineStats;
__pyx_vtabptr_4cdec_2sa_3_sa_IntList = &__pyx_vtable_4cdec_2sa_3_sa_IntList;
__pyx_vtable_4cdec_2sa_3_sa_IntList.set = (void (*)(struct __pyx_obj_4cdec_2sa_3_sa_IntList *, int, int))__pyx_f_4cdec_2sa_3_sa_7IntList_set;
@@ -77372,8 +75919,8 @@ PyMODINIT_FUNC PyInit__sa(void)
if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_Phrase.tp_dict, __pyx_vtabptr_4cdec_2sa_3_sa_Phrase) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__Pyx_SetAttrString(__pyx_m, "Phrase", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_Phrase) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_2sa_3_sa_Phrase = &__pyx_type_4cdec_2sa_3_sa_Phrase;
- if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_TrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__Pyx_SetAttrString(__pyx_m, "TrieNode", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_TrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_TrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetAttrString(__pyx_m, "TrieNode", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_TrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_2sa_3_sa_TrieNode = &__pyx_type_4cdec_2sa_3_sa_TrieNode;
if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_2_genexpr;
@@ -77381,11 +75928,11 @@ PyMODINIT_FUNC PyInit__sa(void)
__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_1_read_bitext;
if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_29_genexpr;
- if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_26_get_f_phrases;
__pyx_type_4cdec_2sa_3_sa_ExtendedTrieNode.tp_base = __pyx_ptype_4cdec_2sa_3_sa_TrieNode;
- if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_ExtendedTrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__Pyx_SetAttrString(__pyx_m, "ExtendedTrieNode", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_ExtendedTrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_ExtendedTrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetAttrString(__pyx_m, "ExtendedTrieNode", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_ExtendedTrieNode) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_2sa_3_sa_ExtendedTrieNode = &__pyx_type_4cdec_2sa_3_sa_ExtendedTrieNode;
__pyx_vtabptr_4cdec_2sa_3_sa_Alignment = &__pyx_vtable_4cdec_2sa_3_sa_Alignment;
__pyx_vtable_4cdec_2sa_3_sa_Alignment.link = (int (*)(struct __pyx_obj_4cdec_2sa_3_sa_Alignment *, int, int))__pyx_f_4cdec_2sa_3_sa_9Alignment_link;
@@ -77395,16 +75942,16 @@ PyMODINIT_FUNC PyInit__sa(void)
if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_Alignment.tp_dict, __pyx_vtabptr_4cdec_2sa_3_sa_Alignment) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__Pyx_SetAttrString(__pyx_m, "Alignment", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_Alignment) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_2sa_3_sa_Alignment = &__pyx_type_4cdec_2sa_3_sa_Alignment;
- if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_19_input) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_19_input) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_19_input = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_19_input;
if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_13_decode_words;
- if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_23_genexpr;
if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_Rule) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__Pyx_SetAttrString(__pyx_m, "Rule", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_Rule) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_2sa_3_sa_Rule = &__pyx_type_4cdec_2sa_3_sa_Rule;
- if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_4cdec_2sa_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_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_20_genexpr;
__pyx_vtabptr_4cdec_2sa_3_sa_Precomputation = &__pyx_vtable_4cdec_2sa_3_sa_Precomputation;
__pyx_vtable_4cdec_2sa_3_sa_Precomputation.read_map = (PyObject *(*)(struct __pyx_obj_4cdec_2sa_3_sa_Precomputation *, FILE *))__pyx_f_4cdec_2sa_3_sa_14Precomputation_read_map;
@@ -77415,7 +75962,7 @@ PyMODINIT_FUNC PyInit__sa(void)
__pyx_ptype_4cdec_2sa_3_sa_Precomputation = &__pyx_type_4cdec_2sa_3_sa_Precomputation;
if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__ = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_27___iter__;
- if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_21_add_instance;
__pyx_vtabptr_4cdec_2sa_3_sa_TrieMap = &__pyx_vtable_4cdec_2sa_3_sa_TrieMap;
__pyx_vtable_4cdec_2sa_3_sa_TrieMap._insert = (struct __pyx_t_4cdec_2sa_3_sa__Trie_Node *(*)(struct __pyx_obj_4cdec_2sa_3_sa_TrieMap *, int *, int))__pyx_f_4cdec_2sa_3_sa_7TrieMap__insert;
@@ -77450,18 +75997,18 @@ PyMODINIT_FUNC PyInit__sa(void)
__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__ = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_15___iter__;
if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_16___str__) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_16___str__ = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_16___str__;
- if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_TrieTable) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__Pyx_SetAttrString(__pyx_m, "TrieTable", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_TrieTable) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_TrieTable) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetAttrString(__pyx_m, "TrieTable", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_TrieTable) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_2sa_3_sa_TrieTable = &__pyx_type_4cdec_2sa_3_sa_TrieTable;
if (PyType_Ready(&__pyx_type_4cdec_2sa_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_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_11_encode_words;
- if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_25_genexpr;
if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_12_genexpr;
if (PyType_Ready(&__pyx_type_4cdec_2sa_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_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_6_genexpr;
- if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_22_form_rule;
if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_10_genexpr;
@@ -77477,9 +76024,9 @@ PyMODINIT_FUNC PyInit__sa(void)
__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_7_decode_lattice;
__pyx_vtabptr_4cdec_2sa_3_sa_PhraseLocation = &__pyx_vtable_4cdec_2sa_3_sa_PhraseLocation;
__pyx_vtable_4cdec_2sa_3_sa_PhraseLocation.contains = (int (*)(struct __pyx_obj_4cdec_2sa_3_sa_PhraseLocation *, int))__pyx_f_4cdec_2sa_3_sa_14PhraseLocation_contains;
- if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_PhraseLocation.tp_dict, __pyx_vtabptr_4cdec_2sa_3_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__Pyx_SetAttrString(__pyx_m, "PhraseLocation", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_PhraseLocation.tp_dict, __pyx_vtabptr_4cdec_2sa_3_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetAttrString(__pyx_m, "PhraseLocation", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_PhraseLocation) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_2sa_3_sa_PhraseLocation = &__pyx_type_4cdec_2sa_3_sa_PhraseLocation;
__pyx_vtabptr_4cdec_2sa_3_sa_Scorer = &__pyx_vtable_4cdec_2sa_3_sa_Scorer;
__pyx_vtable_4cdec_2sa_3_sa_Scorer.score = (struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector *(*)(struct __pyx_obj_4cdec_2sa_3_sa_Scorer *, PyObject *))__pyx_f_4cdec_2sa_3_sa_6Scorer_score;
@@ -77487,8 +76034,8 @@ PyMODINIT_FUNC PyInit__sa(void)
if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_Scorer.tp_dict, __pyx_vtabptr_4cdec_2sa_3_sa_Scorer) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__Pyx_SetAttrString(__pyx_m, "Scorer", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_Scorer) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_2sa_3_sa_Scorer = &__pyx_type_4cdec_2sa_3_sa_Scorer;
- if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_Sampler) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__Pyx_SetAttrString(__pyx_m, "Sampler", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_Sampler) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_Sampler) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetAttrString(__pyx_m, "Sampler", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_Sampler) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_2sa_3_sa_Sampler = &__pyx_type_4cdec_2sa_3_sa_Sampler;
__pyx_vtabptr_4cdec_2sa_3_sa_Alphabet = &__pyx_vtable_4cdec_2sa_3_sa_Alphabet;
__pyx_vtable_4cdec_2sa_3_sa_Alphabet.isvar = (int (*)(struct __pyx_obj_4cdec_2sa_3_sa_Alphabet *, int))__pyx_f_4cdec_2sa_3_sa_8Alphabet_isvar;
@@ -77542,9 +76089,9 @@ PyMODINIT_FUNC PyInit__sa(void)
__pyx_vtable_4cdec_2sa_3_sa_HieroCachingRuleFactory.extract_phrases = (PyObject *(*)(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *, int, int, int *, int *, int *, int, int, int, int *, int *, int *, int, int, int))__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract_phrases;
__pyx_vtable_4cdec_2sa_3_sa_HieroCachingRuleFactory.create_alignments = (struct __pyx_obj_4cdec_2sa_3_sa_IntList *(*)(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *, int *, int, struct __pyx_obj_4cdec_2sa_3_sa_IntList *, struct __pyx_obj_4cdec_2sa_3_sa_IntList *))__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_create_alignments;
__pyx_vtable_4cdec_2sa_3_sa_HieroCachingRuleFactory.extract = (PyObject *(*)(struct __pyx_obj_4cdec_2sa_3_sa_HieroCachingRuleFactory *, struct __pyx_obj_4cdec_2sa_3_sa_Phrase *, struct __pyx_t_4cdec_2sa_3_sa_Matching *, int *, int))__pyx_f_4cdec_2sa_3_sa_23HieroCachingRuleFactory_extract;
- if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_HieroCachingRuleFactory) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_HieroCachingRuleFactory.tp_dict, __pyx_vtabptr_4cdec_2sa_3_sa_HieroCachingRuleFactory) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__Pyx_SetAttrString(__pyx_m, "HieroCachingRuleFactory", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_HieroCachingRuleFactory) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa_HieroCachingRuleFactory) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetVtable(__pyx_type_4cdec_2sa_3_sa_HieroCachingRuleFactory.tp_dict, __pyx_vtabptr_4cdec_2sa_3_sa_HieroCachingRuleFactory) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetAttrString(__pyx_m, "HieroCachingRuleFactory", (PyObject *)&__pyx_type_4cdec_2sa_3_sa_HieroCachingRuleFactory) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_2sa_3_sa_HieroCachingRuleFactory = &__pyx_type_4cdec_2sa_3_sa_HieroCachingRuleFactory;
if (PyType_Ready(&__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_28___str__) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_2sa_3_sa___pyx_scope_struct_28___str__ = &__pyx_type_4cdec_2sa_3_sa___pyx_scope_struct_28___str__;
@@ -77942,7 +76489,7 @@ PyMODINIT_FUNC PyInit__sa(void)
* 'fsample_count',
* 'paircount',
*/
- __pyx_t_3 = PyList_New(7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_New(3); 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));
@@ -77953,18 +76500,6 @@ PyMODINIT_FUNC PyInit__sa(void)
__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_INCREF(((PyObject *)__pyx_n_s__bilex_ef));
- PyList_SET_ITEM(__pyx_t_3, 6, ((PyObject *)__pyx_n_s__bilex_ef));
- __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bilex_ef));
__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_152));
@@ -77980,8 +76515,8 @@ PyMODINIT_FUNC PyInit__sa(void)
if (PyDict_SetItem(__pyx_d, __pyx_n_s_152, __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/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":67
- * self.bilex_ef = defaultdict(lambda: defaultdict(int))
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":53
+ * self.phrases_al = defaultdict(lambda: defaultdict(tuple))
*
* cdef int PRECOMPUTE = 0 # <<<<<<<<<<<<<<
* cdef int MERGE = 1
@@ -77989,7 +76524,7 @@ PyMODINIT_FUNC PyInit__sa(void)
*/
__pyx_v_4cdec_2sa_3_sa_PRECOMPUTE = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":68
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":54
*
* cdef int PRECOMPUTE = 0
* cdef int MERGE = 1 # <<<<<<<<<<<<<<
@@ -77998,7 +76533,7 @@ PyMODINIT_FUNC PyInit__sa(void)
*/
__pyx_v_4cdec_2sa_3_sa_MERGE = 1;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":69
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":55
* cdef int PRECOMPUTE = 0
* cdef int MERGE = 1
* cdef int BAEZA_YATES = 2 # <<<<<<<<<<<<<<
@@ -78007,7 +76542,7 @@ PyMODINIT_FUNC PyInit__sa(void)
*/
__pyx_v_4cdec_2sa_3_sa_BAEZA_YATES = 2;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":72
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":58
*
* # NOTE: was encoded as a non-terminal in the previous version
* cdef int EPSILON = sym_fromstring('*EPS*', True) # <<<<<<<<<<<<<<
@@ -78016,53 +76551,53 @@ PyMODINIT_FUNC PyInit__sa(void)
*/
__pyx_v_4cdec_2sa_3_sa_EPSILON = __pyx_f_4cdec_2sa_3_sa_sym_fromstring(__pyx_k_176, 1);
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":95
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":81
* cdef public int count
* cdef public root
* def __cinit__(self, extended=False): # <<<<<<<<<<<<<<
* self.count = 0
* self.extended = extended
*/
- __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_k_103 = __pyx_t_3;
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2211
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2171
*
* # Spans are _inclusive_ on both ends [i, j]
* def span_check(vec, i, j): # <<<<<<<<<<<<<<
* k = i
* while k <= j:
*/
- __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_17span_check, NULL, __pyx_n_s_102); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_17span_check, NULL, __pyx_n_s_102); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__span_check, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s__span_check, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2219
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2179
* return True
*
* def span_inc(vec, i, j): # <<<<<<<<<<<<<<
* k = i
* while k <= j:
*/
- __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_19span_inc, NULL, __pyx_n_s_102); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_19span_inc, NULL, __pyx_n_s_102); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__span_inc, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s__span_inc, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2225
+ /* "/home/mdenkows/cdec/python/cdec/sa/rulefactory.pxi":2185
* k += 1
*
* def span_dec(vec, i, j): # <<<<<<<<<<<<<<
* k = i
* while k <= j:
*/
- __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_21span_dec, NULL, __pyx_n_s_102); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_4cdec_2sa_3_sa_21span_dec, NULL, __pyx_n_s_102); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__span_dec, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s__span_dec, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "/home/mdenkows/cdec/python/cdec/sa/features.pxi":1
diff --git a/python/cdec/sa/compile.py b/python/cdec/sa/compile.py
index 3cdf212f..a5bd0699 100644
--- a/python/cdec/sa/compile.py
+++ b/python/cdec/sa/compile.py
@@ -132,9 +132,11 @@ def main():
start_time = monitor_cpu()
logger.info('Compiling online bilexical dictionary')
if args.bitext:
- bilex = cdec.sa.online.Bilex(alignment_f=args.alignment, text_f=args.bitext)
+ bilex = cdec.sa.online.Bilex()
+ bilex.add_bitext(args.alignment, args.bitext)
else:
- bilex = cdec.sa.online.Bilex(alignment_f=args.alignment, text_f=args.source, text_target_f=args.target)
+ bilex = cdec.sa.online.Bilex()
+ bilex.add_bitext(args.alignment, args.source, args.target)
bilex.write(bilex_file)
stop_time = monitor_cpu()
logger.info('Compiling online bilexical dictionary took %f seconds', stop_time - start_time)
diff --git a/python/cdec/sa/extractor.py b/python/cdec/sa/extractor.py
index 25313cc3..c2ded1d6 100644
--- a/python/cdec/sa/extractor.py
+++ b/python/cdec/sa/extractor.py
@@ -4,7 +4,7 @@ import cdec.configobj
from cdec.sa._sa import gzip_or_text
from cdec.sa.features import EgivenFCoherent, SampleCountF, CountEF,\
MaxLexEgivenF, MaxLexFgivenE, IsSingletonF, IsSingletonFE,\
- IsSupportedOnline, CountExceptLM
+ IsSupportedOnline
import cdec.sa
# maximum span of a grammar rule in TEST DATA
@@ -57,16 +57,16 @@ class GrammarExtractor:
)
# lexical weighting tables
- tt = cdec.sa.BiLex(from_binary=config['lex_file'])
+ if not online:
+ tt = cdec.sa.BiLex(from_binary=config['lex_file'])
+ else:
+ tt = cdec.sa.online.Bilex(config['bilex_file'])
# TODO: clean this up
# Load data and add features for online grammar extraction
extended_features = []
if online:
extended_features.append(IsSupportedOnline)
- vocab_file = config['vocab_file']
- vcb_set = set(line.strip() for line in gzip_or_text(vocab))
- extended_features.append(CountExceptLM(vcb_set))
# TODO: use @cdec.sa.features decorator for standard features too
# + add a mask to disable features
diff --git a/python/cdec/sa/features.py b/python/cdec/sa/features.py
index 3e6af859..1779f2f9 100644
--- a/python/cdec/sa/features.py
+++ b/python/cdec/sa/features.py
@@ -44,60 +44,22 @@ def MaxLexEgivenF(ttable):
def MaxLexEgivenF(ctx):
fwords = ctx.fphrase.words
fwords.append('NULL')
- # Always use this for now
- if not ctx.online or ctx.online:
- maxOffScore = 0.0
- for e in ctx.ephrase.words:
- maxScore = max(ttable.get_score(f, e, 0) for f in fwords)
- maxOffScore += -math.log10(maxScore) if maxScore > 0 else MAXSCORE
- return maxOffScore
- else:
- # For now, straight average
- maxOffScore = 0.0
- maxOnScore = 0.0
- for e in ctx.ephrase.words:
- maxScore = max(ttable.get_score(f, e, 0) for f in fwords)
- maxOffScore += -math.log10(maxScore) if maxScore > 0 else MAXSCORE
- for e in ctx.ephrase:
- if not isvar(e):
- maxScore = 0.0
- for f in ctx.fphrase:
- if not isvar(f):
- b_f = ctx.online.bilex_f.get(f, 0)
- if b_f:
- maxScore = max(maxScore, ctx.online.bilex_fe.get(f, {}).get(e))
- maxOnScore += -math.log10(maxScore) if maxScore > 0 else MAXSCORE
- return (maxOffScore + maxOnScore) / 2
+ maxOffScore = 0.0
+ for e in ctx.ephrase.words:
+ maxScore = max(ttable.get_score(f, e, 0) for f in fwords)
+ maxOffScore += -math.log10(maxScore) if maxScore > 0 else MAXSCORE
+ return maxOffScore
return MaxLexEgivenF
def MaxLexFgivenE(ttable):
def MaxLexFgivenE(ctx):
ewords = ctx.ephrase.words
ewords.append('NULL')
- # Always use this for now
- if not ctx.online or ctx.online:
- maxOffScore = 0.0
- for f in ctx.fphrase.words:
- maxScore = max(ttable.get_score(f, e, 1) for e in ewords)
- maxOffScore += -math.log10(maxScore) if maxScore > 0 else MAXSCORE
- return maxOffScore
- else:
- # For now, straight average
- maxOffScore = 0.0
- maxOnScore = 0.0
- for f in ctx.fphrase.words:
- maxScore = max(ttable.get_score(f, e, 1) for e in ewords)
- maxOffScore += -math.log10(maxScore) if maxScore > 0 else MAXSCORE
- for f in ctx.fphrase:
- if not isvar(f):
- maxScore = 0.0
- for e in ctx.ephrase:
- if not isvar(e):
- b_e = ctx.online.bilex_e.get(e, 0)
- if b_e:
- maxScore = max(maxScore, ctx.online.bilex_fe.get(f, {}).get(e, 0) / b_e )
- maxOnScore += -math.log10(maxScore) if maxScore > 0 else MAXSCORE
- return (maxOffScore + maxOnScore) / 2
+ maxOffScore = 0.0
+ for f in ctx.fphrase.words:
+ maxScore = max(ttable.get_score(f, e, 1) for e in ewords)
+ maxOffScore += -math.log10(maxScore) if maxScore > 0 else MAXSCORE
+ return maxOffScore
return MaxLexFgivenE
def IsSingletonF(ctx):
@@ -140,8 +102,3 @@ def IsSupportedOnline(ctx): # Occurs in online data?
return (ctx.online.paircount > 0.01)
else:
return False
-
-def CountExceptLM(vocab):
- def CountExceptLM(ctx): # Word count in bitext (inc online data) but NOT mono text
- return sum(1 for e in ctx.ephrase.words if e not in vocab)
- return CountExceptLM
diff --git a/python/cdec/sa/online.py b/python/cdec/sa/online.py
index 92f6eae2..008793d8 100644
--- a/python/cdec/sa/online.py
+++ b/python/cdec/sa/online.py
@@ -26,28 +26,33 @@ def read_vocab(in_f):
class Bilex:
- def __init__(self, in_f=None, alignment_f=None, text_f=None, target_text_f=None):
+ def __init__(self, in_f=None):
self.f = collections.defaultdict(int)
self.e = collections.defaultdict(int)
self.fe = collections.defaultdict(lambda: collections.defaultdict(int))
self.ef = collections.defaultdict(lambda: collections.defaultdict(int))
-
- # Read from file
if in_f:
self.read(in_f)
- # Build from aligned bitext
- elif alignment_f:
- # Allow one or two args for bitext
- if target_text_f:
- t = itertools.izip((line.strip() for line in gzip_or_text(text_f)), (line.strip() for line in gzip_or_text(target_text_f)))
- else:
- t = (line.strip().split(' ||| ') for line in gzip_or_text(text_f))
- a = (line.strip() for line in gzip_or_text(alignment_f))
- for (source, target) in t:
- links = sorted(tuple(int(link) for link in link_str.split('-')) for link_str in a.next().split())
- self.update(source.split(), target.split(), links)
- # Add bilex counts from new aligned sentence pair
+ def get_score(self, f, e, dir):
+ if dir == 0:
+ return self.p_fe(f, e)
+ if dir == 1:
+ return self.p_ef(e, f)
+
+ def p_fe(self, f, e):
+ d = self.fe.get(f, None)
+ if not d:
+ return 0
+ return d.get(e, 0) / self.f.get(f)
+
+ def p_ef(self, e, f):
+ d = self.ef.get(e, None)
+ if not d:
+ return 0
+ return d.get(f, 0) / self.e.get(e)
+
+ # Update counts from aligned sentence
def update(self, f_words, e_words, links):
aligned_fe = [list() for _ in range(len(f_words))]
aligned_ef = [list() for _ in range(len(e_words))]
@@ -73,6 +78,18 @@ class Bilex:
else:
self.ef[e_words[e_i]][NULL_WORD] += 1
+ # Update counts from alignd bitext
+ def add_bitext(self, alignment_f, text_f, target_text_f=None):
+ # Allow one or two args for bitext
+ if target_text_f:
+ t = itertools.izip((line.strip() for line in gzip_or_text(text_f)), (line.strip() for line in gzip_or_text(target_text_f)))
+ else:
+ t = (line.strip().split(' ||| ') for line in gzip_or_text(text_f))
+ a = (line.strip() for line in gzip_or_text(alignment_f))
+ for (source, target) in t:
+ links = sorted(tuple(int(link) for link in link_str.split('-')) for link_str in a.next().split())
+ self.update(source.split(), target.split(), links)
+
def write(self, out_f):
fv = sorted(self.f)
ev = sorted(self.e)
@@ -92,4 +109,27 @@ class Bilex:
def read(self, in_f):
with gzip_or_text(in_f) as inp:
- pass
+ while True:
+ line = inp.readline().strip()
+ if not line:
+ break
+ (w, c) = line.split()
+ self.f[w] = int(c)
+ while True:
+ line = inp.readline().strip()
+ if not line:
+ break
+ (w, c) = line.split()
+ self.e[w] = int(c)
+ while True:
+ line = inp.readline().strip()
+ if not line:
+ break
+ (f, e, c) = line.split()
+ self.fe[f][e] = float(c)
+ while True:
+ line = inp.readline().strip()
+ if not line:
+ break
+ (e, f, c) = line.split()
+ self.ef[e][f] = float(c)
diff --git a/python/cdec/sa/rulefactory.pxi b/python/cdec/sa/rulefactory.pxi
index 86b994b9..ca3321a4 100644
--- a/python/cdec/sa/rulefactory.pxi
+++ b/python/cdec/sa/rulefactory.pxi
@@ -31,10 +31,6 @@ OnlineFeatureContext = namedtuple('OnlineFeatureContext',
['fcount',
'fsample_count',
'paircount',
- 'bilex_f',
- 'bilex_e',
- 'bilex_fe',
- 'bilex_ef'
])
cdef class OnlineStats:
@@ -43,10 +39,6 @@ cdef class OnlineStats:
cdef public phrases_e
cdef public phrases_fe
cdef public phrases_al
- cdef public bilex_f
- cdef public bilex_e
- cdef public bilex_fe
- cdef public bilex_ef
def __cinit__(self):
# Keep track of everything that can be sampled:
@@ -58,12 +50,6 @@ cdef class OnlineStats:
self.phrases_fe = defaultdict(lambda: defaultdict(int))
self.phrases_al = defaultdict(lambda: defaultdict(tuple))
- # Bilexical counts
- self.bilex_f = defaultdict(int)
- self.bilex_e = defaultdict(int)
- self.bilex_fe = defaultdict(lambda: defaultdict(int))
- self.bilex_ef = defaultdict(lambda: defaultdict(int))
-
cdef int PRECOMPUTE = 0
cdef int MERGE = 1
cdef int BAEZA_YATES = 2
@@ -2054,32 +2040,6 @@ cdef class HieroCachingRuleFactory:
if not stats.phrases_al[f_ph][e_ph]:
stats.phrases_al[f_ph][e_ph] = al
- # Update Bilexical counts
- aligned_fe = [list() for _ in range(len(f_words))]
- aligned_ef = [list() for _ in range(len(e_words))]
- null_word = sym_fromstring('NULL', True)
- for (i, j) in alignment:
- aligned_fe[i].append(j)
- aligned_ef[j].append(i)
- for f_i in range(len(f_words)):
- stats.bilex_f[f_words[f_i]] += 1
- e_i_aligned = aligned_fe[f_i]
- lc = len(e_i_aligned)
- if lc > 0:
- for e_i in e_i_aligned:
- stats.bilex_fe[f_words[f_i]][e_words[e_i]] += (1.0) / lc
- else:
- stats.bilex_fe[f_words[f_i]][null_word] += 1
- for e_i in range(len(e_words)):
- stats.bilex_e[e_words[e_i]] += 1
- f_i_aligned = aligned_ef[e_i]
- lc = len(f_i_aligned)
- if lc > 0:
- for f_i in f_i_aligned:
- stats.bilex_ef[e_words[e_i]][f_words[f_i]] += (1.0) / lc
- else:
- stats.bilex_ef[e_words[e_i]][null_word] += 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):
@@ -2159,7 +2119,7 @@ cdef class HieroCachingRuleFactory:
fsample_count = stats.samples_f.get(f, 0)
d = stats.phrases_fe.get(f, None)
paircount = d.get(e, 0) if d else 0
- return OnlineFeatureContext(fcount, fsample_count, paircount, stats.bilex_f, stats.bilex_e, stats.bilex_fe)
+ return OnlineFeatureContext(fcount, fsample_count, paircount)
return None
# Find all phrases that we might try to extract