summaryrefslogtreecommitdiff
path: root/python/cdec/_cdec.cpp
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2014-06-12 13:56:42 +0200
committerPatrick Simianer <p@simianer.de>2014-06-12 13:56:42 +0200
commit244971287003d079e46193b8a209c28955f90134 (patch)
tree8beaae6b12b913acb213fc7f2415fd63886192f9 /python/cdec/_cdec.cpp
parent5250fd67a4b8f242068cff87f0a6a4211f8b0fcf (diff)
parentb66e838ed52decc0be1eb5817b2a77c3840db2c5 (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'python/cdec/_cdec.cpp')
-rw-r--r--python/cdec/_cdec.cpp5937
1 files changed, 3621 insertions, 2316 deletions
diff --git a/python/cdec/_cdec.cpp b/python/cdec/_cdec.cpp
index ef203fd9..03b22bb1 100644
--- a/python/cdec/_cdec.cpp
+++ b/python/cdec/_cdec.cpp
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.19.1 on Fri Nov 15 21:03:05 2013 */
+/* Generated by Cython 0.19.1 on Sat May 17 14:41:25 2014 */
#define PY_SSIZE_T_CLEAN
#ifndef CYTHON_USE_PYLONG_INTERNALS
@@ -529,54 +529,57 @@ static const char *__pyx_f[] = {
};
/*--- Type declarations ---*/
+struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___iter__;
struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector;
-struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22___iter__;
struct __pyx_obj_4cdec_5_cdec_DenseVector;
struct __pyx_obj_4cdec_5_cdec_SufficientStats;
+struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23_lines;
struct __pyx_obj_4cdec_5_cdec_TRule;
struct __pyx_obj_4cdec_5_cdec_MRule;
+struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_27___init__;
struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_21___iter__;
struct __pyx_obj_4cdec_5_cdec_Metric;
+struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest;
struct __pyx_obj_4cdec_2sa_3_sa_IntList;
struct __pyx_obj_4cdec_5_cdec_SparseVector;
-struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15___get__;
+struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_26__make_config;
struct __pyx_obj_4cdec_5_cdec_NT;
struct __pyx_obj_4cdec_5_cdec_Lattice;
-struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23__make_config;
+struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15_sample_trees;
struct __pyx_obj_4cdec_5_cdec_HypergraphEdge;
struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_2__phrase;
-struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13___get__;
struct __pyx_obj_4cdec_2sa_3_sa_Rule;
-struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20_lines;
struct __pyx_obj_4cdec_5_cdec_Scorer;
struct __pyx_obj_4cdec_5_cdec_HypergraphNode;
struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_10_kbest_features;
struct __pyx_obj_4cdec_5_cdec_NTRef;
struct __pyx_obj_4cdec_5_cdec_Grammar;
struct __pyx_obj_4cdec_5_cdec_Hypergraph;
-struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___init__;
struct __pyx_obj_4cdec_5_cdec_CandidateSet;
struct __pyx_obj_4cdec_2sa_3_sa_FloatList;
+struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22_todot;
struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees;
-struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19_todot;
struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_5___str__;
struct __pyx_obj_4cdec_5_cdec_SegmentEvaluator;
struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_16___get__;
-struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25_genexpr;
+struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20___get__;
+struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features;
+struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_28_genexpr;
struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_3_genexpr;
-struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_sample;
struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_8_kbest;
-struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14___get__;
struct __pyx_obj_4cdec_2sa_3_sa_Phrase;
+struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___get__;
struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_7___iter__;
+struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19___get__;
struct __pyx_obj_4cdec_5_cdec_TextGrammar;
+struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25___iter__;
struct __pyx_obj_4cdec_5_cdec_Decoder;
struct __pyx_obj_4cdec_5_cdec_Candidate;
+struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14_sample;
struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__;
-struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___iter__;
struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct____iter__;
struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_6_genexpr;
-struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_sample_trees;
+struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees;
struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_4___get__;
struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_1___iter__;
struct __pyx_opt_args_4cdec_5_cdec_as_str;
@@ -593,6 +596,23 @@ struct __pyx_opt_args_4cdec_5_cdec_as_str {
char *error_msg;
};
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":44
+ * return self.stats.size()
+ *
+ * def __iter__(self): # <<<<<<<<<<<<<<
+ * for i in range(len(self)):
+ * yield self[i]
+ */
+struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___iter__ {
+ PyObject_HEAD
+ PyObject *__pyx_v_i;
+ struct __pyx_obj_4cdec_5_cdec_SufficientStats *__pyx_v_self;
+ Py_ssize_t __pyx_t_0;
+ PyObject *__pyx_t_1;
+ PyObject *(*__pyx_t_2)(PyObject *);
+};
+
+
/* "cdec/sa/_sa.pxd":25
* cdef void read_handle(self, FILE* f)
*
@@ -607,23 +627,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector {
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":90
- * return candidate
- *
- * def __iter__(self): # <<<<<<<<<<<<<<
- * cdef unsigned i
- * for i in range(len(self)):
- */
-struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22___iter__ {
- PyObject_HEAD
- unsigned int __pyx_v_i;
- struct __pyx_obj_4cdec_5_cdec_CandidateSet *__pyx_v_self;
- Py_ssize_t __pyx_t_0;
- unsigned int __pyx_t_1;
-};
-
-
-/* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":3
+/* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":3
* from cython.operator cimport preincrement as pinc
*
* cdef class DenseVector: # <<<<<<<<<<<<<<
@@ -637,7 +641,7 @@ struct __pyx_obj_4cdec_5_cdec_DenseVector {
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":26
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":26
* return fmap
*
* cdef class SufficientStats: # <<<<<<<<<<<<<<
@@ -651,7 +655,30 @@ struct __pyx_obj_4cdec_5_cdec_SufficientStats {
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":49
+/* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":63
+ * def todot(self):
+ * """lattice.todot() -> Representation of the lattice in GraphViz dot format."""
+ * def lines(): # <<<<<<<<<<<<<<
+ * yield 'digraph lattice {'
+ * yield 'rankdir = LR;'
+ */
+struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23_lines {
+ PyObject_HEAD
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22_todot *__pyx_outer_scope;
+ PyObject *__pyx_v_delta;
+ PyObject *__pyx_v_i;
+ PyObject *__pyx_v_label;
+ PyObject *__pyx_v_weight;
+ Py_ssize_t __pyx_t_0;
+ PyObject *__pyx_t_1;
+ PyObject *(*__pyx_t_2)(PyObject *);
+ PyObject *__pyx_t_3;
+ Py_ssize_t __pyx_t_4;
+ PyObject *(*__pyx_t_5)(PyObject *);
+};
+
+
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":49
* return TRule(lhs, f, e, scores, a)
*
* cdef class TRule: # <<<<<<<<<<<<<<
@@ -664,7 +691,7 @@ struct __pyx_obj_4cdec_5_cdec_TRule {
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":177
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":183
* _phrase(self.f), _phrase(self.e), scores)
*
* cdef class MRule(TRule): # <<<<<<<<<<<<<<
@@ -676,24 +703,36 @@ struct __pyx_obj_4cdec_5_cdec_MRule {
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":44
- * return self.stats.size()
+/* "cdec/_cdec.pyx":47
+ * cdef DenseVector weights
+ *
+ * def __init__(self, config_str=None, **config): # <<<<<<<<<<<<<<
+ * """Decoder('formalism = scfg') -> initialize from configuration string
+ * Decoder(formalism='scfg') -> initialize from named parameters
+ */
+struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_27___init__ {
+ PyObject_HEAD
+ PyObject *__pyx_v_config;
+};
+
+
+/* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":56
+ * return unicode(str(self), 'utf8')
*
* def __iter__(self): # <<<<<<<<<<<<<<
+ * cdef unsigned i
* for i in range(len(self)):
- * yield self[i]
*/
struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_21___iter__ {
PyObject_HEAD
- PyObject *__pyx_v_i;
- struct __pyx_obj_4cdec_5_cdec_SufficientStats *__pyx_v_self;
+ unsigned int __pyx_v_i;
+ struct __pyx_obj_4cdec_5_cdec_Lattice *__pyx_v_self;
Py_ssize_t __pyx_t_0;
- PyObject *__pyx_t_1;
- PyObject *(*__pyx_t_2)(PyObject *);
+ unsigned int __pyx_t_1;
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":176
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":176
* out.fields[i] = ss[i]
*
* cdef class Metric: # <<<<<<<<<<<<<<
@@ -706,6 +745,25 @@ struct __pyx_obj_4cdec_5_cdec_Metric {
};
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":97
+ * del derivations
+ *
+ * def unique_kbest(self, size): # <<<<<<<<<<<<<<
+ * """hg.kbest(size) -> List of unique k-best hypotheses in the hypergraph."""
+ * cdef kbest.KBestDerivations[vector[WordID], kbest.ESentenceTraversal, kbest.FilterUnique]* derivations = new kbest.KBestDerivations[vector[WordID], kbest.ESentenceTraversal, kbest.FilterUnique](self.hg[0], size)
+ */
+struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest {
+ PyObject_HEAD
+ KBest::KBestDerivations<std::vector<WordID>,ESentenceTraversal,KBest::FilterUnique>::Derivation *__pyx_v_derivation;
+ KBest::KBestDerivations<std::vector<WordID>,ESentenceTraversal,KBest::FilterUnique> *__pyx_v_derivations;
+ unsigned int __pyx_v_k;
+ struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self;
+ PyObject *__pyx_v_size;
+ unsigned int __pyx_t_0;
+ long __pyx_t_1;
+};
+
+
/* "cdec/sa/_sa.pxd":12
* cdef void read_handle(self, FILE* f)
*
@@ -723,7 +781,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_IntList {
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":48
+/* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":48
* return sparse
*
* cdef class SparseVector: # <<<<<<<<<<<<<<
@@ -736,23 +794,30 @@ struct __pyx_obj_4cdec_5_cdec_SparseVector {
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":216
+/* "cdec/_cdec.pyx":32
+ * SetSilent(yn)
*
- * property tail_nodes:
- * def __get__(self): # <<<<<<<<<<<<<<
- * cdef unsigned i
- * for i in range(self.edge.tail_nodes_.size()):
+ * def _make_config(config): # <<<<<<<<<<<<<<
+ * for key, value in config.items():
+ * if isinstance(value, dict):
*/
-struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15___get__ {
+struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_26__make_config {
PyObject_HEAD
- unsigned int __pyx_v_i;
- struct __pyx_obj_4cdec_5_cdec_HypergraphEdge *__pyx_v_self;
- unsigned int __pyx_t_0;
- unsigned int __pyx_t_1;
+ PyObject *__pyx_v_config;
+ PyObject *__pyx_v_info;
+ PyObject *__pyx_v_key;
+ PyObject *__pyx_v_name;
+ PyObject *__pyx_v_value;
+ PyObject *__pyx_t_0;
+ PyObject *__pyx_t_1;
+ Py_ssize_t __pyx_t_2;
+ PyObject *(*__pyx_t_3)(PyObject *);
+ Py_ssize_t __pyx_t_4;
+ PyObject *(*__pyx_t_5)(PyObject *);
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":8
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":8
* return ' '.join(w.encode('utf8') if isinstance(w, unicode) else str(w) for w in phrase)
*
* cdef class NT: # <<<<<<<<<<<<<<
@@ -766,7 +831,7 @@ struct __pyx_obj_4cdec_5_cdec_NT {
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":3
+/* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":3
* cimport lattice
*
* cdef class Lattice: # <<<<<<<<<<<<<<
@@ -779,30 +844,25 @@ struct __pyx_obj_4cdec_5_cdec_Lattice {
};
-/* "cdec/_cdec.pyx":32
- * SetSilent(yn)
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":156
+ * del hypos
*
- * def _make_config(config): # <<<<<<<<<<<<<<
- * for key, value in config.items():
- * if isinstance(value, dict):
+ * def sample_trees(self, unsigned n): # <<<<<<<<<<<<<<
+ * """hg.sample_trees(n) -> Sample of n trees from the hypergraph."""
+ * cdef vector[string]* trees = new vector[string]()
*/
-struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23__make_config {
+struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15_sample_trees {
PyObject_HEAD
- PyObject *__pyx_v_config;
- PyObject *__pyx_v_info;
- PyObject *__pyx_v_key;
- PyObject *__pyx_v_name;
- PyObject *__pyx_v_value;
- PyObject *__pyx_t_0;
- PyObject *__pyx_t_1;
- Py_ssize_t __pyx_t_2;
- PyObject *(*__pyx_t_3)(PyObject *);
- Py_ssize_t __pyx_t_4;
- PyObject *(*__pyx_t_5)(PyObject *);
+ unsigned int __pyx_v_k;
+ unsigned int __pyx_v_n;
+ struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self;
+ std::vector<std::string> *__pyx_v_trees;
+ size_t __pyx_t_0;
+ unsigned int __pyx_t_1;
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":196
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":244
* return vector
*
* cdef class HypergraphEdge: # <<<<<<<<<<<<<<
@@ -818,7 +878,7 @@ struct __pyx_obj_4cdec_5_cdec_HypergraphEdge {
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":5
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":5
* import cdec.sa._sa as _sa
*
* def _phrase(phrase): # <<<<<<<<<<<<<<
@@ -831,22 +891,6 @@ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_2__phrase {
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":161
- *
- * property edges:
- * def __get__(self): # <<<<<<<<<<<<<<
- * cdef unsigned i
- * for i in range(self.hg.edges_.size()):
- */
-struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13___get__ {
- PyObject_HEAD
- unsigned int __pyx_v_i;
- struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self;
- size_t __pyx_t_0;
- unsigned int __pyx_t_1;
-};
-
-
/* "cdec/sa/_sa.pxd":35
* cdef public int chunklen(self, int k)
*
@@ -865,30 +909,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_Rule {
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":63
- * def todot(self):
- * """lattice.todot() -> Representation of the lattice in GraphViz dot format."""
- * def lines(): # <<<<<<<<<<<<<<
- * yield 'digraph lattice {'
- * yield 'rankdir = LR;'
- */
-struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20_lines {
- PyObject_HEAD
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19_todot *__pyx_outer_scope;
- PyObject *__pyx_v_delta;
- PyObject *__pyx_v_i;
- PyObject *__pyx_v_label;
- PyObject *__pyx_v_weight;
- Py_ssize_t __pyx_t_0;
- PyObject *__pyx_t_1;
- PyObject *(*__pyx_t_2)(PyObject *);
- PyObject *__pyx_t_3;
- Py_ssize_t __pyx_t_4;
- PyObject *(*__pyx_t_5)(PyObject *);
-};
-
-
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":121
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":121
* return CandidateSet(self)
*
* cdef class Scorer: # <<<<<<<<<<<<<<
@@ -902,7 +923,7 @@ struct __pyx_obj_4cdec_5_cdec_Scorer {
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":246
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":294
* raise NotImplemented('comparison not implemented for HypergraphEdge')
*
* cdef class HypergraphNode: # <<<<<<<<<<<<<<
@@ -917,17 +938,17 @@ struct __pyx_obj_4cdec_5_cdec_HypergraphNode {
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":81
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":81
* del e_derivations
*
* def kbest_features(self, size): # <<<<<<<<<<<<<<
* """hg.kbest_trees(size) -> List of k-best feature vectors in the hypergraph."""
- * cdef kbest.KBestDerivations[FastSparseVector[weight_t], kbest.FeatureVectorTraversal]* derivations = new kbest.KBestDerivations[FastSparseVector[weight_t], kbest.FeatureVectorTraversal](self.hg[0], size)
+ * cdef kbest.KBestDerivations[FastSparseVector[weight_t], kbest.FeatureVectorTraversal, kbest.NoFilter[FastSparseVector[double]]]* derivations = new kbest.KBestDerivations[FastSparseVector[weight_t], kbest.FeatureVectorTraversal, kbest.NoFilter[FastSparseVector[double]]](self.hg[0], size)
*/
struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_10_kbest_features {
PyObject_HEAD
- KBest::KBestDerivations<FastSparseVector<weight_t>,FeatureVectorTraversal>::Derivation *__pyx_v_derivation;
- KBest::KBestDerivations<FastSparseVector<weight_t>,FeatureVectorTraversal> *__pyx_v_derivations;
+ KBest::KBestDerivations<FastSparseVector<weight_t>,FeatureVectorTraversal,KBest::NoFilter<FastSparseVector<double> > >::Derivation *__pyx_v_derivation;
+ KBest::KBestDerivations<FastSparseVector<weight_t>,FeatureVectorTraversal,KBest::NoFilter<FastSparseVector<double> > > *__pyx_v_derivations;
struct __pyx_obj_4cdec_5_cdec_SparseVector *__pyx_v_fmap;
unsigned int __pyx_v_k;
struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self;
@@ -937,7 +958,7 @@ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_10_kbest_features {
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":21
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":21
* return '[%s]' % self.cat
*
* cdef class NTRef: # <<<<<<<<<<<<<<
@@ -950,7 +971,7 @@ struct __pyx_obj_4cdec_5_cdec_NTRef {
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":193
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":199
* super(MRule, self).__init__(lhs, rhs, e, scores, None)
*
* cdef class Grammar: # <<<<<<<<<<<<<<
@@ -963,7 +984,7 @@ struct __pyx_obj_4cdec_5_cdec_Grammar {
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":4
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":4
* cimport kbest
*
* cdef class Hypergraph: # <<<<<<<<<<<<<<
@@ -978,20 +999,7 @@ struct __pyx_obj_4cdec_5_cdec_Hypergraph {
};
-/* "cdec/_cdec.pyx":47
- * cdef DenseVector weights
- *
- * def __init__(self, config_str=None, **config): # <<<<<<<<<<<<<<
- * """Decoder('formalism = scfg') -> initialize from configuration string
- * Decoder(formalism='scfg') -> initialize from named parameters
- */
-struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___init__ {
- PyObject_HEAD
- PyObject *__pyx_v_config;
-};
-
-
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":65
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":65
* return result
*
* cdef class CandidateSet: # <<<<<<<<<<<<<<
@@ -1023,20 +1031,33 @@ struct __pyx_obj_4cdec_2sa_3_sa_FloatList {
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":62
+/* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":61
+ * yield self[i]
+ *
+ * def todot(self): # <<<<<<<<<<<<<<
+ * """lattice.todot() -> Representation of the lattice in GraphViz dot format."""
+ * def lines():
+ */
+struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22_todot {
+ PyObject_HEAD
+ struct __pyx_obj_4cdec_5_cdec_Lattice *__pyx_v_self;
+};
+
+
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":62
* del derivations
*
* def kbest_trees(self, size): # <<<<<<<<<<<<<<
- * """hg.kbest_trees(size) -> List of k-best trees in the hypergraph."""
- * cdef kbest.KBestDerivations[vector[WordID], kbest.FTreeTraversal]* f_derivations = new kbest.KBestDerivations[vector[WordID], kbest.FTreeTraversal](self.hg[0], size)
+ * """hg.kbest_trees(size) -> List of k-best trees in the hypergrapt.NoFilter."""
+ * cdef kbest.KBestDerivations[vector[WordID], kbest.FTreeTraversal, kbest.NoFilter[vector[int]]]* f_derivations = new kbest.KBestDerivations[vector[WordID], kbest.FTreeTraversal, kbest.NoFilter[vector[int]]](self.hg[0], size)
*/
struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees {
PyObject_HEAD
- KBest::KBestDerivations<std::vector<WordID>,ETreeTraversal>::Derivation *__pyx_v_e_derivation;
- KBest::KBestDerivations<std::vector<WordID>,ETreeTraversal> *__pyx_v_e_derivations;
+ KBest::KBestDerivations<std::vector<WordID>,ETreeTraversal,KBest::NoFilter<std::vector<int> > >::Derivation *__pyx_v_e_derivation;
+ KBest::KBestDerivations<std::vector<WordID>,ETreeTraversal,KBest::NoFilter<std::vector<int> > > *__pyx_v_e_derivations;
PyObject *__pyx_v_e_tree;
- KBest::KBestDerivations<std::vector<WordID>,FTreeTraversal>::Derivation *__pyx_v_f_derivation;
- KBest::KBestDerivations<std::vector<WordID>,FTreeTraversal> *__pyx_v_f_derivations;
+ KBest::KBestDerivations<std::vector<WordID>,FTreeTraversal,KBest::NoFilter<std::vector<int> > >::Derivation *__pyx_v_f_derivation;
+ KBest::KBestDerivations<std::vector<WordID>,FTreeTraversal,KBest::NoFilter<std::vector<int> > > *__pyx_v_f_derivations;
PyObject *__pyx_v_f_tree;
unsigned int __pyx_v_k;
struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self;
@@ -1046,20 +1067,7 @@ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees {
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":61
- * yield self[i]
- *
- * def todot(self): # <<<<<<<<<<<<<<
- * """lattice.todot() -> Representation of the lattice in GraphViz dot format."""
- * def lines():
- */
-struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19_todot {
- PyObject_HEAD
- struct __pyx_obj_4cdec_5_cdec_Lattice *__pyx_v_self;
-};
-
-
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":172
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":178
* self.rule.get().lhs_ = -TDConvert((<NT> lhs).cat)
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -1072,7 +1080,7 @@ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_5___str__ {
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":100
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":100
* self.cs.AddKBestCandidates(hypergraph.hg[0], k, self.scorer.get())
*
* cdef class SegmentEvaluator: # <<<<<<<<<<<<<<
@@ -1086,22 +1094,58 @@ struct __pyx_obj_4cdec_5_cdec_SegmentEvaluator {
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":260
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":209
*
- * property in_edges:
+ * property edges:
* def __get__(self): # <<<<<<<<<<<<<<
* cdef unsigned i
- * for i in range(self.node.in_edges_.size()):
+ * for i in range(self.hg.edges_.size()):
*/
struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_16___get__ {
PyObject_HEAD
unsigned int __pyx_v_i;
+ struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self;
+ size_t __pyx_t_0;
+ unsigned int __pyx_t_1;
+};
+
+
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":314
+ *
+ * property out_edges:
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * cdef unsigned i
+ * for i in range(self.node.out_edges_.size()):
+ */
+struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20___get__ {
+ PyObject_HEAD
+ unsigned int __pyx_v_i;
struct __pyx_obj_4cdec_5_cdec_HypergraphNode *__pyx_v_self;
size_t __pyx_t_0;
unsigned int __pyx_t_1;
};
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":129
+ * del e_derivations
+ *
+ * def unique_kbest_features(self, size): # <<<<<<<<<<<<<<
+ * """hg.kbest_trees(size) -> List of unique k-best feature vectors in the hypergraph."""
+ * cdef kbest.KBestDerivations[FastSparseVector[weight_t], kbest.FeatureVectorTraversal, kbest.NoFilter[FastSparseVector[double]]]* derivations = new kbest.KBestDerivations[FastSparseVector[weight_t], kbest.FeatureVectorTraversal, kbest.NoFilter[FastSparseVector[double]]](self.hg[0], size)
+ */
+struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features {
+ PyObject_HEAD
+ KBest::KBestDerivations<FastSparseVector<weight_t>,FeatureVectorTraversal,KBest::NoFilter<FastSparseVector<double> > >::Derivation *__pyx_v_derivation;
+ KBest::KBestDerivations<FastSparseVector<weight_t>,FeatureVectorTraversal,KBest::NoFilter<FastSparseVector<double> > > *__pyx_v_derivations;
+ struct __pyx_obj_4cdec_5_cdec_SparseVector *__pyx_v_fmap;
+ unsigned int __pyx_v_k;
+ struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self;
+ PyObject *__pyx_v_size;
+ unsigned int __pyx_t_0;
+ long __pyx_t_1;
+};
+
+
/* "cdec/_cdec.pyx":56
* 'csplit', 'tagger', 'lexalign'):
* raise InvalidConfig('formalism "%s" unknown' % formalism)
@@ -1109,9 +1153,9 @@ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_16___get__ {
* cdef istringstream* config_stream = new istringstream(config_str)
* self.dec = new decoder.Decoder(config_stream)
*/
-struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25_genexpr {
+struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_28_genexpr {
PyObject_HEAD
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___init__ *__pyx_outer_scope;
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_27___init__ *__pyx_outer_scope;
PyObject *__pyx_v_kv;
PyObject *__pyx_t_0;
Py_ssize_t __pyx_t_1;
@@ -1119,7 +1163,7 @@ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25_genexpr {
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":6
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":6
*
* def _phrase(phrase):
* return ' '.join(w.encode('utf8') if isinstance(w, unicode) else str(w) for w in phrase) # <<<<<<<<<<<<<<
@@ -1136,35 +1180,17 @@ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_3_genexpr {
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":97
- * del derivations
- *
- * def sample(self, unsigned n): # <<<<<<<<<<<<<<
- * """hg.sample(n) -> Sample of n hypotheses from the hypergraph."""
- * cdef vector[hypergraph.Hypothesis]* hypos = new vector[hypergraph.Hypothesis]()
- */
-struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_sample {
- PyObject_HEAD
- std::vector<HypergraphSampler::Hypothesis> *__pyx_v_hypos;
- unsigned int __pyx_v_k;
- unsigned int __pyx_v_n;
- struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self;
- size_t __pyx_t_0;
- unsigned int __pyx_t_1;
-};
-
-
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":49
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":49
* return unicode(hypergraph.JoshuaVisualizationString(self.hg[0]).c_str(), 'utf8')
*
* def kbest(self, size): # <<<<<<<<<<<<<<
* """hg.kbest(size) -> List of k-best hypotheses in the hypergraph."""
- * cdef kbest.KBestDerivations[vector[WordID], kbest.ESentenceTraversal]* derivations = new kbest.KBestDerivations[vector[WordID], kbest.ESentenceTraversal](self.hg[0], size)
+ * cdef kbest.KBestDerivations[vector[WordID], kbest.ESentenceTraversal, kbest.NoFilter[vector[int]]]* derivations = new kbest.KBestDerivations[vector[WordID], kbest.ESentenceTraversal, kbest.NoFilter[vector[int]]](self.hg[0], size)
*/
struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_8_kbest {
PyObject_HEAD
- KBest::KBestDerivations<std::vector<WordID>,ESentenceTraversal>::Derivation *__pyx_v_derivation;
- KBest::KBestDerivations<std::vector<WordID>,ESentenceTraversal> *__pyx_v_derivations;
+ KBest::KBestDerivations<std::vector<WordID>,ESentenceTraversal,KBest::NoFilter<std::vector<int> > >::Derivation *__pyx_v_derivation;
+ KBest::KBestDerivations<std::vector<WordID>,ESentenceTraversal,KBest::NoFilter<std::vector<int> > > *__pyx_v_derivations;
unsigned int __pyx_v_k;
struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self;
PyObject *__pyx_v_size;
@@ -1173,22 +1199,6 @@ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_8_kbest {
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":167
- *
- * property nodes:
- * def __get__(self): # <<<<<<<<<<<<<<
- * cdef unsigned i
- * for i in range(self.hg.nodes_.size()):
- */
-struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14___get__ {
- PyObject_HEAD
- unsigned int __pyx_v_i;
- struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self;
- size_t __pyx_t_0;
- unsigned int __pyx_t_1;
-};
-
-
/* "cdec/sa/_sa.pxd":29
* cdef FloatList values
*
@@ -1206,7 +1216,23 @@ struct __pyx_obj_4cdec_2sa_3_sa_Phrase {
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":199
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":264
+ *
+ * property tail_nodes:
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * cdef unsigned i
+ * for i in range(self.edge.tail_nodes_.size()):
+ */
+struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___get__ {
+ PyObject_HEAD
+ unsigned int __pyx_v_i;
+ struct __pyx_obj_4cdec_5_cdec_HypergraphEdge *__pyx_v_self;
+ unsigned int __pyx_t_0;
+ unsigned int __pyx_t_1;
+};
+
+
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":205
* del self.grammar
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -1225,7 +1251,23 @@ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_7___iter__ {
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":217
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":308
+ *
+ * property in_edges:
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * cdef unsigned i
+ * for i in range(self.node.in_edges_.size()):
+ */
+struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19___get__ {
+ PyObject_HEAD
+ unsigned int __pyx_v_i;
+ struct __pyx_obj_4cdec_5_cdec_HypergraphNode *__pyx_v_self;
+ size_t __pyx_t_0;
+ unsigned int __pyx_t_1;
+};
+
+
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":223
* self.grammar.get().SetGrammarName(name)
*
* cdef class TextGrammar(Grammar): # <<<<<<<<<<<<<<
@@ -1237,6 +1279,22 @@ struct __pyx_obj_4cdec_5_cdec_TextGrammar {
};
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":90
+ * return candidate
+ *
+ * def __iter__(self): # <<<<<<<<<<<<<<
+ * cdef unsigned i
+ * for i in range(len(self)):
+ */
+struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25___iter__ {
+ PyObject_HEAD
+ unsigned int __pyx_v_i;
+ struct __pyx_obj_4cdec_5_cdec_CandidateSet *__pyx_v_self;
+ Py_ssize_t __pyx_t_0;
+ unsigned int __pyx_t_1;
+};
+
+
/* "cdec/_cdec.pyx":43
* yield key, str(value)
*
@@ -1251,7 +1309,7 @@ struct __pyx_obj_4cdec_5_cdec_Decoder {
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":12
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":12
* return stats
*
* cdef class Candidate: # <<<<<<<<<<<<<<
@@ -1265,39 +1323,41 @@ struct __pyx_obj_4cdec_5_cdec_Candidate {
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":266
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":145
+ * del derivations
*
- * property out_edges:
- * def __get__(self): # <<<<<<<<<<<<<<
- * cdef unsigned i
- * for i in range(self.node.out_edges_.size()):
+ * def sample(self, unsigned n): # <<<<<<<<<<<<<<
+ * """hg.sample(n) -> Sample of n hypotheses from the hypergraph."""
+ * cdef vector[hypergraph.Hypothesis]* hypos = new vector[hypergraph.Hypothesis]()
*/
-struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__ {
+struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14_sample {
PyObject_HEAD
- unsigned int __pyx_v_i;
- struct __pyx_obj_4cdec_5_cdec_HypergraphNode *__pyx_v_self;
+ std::vector<HypergraphSampler::Hypothesis> *__pyx_v_hypos;
+ unsigned int __pyx_v_k;
+ unsigned int __pyx_v_n;
+ struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self;
size_t __pyx_t_0;
unsigned int __pyx_t_1;
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":56
- * return unicode(str(self), 'utf8')
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":215
*
- * def __iter__(self): # <<<<<<<<<<<<<<
- * cdef unsigned i
- * for i in range(len(self)):
+ * property nodes:
+ * def __get__(self): # <<<<<<<<<<<<<<
+ * cdef unsigned i
+ * for i in range(self.hg.nodes_.size()):
*/
-struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___iter__ {
+struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__ {
PyObject_HEAD
unsigned int __pyx_v_i;
- struct __pyx_obj_4cdec_5_cdec_Lattice *__pyx_v_self;
- Py_ssize_t __pyx_t_0;
+ struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self;
+ size_t __pyx_t_0;
unsigned int __pyx_t_1;
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":32
+/* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":32
* self.vector[0][fid] = value
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -1313,7 +1373,7 @@ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct____iter__ {
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":173
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":179
*
* def __str__(self):
* scores = ' '.join('%s=%s' % feat for feat in self.scores) # <<<<<<<<<<<<<<
@@ -1330,25 +1390,30 @@ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_6_genexpr {
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":108
- * del hypos
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":110
+ * del derivations
*
- * def sample_trees(self, unsigned n): # <<<<<<<<<<<<<<
- * """hg.sample_trees(n) -> Sample of n trees from the hypergraph."""
- * cdef vector[string]* trees = new vector[string]()
+ * def unique_kbest_trees(self, size): # <<<<<<<<<<<<<<
+ * """hg.kbest_trees(size) -> List of unique k-best trees in the hypergraph."""
+ * cdef kbest.KBestDerivations[vector[WordID], kbest.FTreeTraversal, kbest.FilterUnique]* f_derivations = new kbest.KBestDerivations[vector[WordID], kbest.FTreeTraversal, kbest.FilterUnique](self.hg[0], size)
*/
-struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_sample_trees {
+struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees {
PyObject_HEAD
+ KBest::KBestDerivations<std::vector<WordID>,ETreeTraversal,KBest::FilterUnique>::Derivation *__pyx_v_e_derivation;
+ KBest::KBestDerivations<std::vector<WordID>,ETreeTraversal,KBest::FilterUnique> *__pyx_v_e_derivations;
+ PyObject *__pyx_v_e_tree;
+ KBest::KBestDerivations<std::vector<WordID>,FTreeTraversal,KBest::FilterUnique>::Derivation *__pyx_v_f_derivation;
+ KBest::KBestDerivations<std::vector<WordID>,FTreeTraversal,KBest::FilterUnique> *__pyx_v_f_derivations;
+ PyObject *__pyx_v_f_tree;
unsigned int __pyx_v_k;
- unsigned int __pyx_v_n;
struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self;
- std::vector<std::string> *__pyx_v_trees;
- size_t __pyx_t_0;
- unsigned int __pyx_t_1;
+ PyObject *__pyx_v_size;
+ unsigned int __pyx_t_0;
+ long __pyx_t_1;
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":131
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":137
*
* property a:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -1365,7 +1430,7 @@ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_4___get__ {
};
-/* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":72
+/* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":72
* self.vector.set_value(fid, value)
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -1383,7 +1448,7 @@ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_1___iter__ {
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":246
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":294
* raise NotImplemented('comparison not implemented for HypergraphEdge')
*
* cdef class HypergraphNode: # <<<<<<<<<<<<<<
@@ -1397,7 +1462,7 @@ struct __pyx_vtabstruct_4cdec_5_cdec_HypergraphNode {
static struct __pyx_vtabstruct_4cdec_5_cdec_HypergraphNode *__pyx_vtabptr_4cdec_5_cdec_HypergraphNode;
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":196
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":244
* return vector
*
* cdef class HypergraphEdge: # <<<<<<<<<<<<<<
@@ -1462,7 +1527,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/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":4
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":4
* cimport kbest
*
* cdef class Hypergraph: # <<<<<<<<<<<<<<
@@ -1923,49 +1988,52 @@ static int (*__pyx_f_4cdec_2sa_3_sa_sym_getindex)(int); /*proto*/
/* Module declarations from 'cdec.mteval' */
/* Module declarations from 'cdec._cdec' */
+static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_24___iter__ = 0;
static PyTypeObject *__pyx_ptype_4cdec_5_cdec_TRule = 0;
static PyTypeObject *__pyx_ptype_4cdec_5_cdec_MRule = 0;
-static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_22___iter__ = 0;
static PyTypeObject *__pyx_ptype_4cdec_5_cdec_DenseVector = 0;
static PyTypeObject *__pyx_ptype_4cdec_5_cdec_SufficientStats = 0;
+static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_23_lines = 0;
+static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_27___init__ = 0;
static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_21___iter__ = 0;
static PyTypeObject *__pyx_ptype_4cdec_5_cdec_Metric = 0;
+static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest = 0;
static PyTypeObject *__pyx_ptype_4cdec_5_cdec_Candidate = 0;
static PyTypeObject *__pyx_ptype_4cdec_5_cdec_SparseVector = 0;
-static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_15___get__ = 0;
+static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_26__make_config = 0;
static PyTypeObject *__pyx_ptype_4cdec_5_cdec_NT = 0;
static PyTypeObject *__pyx_ptype_4cdec_5_cdec_Lattice = 0;
-static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_23__make_config = 0;
+static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_15_sample_trees = 0;
static PyTypeObject *__pyx_ptype_4cdec_5_cdec_HypergraphEdge = 0;
static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_2__phrase = 0;
-static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_13___get__ = 0;
-static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_20_lines = 0;
static PyTypeObject *__pyx_ptype_4cdec_5_cdec_Scorer = 0;
static PyTypeObject *__pyx_ptype_4cdec_5_cdec_HypergraphNode = 0;
static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_10_kbest_features = 0;
static PyTypeObject *__pyx_ptype_4cdec_5_cdec_NTRef = 0;
static PyTypeObject *__pyx_ptype_4cdec_5_cdec_Grammar = 0;
static PyTypeObject *__pyx_ptype_4cdec_5_cdec_Hypergraph = 0;
-static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_24___init__ = 0;
static PyTypeObject *__pyx_ptype_4cdec_5_cdec_CandidateSet = 0;
+static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_22_todot = 0;
static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees = 0;
-static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_19_todot = 0;
static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_5___str__ = 0;
static PyTypeObject *__pyx_ptype_4cdec_5_cdec_SegmentEvaluator = 0;
static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_16___get__ = 0;
-static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_25_genexpr = 0;
+static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_20___get__ = 0;
+static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features = 0;
+static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_28_genexpr = 0;
static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_3_genexpr = 0;
-static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_11_sample = 0;
static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_8_kbest = 0;
-static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_14___get__ = 0;
+static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_18___get__ = 0;
static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_7___iter__ = 0;
+static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_19___get__ = 0;
static PyTypeObject *__pyx_ptype_4cdec_5_cdec_TextGrammar = 0;
+static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_25___iter__ = 0;
static PyTypeObject *__pyx_ptype_4cdec_5_cdec_Decoder = 0;
static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct____iter__ = 0;
+static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_14_sample = 0;
static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_17___get__ = 0;
-static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_18___iter__ = 0;
static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_6_genexpr = 0;
-static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_12_sample_trees = 0;
+static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees = 0;
static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_4___get__ = 0;
static PyTypeObject *__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_1___iter__ = 0;
static PyObject *__pyx_f_4cdec_5_cdec_as_str(PyObject *, struct __pyx_opt_args_4cdec_5_cdec_as_str *__pyx_optional_args); /*proto*/
@@ -2033,7 +2101,7 @@ static int __pyx_pf_4cdec_5_cdec_5NTRef___init__(struct __pyx_obj_4cdec_5_cdec_N
static PyObject *__pyx_pf_4cdec_5_cdec_5NTRef_2__str__(struct __pyx_obj_4cdec_5_cdec_NTRef *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4cdec_5_cdec_5NTRef_3ref___get__(struct __pyx_obj_4cdec_5_cdec_NTRef *__pyx_v_self); /* proto */
static int __pyx_pf_4cdec_5_cdec_5NTRef_3ref_2__set__(struct __pyx_obj_4cdec_5_cdec_NTRef *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
-static int __pyx_pf_4cdec_5_cdec_5TRule___init__(struct __pyx_obj_4cdec_5_cdec_TRule *__pyx_v_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_f, PyObject *__pyx_v_e, PyObject *__pyx_v_scores, PyObject *__pyx_v_a); /* proto */
+static int __pyx_pf_4cdec_5_cdec_5TRule___init__(struct __pyx_obj_4cdec_5_cdec_TRule *__pyx_v_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_f, PyObject *__pyx_v_e, PyObject *__pyx_v_scores, PyObject *__pyx_v_a, PyObject *__pyx_v_text); /* proto */
static void __pyx_pf_4cdec_5_cdec_5TRule_2__dealloc__(CYTHON_UNUSED struct __pyx_obj_4cdec_5_cdec_TRule *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4cdec_5_cdec_5TRule_5arity___get__(struct __pyx_obj_4cdec_5_cdec_TRule *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4cdec_5_cdec_5TRule_1f___get__(struct __pyx_obj_4cdec_5_cdec_TRule *__pyx_v_self); /* proto */
@@ -2063,18 +2131,21 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_10viterbi_joshua(struct __py
static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_12kbest(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self, PyObject *__pyx_v_size); /* proto */
static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_15kbest_trees(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self, PyObject *__pyx_v_size); /* proto */
static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_18kbest_features(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_21sample(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self, unsigned int __pyx_v_n); /* proto */
-static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_24sample_trees(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self, unsigned int __pyx_v_n); /* proto */
-static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_27intersect(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self, PyObject *__pyx_v_inp); /* proto */
-static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_29prune(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self, PyObject *__pyx_v_beam_alpha, PyObject *__pyx_v_density, PyObject *__pyx_v_kwargs); /* proto */
-static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_31lattice(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_33plf(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_35reweight(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self, PyObject *__pyx_v_weights); /* proto */
+static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_21unique_kbest(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self, PyObject *__pyx_v_size); /* proto */
+static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_24unique_kbest_trees(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self, PyObject *__pyx_v_size); /* proto */
+static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_27unique_kbest_features(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self, PyObject *__pyx_v_size); /* proto */
+static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_30sample(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self, unsigned int __pyx_v_n); /* proto */
+static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_33sample_trees(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self, unsigned int __pyx_v_n); /* proto */
+static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_36intersect(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self, PyObject *__pyx_v_inp); /* proto */
+static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_38prune(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self, PyObject *__pyx_v_beam_alpha, PyObject *__pyx_v_density, PyObject *__pyx_v_kwargs); /* proto */
+static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_40lattice(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_42plf(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_44reweight(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self, PyObject *__pyx_v_weights); /* proto */
static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_5edges___get__(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_5nodes___get__(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_4goal___get__(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_6npaths___get__(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_37inside_outside(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_46inside_outside(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_pf_4cdec_5_cdec_14HypergraphEdge___len__(struct __pyx_obj_4cdec_5_cdec_HypergraphEdge *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphEdge_9head_node___get__(struct __pyx_obj_4cdec_5_cdec_HypergraphEdge *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphEdge_10tail_nodes___get__(struct __pyx_obj_4cdec_5_cdec_HypergraphEdge *__pyx_v_self); /* proto */
@@ -2143,49 +2214,52 @@ static int __pyx_pf_4cdec_5_cdec_7Decoder_7weights_2__set__(struct __pyx_obj_4cd
static PyObject *__pyx_pf_4cdec_5_cdec_7Decoder_9formalism___get__(struct __pyx_obj_4cdec_5_cdec_Decoder *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_4cdec_5_cdec_7Decoder_4read_weights(struct __pyx_obj_4cdec_5_cdec_Decoder *__pyx_v_self, PyObject *__pyx_v_weights); /* proto */
static PyObject *__pyx_pf_4cdec_5_cdec_7Decoder_6translate(struct __pyx_obj_4cdec_5_cdec_Decoder *__pyx_v_self, PyObject *__pyx_v_sentence, PyObject *__pyx_v_grammar); /* proto */
+static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_24___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cdec_5_cdec_TRule(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cdec_5_cdec_MRule(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_22___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cdec_5_cdec_DenseVector(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cdec_5_cdec_SufficientStats(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_23_lines(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_27___init__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_21___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cdec_5_cdec_Metric(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cdec_5_cdec_Candidate(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cdec_5_cdec_SparseVector(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_15___get__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_26__make_config(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cdec_5_cdec_NT(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cdec_5_cdec_Lattice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_23__make_config(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_15_sample_trees(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cdec_5_cdec_HypergraphEdge(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_2__phrase(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_13___get__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_20_lines(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cdec_5_cdec_Scorer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cdec_5_cdec_HypergraphNode(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_10_kbest_features(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cdec_5_cdec_NTRef(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cdec_5_cdec_Grammar(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cdec_5_cdec_Hypergraph(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_24___init__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cdec_5_cdec_CandidateSet(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_22_todot(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_19_todot(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_5___str__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cdec_5_cdec_SegmentEvaluator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_16___get__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_25_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_20___get__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_28_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_3_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_11_sample(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_8_kbest(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_14___get__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_18___get__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_7___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_19___get__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cdec_5_cdec_TextGrammar(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_25___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cdec_5_cdec_Decoder(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct____iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_14_sample(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_17___get__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_18___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_6_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_12_sample_trees(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_4___get__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_1___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static char __pyx_k_1[] = "Cannot convert type %s to str";
@@ -2213,7 +2287,7 @@ static char __pyx_k_26[] = "digraph lattice {";
static char __pyx_k_31[] = "\\\"";
static char __pyx_k_33[] = "%d [shape=doublecircle]";
static char __pyx_k_34[] = "}";
-static char __pyx_k_37[] = "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi";
+static char __pyx_k_37[] = "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi";
static char __pyx_k_38[] = "Lattice.todot.<locals>.lines";
static char __pyx_k_39[] = "cdec._cdec";
static char __pyx_k_40[] = "\n";
@@ -2227,8 +2301,8 @@ static char __pyx_k_50[] = "#";
static char __pyx_k_53[] = "Cannot translate input type %s";
static char __pyx_k_54[] = "cdec.sa._sa";
static char __pyx_k_55[] = "*";
-static char __pyx_k_58[] = "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi";
-static char __pyx_k_66[] = "/home/pks/src/cdec-dtrain/python/cdec/_cdec.pyx";
+static char __pyx_k_58[] = "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi";
+static char __pyx_k_66[] = "/usr0/home/austinma/git/cdec/python/cdec/_cdec.pyx";
static char __pyx_k__a[] = "a";
static char __pyx_k__e[] = "e";
static char __pyx_k__f[] = "f";
@@ -2264,6 +2338,7 @@ static char __pyx_k__scfg[] = "scfg";
static char __pyx_k__self[] = "self";
static char __pyx_k__send[] = "send";
static char __pyx_k__span[] = "span";
+static char __pyx_k__text[] = "text";
static char __pyx_k__utf8[] = "utf8";
static char __pyx_k__close[] = "close";
static char __pyx_k__delta[] = "delta";
@@ -2468,6 +2543,7 @@ static PyObject *__pyx_n_s__startswith;
static PyObject *__pyx_n_s__strip;
static PyObject *__pyx_n_s__super;
static PyObject *__pyx_n_s__tagger;
+static PyObject *__pyx_n_s__text;
static PyObject *__pyx_n_s__throw;
static PyObject *__pyx_n_s__utf8;
static PyObject *__pyx_n_s__value;
@@ -2665,7 +2741,7 @@ static int __pyx_pw_4cdec_5_cdec_11DenseVector_1__init__(PyObject *__pyx_v_self,
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":7
+/* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":7
* cdef bint owned # if True, do not manage memory
*
* def __init__(self): # <<<<<<<<<<<<<<
@@ -2682,7 +2758,7 @@ static int __pyx_pf_4cdec_5_cdec_11DenseVector___init__(struct __pyx_obj_4cdec_5
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":9
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":9
* def __init__(self):
* """DenseVector() -> Dense weight/feature vector."""
* self.vector = new vector[weight_t]() # <<<<<<<<<<<<<<
@@ -2697,7 +2773,7 @@ static int __pyx_pf_4cdec_5_cdec_11DenseVector___init__(struct __pyx_obj_4cdec_5
}
__pyx_v_self->vector = __pyx_t_1;
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":10
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":10
* """DenseVector() -> Dense weight/feature vector."""
* self.vector = new vector[weight_t]()
* self.owned = False # <<<<<<<<<<<<<<
@@ -2725,7 +2801,7 @@ static void __pyx_pw_4cdec_5_cdec_11DenseVector_3__dealloc__(PyObject *__pyx_v_s
__Pyx_RefNannyFinishContext();
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":12
+/* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":12
* self.owned = False
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -2738,7 +2814,7 @@ static void __pyx_pf_4cdec_5_cdec_11DenseVector_2__dealloc__(struct __pyx_obj_4c
int __pyx_t_1;
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":13
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":13
*
* def __dealloc__(self):
* if not self.owned: # <<<<<<<<<<<<<<
@@ -2748,7 +2824,7 @@ static void __pyx_pf_4cdec_5_cdec_11DenseVector_2__dealloc__(struct __pyx_obj_4c
__pyx_t_1 = ((!(__pyx_v_self->owned != 0)) != 0);
if (__pyx_t_1) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":14
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":14
* def __dealloc__(self):
* if not self.owned:
* del self.vector # <<<<<<<<<<<<<<
@@ -2774,7 +2850,7 @@ static Py_ssize_t __pyx_pw_4cdec_5_cdec_11DenseVector_5__len__(PyObject *__pyx_v
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":16
+/* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":16
* del self.vector
*
* def __len__(self): # <<<<<<<<<<<<<<
@@ -2787,7 +2863,7 @@ static Py_ssize_t __pyx_pf_4cdec_5_cdec_11DenseVector_4__len__(struct __pyx_obj_
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__len__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":17
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":17
*
* def __len__(self):
* return self.vector.size() # <<<<<<<<<<<<<<
@@ -2827,7 +2903,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_11DenseVector_7__getitem__(PyObject *__py
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":19
+/* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":19
* return self.vector.size()
*
* def __getitem__(self, char* fname): # <<<<<<<<<<<<<<
@@ -2848,7 +2924,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_11DenseVector_6__getitem__(struct __pyx_o
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__getitem__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":20
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":20
*
* def __getitem__(self, char* fname):
* cdef int fid = FDConvert(fname) # <<<<<<<<<<<<<<
@@ -2857,7 +2933,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_11DenseVector_6__getitem__(struct __pyx_o
*/
__pyx_v_fid = FD::Convert(__pyx_v_fname);
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":21
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":21
* def __getitem__(self, char* fname):
* cdef int fid = FDConvert(fname)
* if 0 <= fid < self.vector.size(): # <<<<<<<<<<<<<<
@@ -2871,7 +2947,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_11DenseVector_6__getitem__(struct __pyx_o
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":22
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":22
* cdef int fid = FDConvert(fname)
* if 0 <= fid < self.vector.size():
* return self.vector[0][fid] # <<<<<<<<<<<<<<
@@ -2888,7 +2964,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_11DenseVector_6__getitem__(struct __pyx_o
}
__pyx_L3:;
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":23
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":23
* if 0 <= fid < self.vector.size():
* return self.vector[0][fid]
* raise KeyError(fname) # <<<<<<<<<<<<<<
@@ -2950,7 +3026,7 @@ static int __pyx_pw_4cdec_5_cdec_11DenseVector_9__setitem__(PyObject *__pyx_v_se
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":25
+/* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":25
* raise KeyError(fname)
*
* def __setitem__(self, char* fname, float value): # <<<<<<<<<<<<<<
@@ -2970,7 +3046,7 @@ static int __pyx_pf_4cdec_5_cdec_11DenseVector_8__setitem__(struct __pyx_obj_4cd
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__setitem__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":26
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":26
*
* def __setitem__(self, char* fname, float value):
* cdef int fid = FDConvert(fname) # <<<<<<<<<<<<<<
@@ -2979,7 +3055,7 @@ static int __pyx_pf_4cdec_5_cdec_11DenseVector_8__setitem__(struct __pyx_obj_4cd
*/
__pyx_v_fid = FD::Convert(__pyx_v_fname);
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":27
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":27
* def __setitem__(self, char* fname, float value):
* cdef int fid = FDConvert(fname)
* if fid < 0: raise KeyError(fname) # <<<<<<<<<<<<<<
@@ -3005,7 +3081,7 @@ static int __pyx_pf_4cdec_5_cdec_11DenseVector_8__setitem__(struct __pyx_obj_4cd
}
__pyx_L3:;
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":28
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":28
* cdef int fid = FDConvert(fname)
* if fid < 0: raise KeyError(fname)
* if self.vector.size() <= fid: # <<<<<<<<<<<<<<
@@ -3015,7 +3091,7 @@ static int __pyx_pf_4cdec_5_cdec_11DenseVector_8__setitem__(struct __pyx_obj_4cd
__pyx_t_1 = ((__pyx_v_self->vector->size() <= __pyx_v_fid) != 0);
if (__pyx_t_1) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":29
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":29
* if fid < 0: raise KeyError(fname)
* if self.vector.size() <= fid:
* self.vector.resize(fid + 1) # <<<<<<<<<<<<<<
@@ -3027,7 +3103,7 @@ static int __pyx_pf_4cdec_5_cdec_11DenseVector_8__setitem__(struct __pyx_obj_4cd
}
__pyx_L4:;
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":30
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":30
* if self.vector.size() <= fid:
* self.vector.resize(fid + 1)
* self.vector[0][fid] = value # <<<<<<<<<<<<<<
@@ -3060,7 +3136,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_11DenseVector_11__iter__(PyObject *__pyx_
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":32
+/* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":32
* self.vector[0][fid] = value
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -3128,7 +3204,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_11DenseVector_12generator(__pyx_Generator
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":34
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":34
* def __iter__(self):
* cdef unsigned fid
* for fid in range(1, self.vector.size()): # <<<<<<<<<<<<<<
@@ -3139,7 +3215,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_11DenseVector_12generator(__pyx_Generator
for (__pyx_t_2 = 1; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_cur_scope->__pyx_v_fid = __pyx_t_2;
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":35
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":35
* cdef unsigned fid
* for fid in range(1, self.vector.size()):
* yield str(FDConvert(fid).c_str()), self.vector[0][fid] # <<<<<<<<<<<<<<
@@ -3215,7 +3291,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_11DenseVector_14dot(PyObject *__pyx_v_sel
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":37
+/* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":37
* yield str(FDConvert(fid).c_str()), self.vector[0][fid]
*
* def dot(self, SparseVector other): # <<<<<<<<<<<<<<
@@ -3234,7 +3310,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_11DenseVector_13dot(struct __pyx_obj_4cde
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("dot", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":39
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":39
* def dot(self, SparseVector other):
* """vector.dot(SparseVector other) -> Dot product of the two vectors."""
* return other.dot(self) # <<<<<<<<<<<<<<
@@ -3283,7 +3359,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_11DenseVector_16tosparse(PyObject *__pyx_
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":41
+/* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":41
* return other.dot(self)
*
* def tosparse(self): # <<<<<<<<<<<<<<
@@ -3301,7 +3377,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_11DenseVector_15tosparse(struct __pyx_obj
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("tosparse", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":43
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":43
* def tosparse(self):
* """vector.tosparse() -> Equivalent SparseVector."""
* cdef SparseVector sparse = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<<
@@ -3314,7 +3390,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_11DenseVector_15tosparse(struct __pyx_obj
__pyx_v_sparse = ((struct __pyx_obj_4cdec_5_cdec_SparseVector *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":44
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":44
* """vector.tosparse() -> Equivalent SparseVector."""
* cdef SparseVector sparse = SparseVector.__new__(SparseVector)
* sparse.vector = new FastSparseVector[weight_t]() # <<<<<<<<<<<<<<
@@ -3323,7 +3399,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_11DenseVector_15tosparse(struct __pyx_obj
*/
__pyx_v_sparse->vector = new FastSparseVector<weight_t>();
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":45
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":45
* cdef SparseVector sparse = SparseVector.__new__(SparseVector)
* sparse.vector = new FastSparseVector[weight_t]()
* InitSparseVector(self.vector[0], sparse.vector) # <<<<<<<<<<<<<<
@@ -3332,7 +3408,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_11DenseVector_15tosparse(struct __pyx_obj
*/
Weights::InitSparseVector((__pyx_v_self->vector[0]), __pyx_v_sparse->vector);
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":46
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":46
* sparse.vector = new FastSparseVector[weight_t]()
* InitSparseVector(self.vector[0], sparse.vector)
* return sparse # <<<<<<<<<<<<<<
@@ -3375,7 +3451,7 @@ static int __pyx_pw_4cdec_5_cdec_12SparseVector_1__init__(PyObject *__pyx_v_self
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":51
+/* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":51
* cdef FastSparseVector[weight_t]* vector
*
* def __init__(self): # <<<<<<<<<<<<<<
@@ -3388,7 +3464,7 @@ static int __pyx_pf_4cdec_5_cdec_12SparseVector___init__(struct __pyx_obj_4cdec_
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":53
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":53
* def __init__(self):
* """SparseVector() -> Sparse feature/weight vector."""
* self.vector = new FastSparseVector[weight_t]() # <<<<<<<<<<<<<<
@@ -3411,7 +3487,7 @@ static void __pyx_pw_4cdec_5_cdec_12SparseVector_3__dealloc__(PyObject *__pyx_v_
__Pyx_RefNannyFinishContext();
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":55
+/* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":55
* self.vector = new FastSparseVector[weight_t]()
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -3423,7 +3499,7 @@ static void __pyx_pf_4cdec_5_cdec_12SparseVector_2__dealloc__(CYTHON_UNUSED stru
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":56
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":56
*
* def __dealloc__(self):
* del self.vector # <<<<<<<<<<<<<<
@@ -3447,7 +3523,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_12SparseVector_5copy(PyObject *__pyx_v_se
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":58
+/* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":58
* del self.vector
*
* def copy(self): # <<<<<<<<<<<<<<
@@ -3464,7 +3540,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_4copy(struct __pyx_obj_4cd
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("copy", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":60
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":60
* def copy(self):
* """vector.copy() -> SparseVector copy."""
* return self * 1 # <<<<<<<<<<<<<<
@@ -3514,7 +3590,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_12SparseVector_7__getitem__(PyObject *__p
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":62
+/* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":62
* return self * 1
*
* def __getitem__(self, char* fname): # <<<<<<<<<<<<<<
@@ -3534,7 +3610,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_6__getitem__(struct __pyx_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__getitem__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":63
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":63
*
* def __getitem__(self, char* fname):
* cdef int fid = FDConvert(fname) # <<<<<<<<<<<<<<
@@ -3543,7 +3619,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_6__getitem__(struct __pyx_
*/
__pyx_v_fid = FD::Convert(__pyx_v_fname);
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":64
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":64
* def __getitem__(self, char* fname):
* cdef int fid = FDConvert(fname)
* if fid < 0: raise KeyError(fname) # <<<<<<<<<<<<<<
@@ -3569,7 +3645,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_6__getitem__(struct __pyx_
}
__pyx_L3:;
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":65
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":65
* cdef int fid = FDConvert(fname)
* if fid < 0: raise KeyError(fname)
* return self.vector.value(fid) # <<<<<<<<<<<<<<
@@ -3624,7 +3700,7 @@ static int __pyx_pw_4cdec_5_cdec_12SparseVector_9__setitem__(PyObject *__pyx_v_s
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":67
+/* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":67
* return self.vector.value(fid)
*
* def __setitem__(self, char* fname, float value): # <<<<<<<<<<<<<<
@@ -3644,7 +3720,7 @@ static int __pyx_pf_4cdec_5_cdec_12SparseVector_8__setitem__(struct __pyx_obj_4c
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__setitem__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":68
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":68
*
* def __setitem__(self, char* fname, float value):
* cdef int fid = FDConvert(fname) # <<<<<<<<<<<<<<
@@ -3653,7 +3729,7 @@ static int __pyx_pf_4cdec_5_cdec_12SparseVector_8__setitem__(struct __pyx_obj_4c
*/
__pyx_v_fid = FD::Convert(__pyx_v_fname);
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":69
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":69
* def __setitem__(self, char* fname, float value):
* cdef int fid = FDConvert(fname)
* if fid < 0: raise KeyError(fname) # <<<<<<<<<<<<<<
@@ -3679,7 +3755,7 @@ static int __pyx_pf_4cdec_5_cdec_12SparseVector_8__setitem__(struct __pyx_obj_4c
}
__pyx_L3:;
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":70
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":70
* cdef int fid = FDConvert(fname)
* if fid < 0: raise KeyError(fname)
* self.vector.set_value(fid, value) # <<<<<<<<<<<<<<
@@ -3712,7 +3788,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_12SparseVector_11__iter__(PyObject *__pyx
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":72
+/* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":72
* self.vector.set_value(fid, value)
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -3780,7 +3856,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_12SparseVector_12generator1(__pyx_Generat
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":73
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":73
*
* def __iter__(self):
* cdef FastSparseVector[weight_t].const_iterator* it = new FastSparseVector[weight_t].const_iterator(self.vector[0], False) # <<<<<<<<<<<<<<
@@ -3789,7 +3865,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_12SparseVector_12generator1(__pyx_Generat
*/
__pyx_cur_scope->__pyx_v_it = new FastSparseVector<weight_t>::const_iterator((__pyx_cur_scope->__pyx_v_self->vector[0]), 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":75
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":75
* cdef FastSparseVector[weight_t].const_iterator* it = new FastSparseVector[weight_t].const_iterator(self.vector[0], False)
* cdef unsigned i
* try: # <<<<<<<<<<<<<<
@@ -3798,7 +3874,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_12SparseVector_12generator1(__pyx_Generat
*/
/*try:*/ {
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":76
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":76
* cdef unsigned i
* try:
* for i in range(self.vector.size()): # <<<<<<<<<<<<<<
@@ -3809,7 +3885,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_12SparseVector_12generator1(__pyx_Generat
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_cur_scope->__pyx_v_i = __pyx_t_2;
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":77
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":77
* try:
* for i in range(self.vector.size()):
* yield (str(FDConvert(it[0].ptr().first).c_str()), it[0].ptr().second) # <<<<<<<<<<<<<<
@@ -3850,7 +3926,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_12SparseVector_12generator1(__pyx_Generat
__pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L5;}
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":78
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":78
* for i in range(self.vector.size()):
* yield (str(FDConvert(it[0].ptr().first).c_str()), it[0].ptr().second)
* pinc(it[0]) # ++it # <<<<<<<<<<<<<<
@@ -3861,7 +3937,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_12SparseVector_12generator1(__pyx_Generat
}
}
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":80
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":80
* pinc(it[0]) # ++it
* finally:
* del it # <<<<<<<<<<<<<<
@@ -3923,7 +3999,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_12SparseVector_14dot(PyObject *__pyx_v_se
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":82
+/* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":82
* del it
*
* def dot(self, other): # <<<<<<<<<<<<<<
@@ -3943,7 +4019,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_13dot(struct __pyx_obj_4cd
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("dot", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":84
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":84
* def dot(self, other):
* """vector.dot(SparseVector/DenseVector other) -> Dot product of the two vectors."""
* if isinstance(other, DenseVector): # <<<<<<<<<<<<<<
@@ -3954,7 +4030,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_13dot(struct __pyx_obj_4cd
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":85
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":85
* """vector.dot(SparseVector/DenseVector other) -> Dot product of the two vectors."""
* if isinstance(other, DenseVector):
* return self.vector.dot((<DenseVector> other).vector[0]) # <<<<<<<<<<<<<<
@@ -3970,7 +4046,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_13dot(struct __pyx_obj_4cd
goto __pyx_L3;
}
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":86
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":86
* if isinstance(other, DenseVector):
* return self.vector.dot((<DenseVector> other).vector[0])
* elif isinstance(other, SparseVector): # <<<<<<<<<<<<<<
@@ -3981,7 +4057,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_13dot(struct __pyx_obj_4cd
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":87
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":87
* return self.vector.dot((<DenseVector> other).vector[0])
* elif isinstance(other, SparseVector):
* return self.vector.dot((<SparseVector> other).vector[0]) # <<<<<<<<<<<<<<
@@ -3998,7 +4074,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_13dot(struct __pyx_obj_4cd
}
__pyx_L3:;
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":88
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":88
* elif isinstance(other, SparseVector):
* return self.vector.dot((<SparseVector> other).vector[0])
* raise TypeError('cannot take the dot product of %s and SparseVector' % type(other)) # <<<<<<<<<<<<<<
@@ -4052,7 +4128,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_12SparseVector_16__richcmp__(PyObject *__
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":90
+/* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":90
* raise TypeError('cannot take the dot product of %s and SparseVector' % type(other))
*
* def __richcmp__(SparseVector x, SparseVector y, int op): # <<<<<<<<<<<<<<
@@ -4070,7 +4146,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_15__richcmp__(struct __pyx
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__richcmp__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":93
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":93
* if op == 2: # ==
* return x.vector[0] == y.vector[0]
* elif op == 3: # != # <<<<<<<<<<<<<<
@@ -4079,7 +4155,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_15__richcmp__(struct __pyx
*/
switch (__pyx_v_op) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":91
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":91
*
* def __richcmp__(SparseVector x, SparseVector y, int op):
* if op == 2: # == # <<<<<<<<<<<<<<
@@ -4088,7 +4164,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_15__richcmp__(struct __pyx
*/
case 2:
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":92
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":92
* def __richcmp__(SparseVector x, SparseVector y, int op):
* if op == 2: # ==
* return x.vector[0] == y.vector[0] # <<<<<<<<<<<<<<
@@ -4103,7 +4179,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_15__richcmp__(struct __pyx
goto __pyx_L0;
break;
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":93
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":93
* if op == 2: # ==
* return x.vector[0] == y.vector[0]
* elif op == 3: # != # <<<<<<<<<<<<<<
@@ -4112,7 +4188,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_15__richcmp__(struct __pyx
*/
case 3:
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":94
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":94
* return x.vector[0] == y.vector[0]
* elif op == 3: # !=
* return not (x == y) # <<<<<<<<<<<<<<
@@ -4131,7 +4207,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_15__richcmp__(struct __pyx
break;
}
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":95
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":95
* elif op == 3: # !=
* return not (x == y)
* raise NotImplemented('comparison not implemented for SparseVector') # <<<<<<<<<<<<<<
@@ -4167,7 +4243,7 @@ static Py_ssize_t __pyx_pw_4cdec_5_cdec_12SparseVector_18__len__(PyObject *__pyx
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":97
+/* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":97
* raise NotImplemented('comparison not implemented for SparseVector')
*
* def __len__(self): # <<<<<<<<<<<<<<
@@ -4180,7 +4256,7 @@ static Py_ssize_t __pyx_pf_4cdec_5_cdec_12SparseVector_17__len__(struct __pyx_ob
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__len__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":98
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":98
*
* def __len__(self):
* return self.vector.size() # <<<<<<<<<<<<<<
@@ -4220,7 +4296,7 @@ static int __pyx_pw_4cdec_5_cdec_12SparseVector_20__contains__(PyObject *__pyx_v
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":100
+/* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":100
* return self.vector.size()
*
* def __contains__(self, char* fname): # <<<<<<<<<<<<<<
@@ -4233,7 +4309,7 @@ static int __pyx_pf_4cdec_5_cdec_12SparseVector_19__contains__(struct __pyx_obj_
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__contains__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":101
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":101
*
* def __contains__(self, char* fname):
* return self.vector.nonzero(FDConvert(fname)) # <<<<<<<<<<<<<<
@@ -4260,7 +4336,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_12SparseVector_22__neg__(PyObject *__pyx_
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":103
+/* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":103
* return self.vector.nonzero(FDConvert(fname))
*
* def __neg__(self): # <<<<<<<<<<<<<<
@@ -4278,7 +4354,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_21__neg__(struct __pyx_obj
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__neg__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":104
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":104
*
* def __neg__(self):
* cdef SparseVector result = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<<
@@ -4291,7 +4367,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_21__neg__(struct __pyx_obj
__pyx_v_result = ((struct __pyx_obj_4cdec_5_cdec_SparseVector *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":105
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":105
* def __neg__(self):
* cdef SparseVector result = SparseVector.__new__(SparseVector)
* result.vector = new FastSparseVector[weight_t](self.vector[0]) # <<<<<<<<<<<<<<
@@ -4300,7 +4376,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_21__neg__(struct __pyx_obj
*/
__pyx_v_result->vector = new FastSparseVector<weight_t>((__pyx_v_self->vector[0]));
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":106
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":106
* cdef SparseVector result = SparseVector.__new__(SparseVector)
* result.vector = new FastSparseVector[weight_t](self.vector[0])
* result.vector[0] *= -1.0 # <<<<<<<<<<<<<<
@@ -4309,7 +4385,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_21__neg__(struct __pyx_obj
*/
(__pyx_v_result->vector[0]) *= -1.0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":107
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":107
* result.vector = new FastSparseVector[weight_t](self.vector[0])
* result.vector[0] *= -1.0
* return result # <<<<<<<<<<<<<<
@@ -4353,7 +4429,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_12SparseVector_24__iadd__(PyObject *__pyx
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":109
+/* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":109
* return result
*
* def __iadd__(SparseVector self, SparseVector other): # <<<<<<<<<<<<<<
@@ -4366,7 +4442,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_23__iadd__(struct __pyx_ob
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iadd__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":110
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":110
*
* def __iadd__(SparseVector self, SparseVector other):
* self.vector[0] += other.vector[0] # <<<<<<<<<<<<<<
@@ -4375,7 +4451,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_23__iadd__(struct __pyx_ob
*/
(__pyx_v_self->vector[0]) += (__pyx_v_other->vector[0]);
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":111
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":111
* def __iadd__(SparseVector self, SparseVector other):
* self.vector[0] += other.vector[0]
* return self # <<<<<<<<<<<<<<
@@ -4413,7 +4489,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_12SparseVector_26__isub__(PyObject *__pyx
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":113
+/* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":113
* return self
*
* def __isub__(SparseVector self, SparseVector other): # <<<<<<<<<<<<<<
@@ -4426,7 +4502,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_25__isub__(struct __pyx_ob
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__isub__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":114
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":114
*
* def __isub__(SparseVector self, SparseVector other):
* self.vector[0] -= other.vector[0] # <<<<<<<<<<<<<<
@@ -4435,7 +4511,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_25__isub__(struct __pyx_ob
*/
(__pyx_v_self->vector[0]) -= (__pyx_v_other->vector[0]);
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":115
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":115
* def __isub__(SparseVector self, SparseVector other):
* self.vector[0] -= other.vector[0]
* return self # <<<<<<<<<<<<<<
@@ -4478,7 +4554,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_12SparseVector_28__imul__(PyObject *__pyx
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":117
+/* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":117
* return self
*
* def __imul__(SparseVector self, float scalar): # <<<<<<<<<<<<<<
@@ -4491,7 +4567,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_27__imul__(struct __pyx_ob
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__imul__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":118
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":118
*
* def __imul__(SparseVector self, float scalar):
* self.vector[0] *= scalar # <<<<<<<<<<<<<<
@@ -4500,7 +4576,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_27__imul__(struct __pyx_ob
*/
(__pyx_v_self->vector[0]) *= __pyx_v_scalar;
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":119
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":119
* def __imul__(SparseVector self, float scalar):
* self.vector[0] *= scalar
* return self # <<<<<<<<<<<<<<
@@ -4545,7 +4621,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_12SparseVector_30__idiv__(PyObject *__pyx
}
#endif /*!(#if PY_MAJOR_VERSION < 3)*/
-/* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":121
+/* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":121
* return self
*
* def __idiv__(SparseVector self, float scalar): # <<<<<<<<<<<<<<
@@ -4559,7 +4635,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_29__idiv__(struct __pyx_ob
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__idiv__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":122
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":122
*
* def __idiv__(SparseVector self, float scalar):
* self.vector[0] /= scalar # <<<<<<<<<<<<<<
@@ -4568,7 +4644,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_29__idiv__(struct __pyx_ob
*/
(__pyx_v_self->vector[0]) /= __pyx_v_scalar;
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":123
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":123
* def __idiv__(SparseVector self, float scalar):
* self.vector[0] /= scalar
* return self # <<<<<<<<<<<<<<
@@ -4608,7 +4684,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_12SparseVector_32__add__(PyObject *__pyx_
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":125
+/* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":125
* return self
*
* def __add__(SparseVector x, SparseVector y): # <<<<<<<<<<<<<<
@@ -4626,7 +4702,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_31__add__(struct __pyx_obj
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__add__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":126
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":126
*
* def __add__(SparseVector x, SparseVector y):
* cdef SparseVector result = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<<
@@ -4639,7 +4715,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_31__add__(struct __pyx_obj
__pyx_v_result = ((struct __pyx_obj_4cdec_5_cdec_SparseVector *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":127
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":127
* def __add__(SparseVector x, SparseVector y):
* cdef SparseVector result = SparseVector.__new__(SparseVector)
* result.vector = new FastSparseVector[weight_t](x.vector[0] + y.vector[0]) # <<<<<<<<<<<<<<
@@ -4648,7 +4724,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_31__add__(struct __pyx_obj
*/
__pyx_v_result->vector = new FastSparseVector<weight_t>(((__pyx_v_x->vector[0]) + (__pyx_v_y->vector[0])));
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":128
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":128
* cdef SparseVector result = SparseVector.__new__(SparseVector)
* result.vector = new FastSparseVector[weight_t](x.vector[0] + y.vector[0])
* return result # <<<<<<<<<<<<<<
@@ -4693,7 +4769,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_12SparseVector_34__sub__(PyObject *__pyx_
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":130
+/* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":130
* return result
*
* def __sub__(SparseVector x, SparseVector y): # <<<<<<<<<<<<<<
@@ -4711,7 +4787,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_33__sub__(struct __pyx_obj
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__sub__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":131
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":131
*
* def __sub__(SparseVector x, SparseVector y):
* cdef SparseVector result = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<<
@@ -4724,7 +4800,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_33__sub__(struct __pyx_obj
__pyx_v_result = ((struct __pyx_obj_4cdec_5_cdec_SparseVector *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":132
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":132
* def __sub__(SparseVector x, SparseVector y):
* cdef SparseVector result = SparseVector.__new__(SparseVector)
* result.vector = new FastSparseVector[weight_t](x.vector[0] - y.vector[0]) # <<<<<<<<<<<<<<
@@ -4733,7 +4809,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_33__sub__(struct __pyx_obj
*/
__pyx_v_result->vector = new FastSparseVector<weight_t>(((__pyx_v_x->vector[0]) - (__pyx_v_y->vector[0])));
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":133
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":133
* cdef SparseVector result = SparseVector.__new__(SparseVector)
* result.vector = new FastSparseVector[weight_t](x.vector[0] - y.vector[0])
* return result # <<<<<<<<<<<<<<
@@ -4769,7 +4845,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_12SparseVector_36__mul__(PyObject *__pyx_
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":135
+/* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":135
* return result
*
* def __mul__(x, y): # <<<<<<<<<<<<<<
@@ -4792,7 +4868,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_35__mul__(PyObject *__pyx_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__mul__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":138
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":138
* cdef SparseVector vector
* cdef float scalar
* if isinstance(x, SparseVector): vector, scalar = x, y # <<<<<<<<<<<<<<
@@ -4813,7 +4889,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_35__mul__(PyObject *__pyx_
}
/*else*/ {
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":139
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":139
* cdef float scalar
* if isinstance(x, SparseVector): vector, scalar = x, y
* else: vector, scalar = y, x # <<<<<<<<<<<<<<
@@ -4830,7 +4906,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_35__mul__(PyObject *__pyx_
}
__pyx_L3:;
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":140
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":140
* if isinstance(x, SparseVector): vector, scalar = x, y
* else: vector, scalar = y, x
* cdef SparseVector result = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<<
@@ -4843,7 +4919,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_35__mul__(PyObject *__pyx_
__pyx_v_result = ((struct __pyx_obj_4cdec_5_cdec_SparseVector *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":141
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":141
* else: vector, scalar = y, x
* cdef SparseVector result = SparseVector.__new__(SparseVector)
* result.vector = new FastSparseVector[weight_t](vector.vector[0] * scalar) # <<<<<<<<<<<<<<
@@ -4852,7 +4928,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_35__mul__(PyObject *__pyx_
*/
__pyx_v_result->vector = new FastSparseVector<weight_t>(((__pyx_v_vector->vector[0]) * __pyx_v_scalar));
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":142
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":142
* cdef SparseVector result = SparseVector.__new__(SparseVector)
* result.vector = new FastSparseVector[weight_t](vector.vector[0] * scalar)
* return result # <<<<<<<<<<<<<<
@@ -4891,7 +4967,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_12SparseVector_38__div__(PyObject *__pyx_
}
#endif /*!(#if PY_MAJOR_VERSION < 3)*/
-/* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":144
+/* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":144
* return result
*
* def __div__(x, y): # <<<<<<<<<<<<<<
@@ -4915,7 +4991,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_37__div__(PyObject *__pyx_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__div__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":147
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":147
* cdef SparseVector vector
* cdef float scalar
* if isinstance(x, SparseVector): vector, scalar = x, y # <<<<<<<<<<<<<<
@@ -4936,7 +5012,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_37__div__(PyObject *__pyx_
}
/*else*/ {
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":148
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":148
* cdef float scalar
* if isinstance(x, SparseVector): vector, scalar = x, y
* else: vector, scalar = y, x # <<<<<<<<<<<<<<
@@ -4953,7 +5029,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_37__div__(PyObject *__pyx_
}
__pyx_L3:;
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":149
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":149
* if isinstance(x, SparseVector): vector, scalar = x, y
* else: vector, scalar = y, x
* cdef SparseVector result = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<<
@@ -4966,7 +5042,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_37__div__(PyObject *__pyx_
__pyx_v_result = ((struct __pyx_obj_4cdec_5_cdec_SparseVector *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":150
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":150
* else: vector, scalar = y, x
* cdef SparseVector result = SparseVector.__new__(SparseVector)
* result.vector = new FastSparseVector[weight_t](vector.vector[0] / scalar) # <<<<<<<<<<<<<<
@@ -4974,7 +5050,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12SparseVector_37__div__(PyObject *__pyx_
*/
__pyx_v_result->vector = new FastSparseVector<weight_t>(((__pyx_v_vector->vector[0]) / __pyx_v_scalar));
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":151
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":151
* cdef SparseVector result = SparseVector.__new__(SparseVector)
* result.vector = new FastSparseVector[weight_t](vector.vector[0] / scalar)
* return result # <<<<<<<<<<<<<<
@@ -5010,9 +5086,9 @@ static PyObject *__pyx_pw_4cdec_5_cdec_1_phrase(PyObject *__pyx_self, PyObject *
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_5_cdec_7_phrase_2generator18(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4cdec_5_cdec_7_phrase_2generator21(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":6
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":6
*
* def _phrase(phrase):
* return ' '.join(w.encode('utf8') if isinstance(w, unicode) else str(w) for w in phrase) # <<<<<<<<<<<<<<
@@ -5038,7 +5114,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_7_phrase_genexpr(PyObject *__pyx_self) {
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_7_phrase_2generator18, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_7_phrase_2generator21, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -5056,7 +5132,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_7_phrase_genexpr(PyObject *__pyx_self) {
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_5_cdec_7_phrase_2generator18(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4cdec_5_cdec_7_phrase_2generator21(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_3_genexpr *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
@@ -5178,7 +5254,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_7_phrase_2generator18(__pyx_GeneratorObje
return NULL;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":5
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":5
* import cdec.sa._sa as _sa
*
* def _phrase(phrase): # <<<<<<<<<<<<<<
@@ -5207,7 +5283,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec__phrase(CYTHON_UNUSED PyObject *__pyx_sel
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_phrase);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_phrase);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":6
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":6
*
* def _phrase(phrase):
* return ' '.join(w.encode('utf8') if isinstance(w, unicode) else str(w) for w in phrase) # <<<<<<<<<<<<<<
@@ -5321,7 +5397,7 @@ static int __pyx_pw_4cdec_5_cdec_2NT_1__init__(PyObject *__pyx_v_self, PyObject
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":11
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":11
* cdef public bytes cat
* cdef public unsigned ref
* def __init__(self, bytes cat, unsigned ref=0): # <<<<<<<<<<<<<<
@@ -5334,7 +5410,7 @@ static int __pyx_pf_4cdec_5_cdec_2NT___init__(struct __pyx_obj_4cdec_5_cdec_NT *
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":13
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":13
* def __init__(self, bytes cat, unsigned ref=0):
* """NT(bytes cat, int ref=0) -> Non-terminal from category `cat`."""
* self.cat = cat # <<<<<<<<<<<<<<
@@ -5347,7 +5423,7 @@ static int __pyx_pf_4cdec_5_cdec_2NT___init__(struct __pyx_obj_4cdec_5_cdec_NT *
__Pyx_DECREF(((PyObject *)__pyx_v_self->cat));
__pyx_v_self->cat = __pyx_v_cat;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":14
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":14
* """NT(bytes cat, int ref=0) -> Non-terminal from category `cat`."""
* self.cat = cat
* self.ref = ref # <<<<<<<<<<<<<<
@@ -5372,7 +5448,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_2NT_3__str__(PyObject *__pyx_v_self) {
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":16
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":16
* self.ref = ref
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -5391,7 +5467,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_2NT_2__str__(struct __pyx_obj_4cdec_5_cde
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__str__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":17
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":17
*
* def __str__(self):
* if self.ref > 0: # <<<<<<<<<<<<<<
@@ -5401,7 +5477,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_2NT_2__str__(struct __pyx_obj_4cdec_5_cde
__pyx_t_1 = ((__pyx_v_self->ref > 0) != 0);
if (__pyx_t_1) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":18
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":18
* def __str__(self):
* if self.ref > 0:
* return '[%s,%d]' % (self.cat, self.ref) # <<<<<<<<<<<<<<
@@ -5429,7 +5505,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_2NT_2__str__(struct __pyx_obj_4cdec_5_cde
}
__pyx_L3:;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":19
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":19
* if self.ref > 0:
* return '[%s,%d]' % (self.cat, self.ref)
* return '[%s]' % self.cat # <<<<<<<<<<<<<<
@@ -5467,7 +5543,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_2NT_3cat_1__get__(PyObject *__pyx_v_self)
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":9
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":9
*
* cdef class NT:
* cdef public bytes cat # <<<<<<<<<<<<<<
@@ -5563,7 +5639,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_2NT_3ref_1__get__(PyObject *__pyx_v_self)
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":10
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":10
* cdef class NT:
* cdef public bytes cat
* cdef public unsigned ref # <<<<<<<<<<<<<<
@@ -5684,7 +5760,7 @@ static int __pyx_pw_4cdec_5_cdec_5NTRef_1__init__(PyObject *__pyx_v_self, PyObje
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":23
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":23
* cdef class NTRef:
* cdef public unsigned ref
* def __init__(self, unsigned ref): # <<<<<<<<<<<<<<
@@ -5697,7 +5773,7 @@ static int __pyx_pf_4cdec_5_cdec_5NTRef___init__(struct __pyx_obj_4cdec_5_cdec_N
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":25
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":25
* def __init__(self, unsigned ref):
* """NTRef(int ref) -> Non-terminal reference."""
* self.ref = ref # <<<<<<<<<<<<<<
@@ -5722,7 +5798,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_5NTRef_3__str__(PyObject *__pyx_v_self) {
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":27
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":27
* self.ref = ref
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -5740,7 +5816,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_5NTRef_2__str__(struct __pyx_obj_4cdec_5_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__str__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":28
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":28
*
* def __str__(self):
* return '[%d]' % self.ref # <<<<<<<<<<<<<<
@@ -5781,7 +5857,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_5NTRef_3ref_1__get__(PyObject *__pyx_v_se
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":22
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":22
*
* cdef class NTRef:
* cdef public unsigned ref # <<<<<<<<<<<<<<
@@ -5848,7 +5924,7 @@ static int __pyx_pf_4cdec_5_cdec_5NTRef_3ref_2__set__(struct __pyx_obj_4cdec_5_c
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":30
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":30
* return '[%d]' % self.ref
*
* cdef TRule convert_rule(_sa.Rule rule): # <<<<<<<<<<<<<<
@@ -5879,7 +5955,7 @@ static struct __pyx_obj_4cdec_5_cdec_TRule *__pyx_f_4cdec_5_cdec_convert_rule(st
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("convert_rule", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":31
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":31
*
* cdef TRule convert_rule(_sa.Rule rule):
* lhs = _sa.sym_tocat(rule.lhs) # <<<<<<<<<<<<<<
@@ -5888,7 +5964,7 @@ static struct __pyx_obj_4cdec_5_cdec_TRule *__pyx_f_4cdec_5_cdec_convert_rule(st
*/
__pyx_v_lhs = __pyx_f_4cdec_2sa_3_sa_sym_tocat(__pyx_v_rule->lhs);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":32
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":32
* cdef TRule convert_rule(_sa.Rule rule):
* lhs = _sa.sym_tocat(rule.lhs)
* scores = dict(rule.scores) # <<<<<<<<<<<<<<
@@ -5906,7 +5982,7 @@ static struct __pyx_obj_4cdec_5_cdec_TRule *__pyx_f_4cdec_5_cdec_convert_rule(st
__pyx_v_scores = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":33
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":33
* lhs = _sa.sym_tocat(rule.lhs)
* scores = dict(rule.scores)
* f, e = [], [] # <<<<<<<<<<<<<<
@@ -5922,7 +5998,7 @@ static struct __pyx_obj_4cdec_5_cdec_TRule *__pyx_f_4cdec_5_cdec_convert_rule(st
__pyx_v_e = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":34
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":34
* scores = dict(rule.scores)
* f, e = [], []
* cdef int* fsyms = rule.f.syms # <<<<<<<<<<<<<<
@@ -5932,7 +6008,7 @@ static struct __pyx_obj_4cdec_5_cdec_TRule *__pyx_f_4cdec_5_cdec_convert_rule(st
__pyx_t_3 = __pyx_v_rule->f->syms;
__pyx_v_fsyms = __pyx_t_3;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":35
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":35
* f, e = [], []
* cdef int* fsyms = rule.f.syms
* for i in range(rule.f.n): # <<<<<<<<<<<<<<
@@ -5943,7 +6019,7 @@ static struct __pyx_obj_4cdec_5_cdec_TRule *__pyx_f_4cdec_5_cdec_convert_rule(st
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
__pyx_v_i = __pyx_t_5;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":36
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":36
* cdef int* fsyms = rule.f.syms
* for i in range(rule.f.n):
* if _sa.sym_isvar(fsyms[i]): # <<<<<<<<<<<<<<
@@ -5953,7 +6029,7 @@ static struct __pyx_obj_4cdec_5_cdec_TRule *__pyx_f_4cdec_5_cdec_convert_rule(st
__pyx_t_6 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar((__pyx_v_fsyms[__pyx_v_i])) != 0);
if (__pyx_t_6) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":37
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":37
* for i in range(rule.f.n):
* if _sa.sym_isvar(fsyms[i]):
* f.append(NT(_sa.sym_tocat(fsyms[i]))) # <<<<<<<<<<<<<<
@@ -5976,7 +6052,7 @@ static struct __pyx_obj_4cdec_5_cdec_TRule *__pyx_f_4cdec_5_cdec_convert_rule(st
}
/*else*/ {
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":39
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":39
* f.append(NT(_sa.sym_tocat(fsyms[i])))
* else:
* f.append(_sa.sym_tostring(fsyms[i])) # <<<<<<<<<<<<<<
@@ -5991,7 +6067,7 @@ static struct __pyx_obj_4cdec_5_cdec_TRule *__pyx_f_4cdec_5_cdec_convert_rule(st
__pyx_L5:;
}
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":40
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":40
* else:
* f.append(_sa.sym_tostring(fsyms[i]))
* cdef int* esyms = rule.e.syms # <<<<<<<<<<<<<<
@@ -6001,7 +6077,7 @@ static struct __pyx_obj_4cdec_5_cdec_TRule *__pyx_f_4cdec_5_cdec_convert_rule(st
__pyx_t_3 = __pyx_v_rule->e->syms;
__pyx_v_esyms = __pyx_t_3;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":41
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":41
* f.append(_sa.sym_tostring(fsyms[i]))
* cdef int* esyms = rule.e.syms
* for i in range(rule.e.n): # <<<<<<<<<<<<<<
@@ -6012,7 +6088,7 @@ static struct __pyx_obj_4cdec_5_cdec_TRule *__pyx_f_4cdec_5_cdec_convert_rule(st
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
__pyx_v_i = __pyx_t_5;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":42
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":42
* cdef int* esyms = rule.e.syms
* for i in range(rule.e.n):
* if _sa.sym_isvar(esyms[i]): # <<<<<<<<<<<<<<
@@ -6022,7 +6098,7 @@ static struct __pyx_obj_4cdec_5_cdec_TRule *__pyx_f_4cdec_5_cdec_convert_rule(st
__pyx_t_6 = (__pyx_f_4cdec_2sa_3_sa_sym_isvar((__pyx_v_esyms[__pyx_v_i])) != 0);
if (__pyx_t_6) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":43
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":43
* for i in range(rule.e.n):
* if _sa.sym_isvar(esyms[i]):
* e.append(NTRef(_sa.sym_getindex(esyms[i]))) # <<<<<<<<<<<<<<
@@ -6045,7 +6121,7 @@ static struct __pyx_obj_4cdec_5_cdec_TRule *__pyx_f_4cdec_5_cdec_convert_rule(st
}
/*else*/ {
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":45
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":45
* e.append(NTRef(_sa.sym_getindex(esyms[i])))
* else:
* e.append(_sa.sym_tostring(esyms[i])) # <<<<<<<<<<<<<<
@@ -6060,7 +6136,7 @@ static struct __pyx_obj_4cdec_5_cdec_TRule *__pyx_f_4cdec_5_cdec_convert_rule(st
__pyx_L8:;
}
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":46
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":46
* else:
* e.append(_sa.sym_tostring(esyms[i]))
* a = list(rule.alignments()) # <<<<<<<<<<<<<<
@@ -6083,7 +6159,7 @@ static struct __pyx_obj_4cdec_5_cdec_TRule *__pyx_f_4cdec_5_cdec_convert_rule(st
__pyx_v_a = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":47
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":47
* e.append(_sa.sym_tostring(esyms[i]))
* a = list(rule.alignments())
* return TRule(lhs, f, e, scores, a) # <<<<<<<<<<<<<<
@@ -6146,6 +6222,7 @@ static int __pyx_pw_4cdec_5_cdec_5TRule_1__init__(PyObject *__pyx_v_self, PyObje
PyObject *__pyx_v_e = 0;
PyObject *__pyx_v_scores = 0;
PyObject *__pyx_v_a = 0;
+ PyObject *__pyx_v_text = 0;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
@@ -6153,21 +6230,23 @@ static int __pyx_pw_4cdec_5_cdec_5TRule_1__init__(PyObject *__pyx_v_self, PyObje
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
{
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__lhs,&__pyx_n_s__f,&__pyx_n_s__e,&__pyx_n_s__scores,&__pyx_n_s__a,0};
- PyObject* values[5] = {0,0,0,0,0};
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__lhs,&__pyx_n_s__f,&__pyx_n_s__e,&__pyx_n_s__scores,&__pyx_n_s__a,&__pyx_n_s__text,0};
+ PyObject* values[6] = {0,0,0,0,0,0};
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":52
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":52
* cdef shared_ptr[grammar.TRule]* rule
*
- * def __init__(self, lhs, f, e, scores, a=None): # <<<<<<<<<<<<<<
+ * def __init__(self, lhs, f, e, scores, a=None, text=None): # <<<<<<<<<<<<<<
* """TRule(lhs, f, e, scores, a=None) -> Translation rule.
* lhs: left hand side non-terminal
*/
values[4] = ((PyObject *)Py_None);
+ values[5] = ((PyObject *)Py_None);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
switch (pos_args) {
+ case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
@@ -6184,29 +6263,35 @@ static int __pyx_pw_4cdec_5_cdec_5TRule_1__init__(PyObject *__pyx_v_self, PyObje
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 6, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 6, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__scores)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 6, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 4:
if (kw_args > 0) {
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__a);
if (value) { values[4] = value; kw_args--; }
}
+ case 5:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__text);
+ if (value) { values[5] = value; kw_args--; }
+ }
}
if (unlikely(kw_args > 0)) {
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
@@ -6221,36 +6306,38 @@ static int __pyx_pw_4cdec_5_cdec_5TRule_1__init__(PyObject *__pyx_v_self, PyObje
__pyx_v_e = values[2];
__pyx_v_scores = values[3];
__pyx_v_a = values[4];
+ __pyx_v_text = values[5];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("cdec._cdec.TRule.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_4cdec_5_cdec_5TRule___init__(((struct __pyx_obj_4cdec_5_cdec_TRule *)__pyx_v_self), __pyx_v_lhs, __pyx_v_f, __pyx_v_e, __pyx_v_scores, __pyx_v_a);
+ __pyx_r = __pyx_pf_4cdec_5_cdec_5TRule___init__(((struct __pyx_obj_4cdec_5_cdec_TRule *)__pyx_v_self), __pyx_v_lhs, __pyx_v_f, __pyx_v_e, __pyx_v_scores, __pyx_v_a, __pyx_v_text);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static int __pyx_pf_4cdec_5_cdec_5TRule___init__(struct __pyx_obj_4cdec_5_cdec_TRule *__pyx_v_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_f, PyObject *__pyx_v_e, PyObject *__pyx_v_scores, PyObject *__pyx_v_a) {
+static int __pyx_pf_4cdec_5_cdec_5TRule___init__(struct __pyx_obj_4cdec_5_cdec_TRule *__pyx_v_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_f, PyObject *__pyx_v_e, PyObject *__pyx_v_scores, PyObject *__pyx_v_a, PyObject *__pyx_v_text) {
int __pyx_r;
__Pyx_RefNannyDeclarations
TRule *__pyx_t_1;
int __pyx_t_2;
+ std::string __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":59
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":59
* scores: dictionary of feature scores
* a: optional list of alignment points"""
* self.rule = new shared_ptr[grammar.TRule](new grammar.TRule()) # <<<<<<<<<<<<<<
- * self.lhs = lhs
- * self.e = e
+ * if lhs:
+ * self.lhs = lhs
*/
try {
__pyx_t_1 = new TRule();
@@ -6260,67 +6347,142 @@ static int __pyx_pf_4cdec_5_cdec_5TRule___init__(struct __pyx_obj_4cdec_5_cdec_T
}
__pyx_v_self->rule = new boost::shared_ptr<TRule>(__pyx_t_1);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":60
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":60
* a: optional list of alignment points"""
* self.rule = new shared_ptr[grammar.TRule](new grammar.TRule())
- * self.lhs = lhs # <<<<<<<<<<<<<<
- * self.e = e
- * self.f = f
+ * if lhs: # <<<<<<<<<<<<<<
+ * self.lhs = lhs
+ * if e:
*/
- if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__lhs, __pyx_v_lhs) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_lhs); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_2) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":61
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":61
* self.rule = new shared_ptr[grammar.TRule](new grammar.TRule())
- * self.lhs = lhs
- * self.e = e # <<<<<<<<<<<<<<
- * self.f = f
- * self.scores = scores
- */
- if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__e, __pyx_v_e) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":62
- * self.lhs = lhs
- * self.e = e
- * self.f = f # <<<<<<<<<<<<<<
- * self.scores = scores
+ * if lhs:
+ * self.lhs = lhs # <<<<<<<<<<<<<<
+ * if e:
+ * self.e = e
+ */
+ if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__lhs, __pyx_v_lhs) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L3;
+ }
+ __pyx_L3:;
+
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":62
+ * if lhs:
+ * self.lhs = lhs
+ * if e: # <<<<<<<<<<<<<<
+ * self.e = e
+ * if f:
+ */
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_e); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_2) {
+
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":63
+ * self.lhs = lhs
+ * if e:
+ * self.e = e # <<<<<<<<<<<<<<
+ * if f:
+ * self.f = f
+ */
+ if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__e, __pyx_v_e) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L4;
+ }
+ __pyx_L4:;
+
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":64
+ * if e:
+ * self.e = e
+ * if f: # <<<<<<<<<<<<<<
+ * self.f = f
+ * if scores:
+ */
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_f); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_2) {
+
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":65
+ * self.e = e
+ * if f:
+ * self.f = f # <<<<<<<<<<<<<<
+ * if scores:
+ * self.scores = scores
+ */
+ if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__f, __pyx_v_f) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":66
+ * if f:
+ * self.f = f
+ * if scores: # <<<<<<<<<<<<<<
+ * self.scores = scores
* if a:
*/
- if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__f, __pyx_v_f) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_scores); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_2) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":63
- * self.e = e
- * self.f = f
- * self.scores = scores # <<<<<<<<<<<<<<
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":67
+ * self.f = f
+ * if scores:
+ * self.scores = scores # <<<<<<<<<<<<<<
* if a:
- * self.a = a
+ * self.a = a
*/
- if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__scores, __pyx_v_scores) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__scores, __pyx_v_scores) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L6;
+ }
+ __pyx_L6:;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":64
- * self.f = f
- * self.scores = scores
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":68
+ * if scores:
+ * self.scores = scores
* if a: # <<<<<<<<<<<<<<
- * self.a = a
- * self.rule.get().ComputeArity()
+ * self.a = a
+ * if text:
*/
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_a); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_a); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_2) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":65
- * self.scores = scores
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":69
+ * self.scores = scores
* if a:
- * self.a = a # <<<<<<<<<<<<<<
+ * self.a = a # <<<<<<<<<<<<<<
+ * if text:
+ * self.rule.get().ReadFromString(text, 0)
+ */
+ if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__a, __pyx_v_a) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L7;
+ }
+ __pyx_L7:;
+
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":70
+ * if a:
+ * self.a = a
+ * if text: # <<<<<<<<<<<<<<
+ * self.rule.get().ReadFromString(text, 0)
+ * self.rule.get().ComputeArity()
+ */
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_text); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_2) {
+
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":71
+ * self.a = a
+ * if text:
+ * self.rule.get().ReadFromString(text, 0) # <<<<<<<<<<<<<<
* self.rule.get().ComputeArity()
*
*/
- if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__a, __pyx_v_a) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L3;
+ __pyx_t_3 = __pyx_convert_string_from_py_(__pyx_v_text); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_self->rule->get()->ReadFromString(__pyx_t_3, 0);
+ goto __pyx_L8;
}
- __pyx_L3:;
+ __pyx_L8:;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":66
- * if a:
- * self.a = a
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":72
+ * if text:
+ * self.rule.get().ReadFromString(text, 0)
* self.rule.get().ComputeArity() # <<<<<<<<<<<<<<
*
* def __dealloc__(self):
@@ -6346,7 +6508,7 @@ static void __pyx_pw_4cdec_5_cdec_5TRule_3__dealloc__(PyObject *__pyx_v_self) {
__Pyx_RefNannyFinishContext();
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":68
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":74
* self.rule.get().ComputeArity()
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -6358,7 +6520,7 @@ static void __pyx_pf_4cdec_5_cdec_5TRule_2__dealloc__(CYTHON_UNUSED struct __pyx
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":69
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":75
*
* def __dealloc__(self):
* del self.rule # <<<<<<<<<<<<<<
@@ -6381,7 +6543,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_5TRule_5arity_1__get__(PyObject *__pyx_v_
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":72
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":78
*
* property arity:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -6398,7 +6560,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_5TRule_5arity___get__(struct __pyx_obj_4c
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":73
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":79
* property arity:
* def __get__(self):
* return self.rule.get().arity_ # <<<<<<<<<<<<<<
@@ -6406,7 +6568,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_5TRule_5arity___get__(struct __pyx_obj_4c
* property f:
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyInt_FromLong(__pyx_v_self->rule->get()->arity_); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_v_self->rule->get()->arity_); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -6435,7 +6597,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_5TRule_1f_1__get__(PyObject *__pyx_v_self
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":76
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":82
*
* property f:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -6462,7 +6624,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_5TRule_1f___get__(struct __pyx_obj_4cdec_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":77
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":83
* property f:
* def __get__(self):
* cdef vector[WordID]* f_ = &self.rule.get().f_ # <<<<<<<<<<<<<<
@@ -6471,19 +6633,19 @@ static PyObject *__pyx_pf_4cdec_5_cdec_5TRule_1f___get__(struct __pyx_obj_4cdec_
*/
__pyx_v_f_ = (&__pyx_v_self->rule->get()->f_);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":79
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":85
* cdef vector[WordID]* f_ = &self.rule.get().f_
* cdef WordID w
* cdef f = [] # <<<<<<<<<<<<<<
* cdef unsigned i
* cdef int idx = 0
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_f = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":81
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":87
* cdef f = []
* cdef unsigned i
* cdef int idx = 0 # <<<<<<<<<<<<<<
@@ -6492,7 +6654,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_5TRule_1f___get__(struct __pyx_obj_4cdec_
*/
__pyx_v_idx = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":82
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":88
* cdef unsigned i
* cdef int idx = 0
* for i in range(f_.size()): # <<<<<<<<<<<<<<
@@ -6503,7 +6665,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_5TRule_1f___get__(struct __pyx_obj_4cdec_
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":83
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":89
* cdef int idx = 0
* for i in range(f_.size()):
* w = f_[0][i] # <<<<<<<<<<<<<<
@@ -6512,7 +6674,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_5TRule_1f___get__(struct __pyx_obj_4cdec_
*/
__pyx_v_w = ((__pyx_v_f_[0])[__pyx_v_i]);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":84
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":90
* for i in range(f_.size()):
* w = f_[0][i]
* if w < 0: # <<<<<<<<<<<<<<
@@ -6522,7 +6684,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_5TRule_1f___get__(struct __pyx_obj_4cdec_
__pyx_t_4 = ((__pyx_v_w < 0) != 0);
if (__pyx_t_4) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":85
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":91
* w = f_[0][i]
* if w < 0:
* idx += 1 # <<<<<<<<<<<<<<
@@ -6531,18 +6693,18 @@ static PyObject *__pyx_pf_4cdec_5_cdec_5TRule_1f___get__(struct __pyx_obj_4cdec_
*/
__pyx_v_idx = (__pyx_v_idx + 1);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":86
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":92
* if w < 0:
* idx += 1
* f.append(NT(TDConvert(-w).c_str(), idx)) # <<<<<<<<<<<<<<
* else:
* f.append(unicode(TDConvert(w).c_str(), encoding='utf8'))
*/
- __pyx_t_1 = __Pyx_PyBytes_FromString(TD::Convert((-__pyx_v_w)).c_str()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBytes_FromString(TD::Convert((-__pyx_v_w)).c_str()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_t_5 = PyInt_FromLong(__pyx_v_idx); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyInt_FromLong(__pyx_v_idx); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_1));
__Pyx_GIVEREF(((PyObject *)__pyx_t_1));
@@ -6550,10 +6712,10 @@ static PyObject *__pyx_pf_4cdec_5_cdec_5TRule_1f___get__(struct __pyx_obj_4cdec_
__Pyx_GIVEREF(__pyx_t_5);
__pyx_t_1 = 0;
__pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_NT)), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_NT)), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_f, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_f, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
@@ -6561,28 +6723,28 @@ static PyObject *__pyx_pf_4cdec_5_cdec_5TRule_1f___get__(struct __pyx_obj_4cdec_
}
/*else*/ {
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":88
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":94
* f.append(NT(TDConvert(-w).c_str(), idx))
* else:
* f.append(unicode(TDConvert(w).c_str(), encoding='utf8')) # <<<<<<<<<<<<<<
* return f
*
*/
- __pyx_t_6 = __Pyx_PyBytes_FromString(TD::Convert(__pyx_v_w).c_str()); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyBytes_FromString(TD::Convert(__pyx_v_w).c_str()); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_6));
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 94; __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 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_6));
- if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__encoding), ((PyObject *)__pyx_n_s__utf8)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyUnicode_Type))), ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__encoding), ((PyObject *)__pyx_n_s__utf8)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyUnicode_Type))), ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_f, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_f, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 94; __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_6); __pyx_t_6 = 0;
@@ -6590,7 +6752,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_5TRule_1f___get__(struct __pyx_obj_4cdec_
__pyx_L5:;
}
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":89
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":95
* else:
* f.append(unicode(TDConvert(w).c_str(), encoding='utf8'))
* return f # <<<<<<<<<<<<<<
@@ -6628,7 +6790,7 @@ static int __pyx_pw_4cdec_5_cdec_5TRule_1f_3__set__(PyObject *__pyx_v_self, PyOb
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":91
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":97
* return f
*
* def __set__(self, f): # <<<<<<<<<<<<<<
@@ -6655,7 +6817,7 @@ static int __pyx_pf_4cdec_5_cdec_5TRule_1f_2__set__(struct __pyx_obj_4cdec_5_cde
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":92
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":98
*
* def __set__(self, f):
* cdef vector[WordID]* f_ = &self.rule.get().f_ # <<<<<<<<<<<<<<
@@ -6664,17 +6826,17 @@ static int __pyx_pf_4cdec_5_cdec_5TRule_1f_2__set__(struct __pyx_obj_4cdec_5_cde
*/
__pyx_v_f_ = (&__pyx_v_self->rule->get()->f_);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":93
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":99
* def __set__(self, f):
* cdef vector[WordID]* f_ = &self.rule.get().f_
* f_.resize(len(f)) # <<<<<<<<<<<<<<
* cdef unsigned i
* cdef int idx = 0
*/
- __pyx_t_1 = PyObject_Length(__pyx_v_f); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Length(__pyx_v_f); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_f_->resize(__pyx_t_1);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":95
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":101
* f_.resize(len(f))
* cdef unsigned i
* cdef int idx = 0 # <<<<<<<<<<<<<<
@@ -6683,71 +6845,71 @@ static int __pyx_pf_4cdec_5_cdec_5TRule_1f_2__set__(struct __pyx_obj_4cdec_5_cde
*/
__pyx_v_idx = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":96
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":102
* cdef unsigned i
* cdef int idx = 0
* for i in range(len(f)): # <<<<<<<<<<<<<<
* if isinstance(f[i], NT):
* f_[0][i] = -TDConvert((<NT> f[i]).cat)
*/
- __pyx_t_1 = PyObject_Length(__pyx_v_f); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Length(__pyx_v_f); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":97
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":103
* cdef int idx = 0
* for i in range(len(f)):
* if isinstance(f[i], NT): # <<<<<<<<<<<<<<
* f_[0][i] = -TDConvert((<NT> f[i]).cat)
* else:
*/
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_f, __pyx_v_i, sizeof(unsigned int)+1, PyLong_FromUnsignedLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_f, __pyx_v_i, sizeof(unsigned int)+1, PyLong_FromUnsignedLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_TypeCheck(__pyx_t_3, ((PyObject*)__pyx_ptype_4cdec_5_cdec_NT));
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_5 = (__pyx_t_4 != 0);
if (__pyx_t_5) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":98
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":104
* for i in range(len(f)):
* if isinstance(f[i], NT):
* f_[0][i] = -TDConvert((<NT> f[i]).cat) # <<<<<<<<<<<<<<
* else:
* fi = as_str(f[i])
*/
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_f, __pyx_v_i, sizeof(unsigned int)+1, PyLong_FromUnsignedLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_f, __pyx_v_i, sizeof(unsigned int)+1, PyLong_FromUnsignedLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = __Pyx_PyObject_AsString(((PyObject *)((struct __pyx_obj_4cdec_5_cdec_NT *)__pyx_t_3)->cat)); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_AsString(((PyObject *)((struct __pyx_obj_4cdec_5_cdec_NT *)__pyx_t_3)->cat)); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
((__pyx_v_f_[0])[__pyx_v_i]) = (-TD::Convert(__pyx_t_6));
goto __pyx_L5;
}
/*else*/ {
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":100
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":106
* f_[0][i] = -TDConvert((<NT> f[i]).cat)
* else:
* fi = as_str(f[i]) # <<<<<<<<<<<<<<
* f_[0][i] = TDConvert(fi)
*
*/
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_f, __pyx_v_i, sizeof(unsigned int)+1, PyLong_FromUnsignedLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_f, __pyx_v_i, sizeof(unsigned int)+1, PyLong_FromUnsignedLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_7 = ((PyObject *)__pyx_f_4cdec_5_cdec_as_str(__pyx_t_3, NULL)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = ((PyObject *)__pyx_f_4cdec_5_cdec_as_str(__pyx_t_3, NULL)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_XDECREF(((PyObject *)__pyx_v_fi));
__pyx_v_fi = ((PyObject*)__pyx_t_7);
__pyx_t_7 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":101
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":107
* else:
* fi = as_str(f[i])
* f_[0][i] = TDConvert(fi) # <<<<<<<<<<<<<<
*
* property e:
*/
- __pyx_t_6 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_fi)); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_fi)); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
((__pyx_v_f_[0])[__pyx_v_i]) = TD::Convert(__pyx_t_6);
}
__pyx_L5:;
@@ -6777,7 +6939,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_5TRule_1e_1__get__(PyObject *__pyx_v_self
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":104
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":110
*
* property e:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -6804,7 +6966,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_5TRule_1e___get__(struct __pyx_obj_4cdec_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":105
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":111
* property e:
* def __get__(self):
* cdef vector[WordID]* e_ = &self.rule.get().e_ # <<<<<<<<<<<<<<
@@ -6813,19 +6975,19 @@ static PyObject *__pyx_pf_4cdec_5_cdec_5TRule_1e___get__(struct __pyx_obj_4cdec_
*/
__pyx_v_e_ = (&__pyx_v_self->rule->get()->e_);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":107
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":113
* cdef vector[WordID]* e_ = &self.rule.get().e_
* cdef WordID w
* cdef e = [] # <<<<<<<<<<<<<<
* cdef unsigned i
* cdef int idx = 0
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_e = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":109
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":115
* cdef e = []
* cdef unsigned i
* cdef int idx = 0 # <<<<<<<<<<<<<<
@@ -6834,7 +6996,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_5TRule_1e___get__(struct __pyx_obj_4cdec_
*/
__pyx_v_idx = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":110
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":116
* cdef unsigned i
* cdef int idx = 0
* for i in range(e_.size()): # <<<<<<<<<<<<<<
@@ -6845,7 +7007,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_5TRule_1e___get__(struct __pyx_obj_4cdec_
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":111
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":117
* cdef int idx = 0
* for i in range(e_.size()):
* w = e_[0][i] # <<<<<<<<<<<<<<
@@ -6854,7 +7016,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_5TRule_1e___get__(struct __pyx_obj_4cdec_
*/
__pyx_v_w = ((__pyx_v_e_[0])[__pyx_v_i]);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":112
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":118
* for i in range(e_.size()):
* w = e_[0][i]
* if w < 1: # <<<<<<<<<<<<<<
@@ -6864,7 +7026,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_5TRule_1e___get__(struct __pyx_obj_4cdec_
__pyx_t_4 = ((__pyx_v_w < 1) != 0);
if (__pyx_t_4) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":113
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":119
* w = e_[0][i]
* if w < 1:
* idx += 1 # <<<<<<<<<<<<<<
@@ -6873,24 +7035,24 @@ static PyObject *__pyx_pf_4cdec_5_cdec_5TRule_1e___get__(struct __pyx_obj_4cdec_
*/
__pyx_v_idx = (__pyx_v_idx + 1);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":114
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":120
* if w < 1:
* idx += 1
* e.append(NTRef(1-w)) # <<<<<<<<<<<<<<
* else:
* e.append(unicode(TDConvert(w).c_str(), encoding='utf8'))
*/
- __pyx_t_1 = PyInt_FromLong((1 - __pyx_v_w)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong((1 - __pyx_v_w)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_NTRef)), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_NTRef)), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_e, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_e, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
@@ -6898,28 +7060,28 @@ static PyObject *__pyx_pf_4cdec_5_cdec_5TRule_1e___get__(struct __pyx_obj_4cdec_
}
/*else*/ {
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":116
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":122
* e.append(NTRef(1-w))
* else:
* e.append(unicode(TDConvert(w).c_str(), encoding='utf8')) # <<<<<<<<<<<<<<
* return e
*
*/
- __pyx_t_5 = __Pyx_PyBytes_FromString(TD::Convert(__pyx_v_w).c_str()); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyBytes_FromString(TD::Convert(__pyx_v_w).c_str()); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_5));
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_5));
__Pyx_GIVEREF(((PyObject *)__pyx_t_5));
__pyx_t_5 = 0;
- __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_5));
- if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__encoding), ((PyObject *)__pyx_n_s__utf8)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)(&PyUnicode_Type))), ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__encoding), ((PyObject *)__pyx_n_s__utf8)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)(&PyUnicode_Type))), ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_e, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_e, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
@@ -6927,7 +7089,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_5TRule_1e___get__(struct __pyx_obj_4cdec_
__pyx_L5:;
}
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":117
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":123
* else:
* e.append(unicode(TDConvert(w).c_str(), encoding='utf8'))
* return e # <<<<<<<<<<<<<<
@@ -6965,7 +7127,7 @@ static int __pyx_pw_4cdec_5_cdec_5TRule_1e_3__set__(PyObject *__pyx_v_self, PyOb
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":119
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":125
* return e
*
* def __set__(self, e): # <<<<<<<<<<<<<<
@@ -6992,7 +7154,7 @@ static int __pyx_pf_4cdec_5_cdec_5TRule_1e_2__set__(struct __pyx_obj_4cdec_5_cde
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":120
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":126
*
* def __set__(self, e):
* cdef vector[WordID]* e_ = &self.rule.get().e_ # <<<<<<<<<<<<<<
@@ -7001,87 +7163,87 @@ static int __pyx_pf_4cdec_5_cdec_5TRule_1e_2__set__(struct __pyx_obj_4cdec_5_cde
*/
__pyx_v_e_ = (&__pyx_v_self->rule->get()->e_);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":121
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":127
* def __set__(self, e):
* cdef vector[WordID]* e_ = &self.rule.get().e_
* e_.resize(len(e)) # <<<<<<<<<<<<<<
* cdef unsigned i
* for i in range(len(e)):
*/
- __pyx_t_1 = PyObject_Length(__pyx_v_e); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Length(__pyx_v_e); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_e_->resize(__pyx_t_1);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":123
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":129
* e_.resize(len(e))
* cdef unsigned i
* for i in range(len(e)): # <<<<<<<<<<<<<<
* if isinstance(e[i], NTRef):
* e_[0][i] = 1-e[i].ref
*/
- __pyx_t_1 = PyObject_Length(__pyx_v_e); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Length(__pyx_v_e); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":124
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":130
* cdef unsigned i
* for i in range(len(e)):
* if isinstance(e[i], NTRef): # <<<<<<<<<<<<<<
* e_[0][i] = 1-e[i].ref
* else:
*/
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_e, __pyx_v_i, sizeof(unsigned int)+1, PyLong_FromUnsignedLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_e, __pyx_v_i, sizeof(unsigned int)+1, PyLong_FromUnsignedLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_TypeCheck(__pyx_t_3, ((PyObject*)__pyx_ptype_4cdec_5_cdec_NTRef));
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_5 = (__pyx_t_4 != 0);
if (__pyx_t_5) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":125
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":131
* for i in range(len(e)):
* if isinstance(e[i], NTRef):
* e_[0][i] = 1-e[i].ref # <<<<<<<<<<<<<<
* else:
* ei = as_str(e[i])
*/
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_e, __pyx_v_i, sizeof(unsigned int)+1, PyLong_FromUnsignedLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_e, __pyx_v_i, sizeof(unsigned int)+1, PyLong_FromUnsignedLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__ref); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__ref); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_Subtract(__pyx_int_1, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Subtract(__pyx_int_1, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_7 = __Pyx_PyInt_from_py_WordID(__pyx_t_3); if (unlikely((__pyx_t_7 == (WordID)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyInt_from_py_WordID(__pyx_t_3); if (unlikely((__pyx_t_7 == (WordID)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
((__pyx_v_e_[0])[__pyx_v_i]) = __pyx_t_7;
goto __pyx_L5;
}
/*else*/ {
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":127
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":133
* e_[0][i] = 1-e[i].ref
* else:
* ei = as_str(e[i]) # <<<<<<<<<<<<<<
* e_[0][i] = TDConvert(ei)
*
*/
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_e, __pyx_v_i, sizeof(unsigned int)+1, PyLong_FromUnsignedLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_e, __pyx_v_i, sizeof(unsigned int)+1, PyLong_FromUnsignedLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = ((PyObject *)__pyx_f_4cdec_5_cdec_as_str(__pyx_t_3, NULL)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = ((PyObject *)__pyx_f_4cdec_5_cdec_as_str(__pyx_t_3, NULL)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_XDECREF(((PyObject *)__pyx_v_ei));
__pyx_v_ei = ((PyObject*)__pyx_t_6);
__pyx_t_6 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":128
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":134
* else:
* ei = as_str(e[i])
* e_[0][i] = TDConvert(ei) # <<<<<<<<<<<<<<
*
* property a:
*/
- __pyx_t_8 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_ei)); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_ei)); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
((__pyx_v_e_[0])[__pyx_v_i]) = TD::Convert(__pyx_t_8);
}
__pyx_L5:;
@@ -7112,7 +7274,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_5TRule_1a_1__get__(PyObject *__pyx_v_self
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":131
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":137
*
* property a:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -7138,7 +7300,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_5TRule_1a___get__(struct __pyx_obj_4cdec_
__Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
__Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_5TRule_1a_2generator2, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_5TRule_1a_2generator2, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -7178,9 +7340,9 @@ static PyObject *__pyx_gb_4cdec_5_cdec_5TRule_1a_2generator2(__pyx_GeneratorObje
return NULL;
}
__pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":133
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":139
* def __get__(self):
* cdef unsigned i
* cdef vector[grammar.AlignmentPoint]* a = &self.rule.get().a_ # <<<<<<<<<<<<<<
@@ -7189,7 +7351,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_5TRule_1a_2generator2(__pyx_GeneratorObje
*/
__pyx_cur_scope->__pyx_v_a = (&__pyx_cur_scope->__pyx_v_self->rule->get()->a_);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":134
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":140
* cdef unsigned i
* cdef vector[grammar.AlignmentPoint]* a = &self.rule.get().a_
* for i in range(a.size()): # <<<<<<<<<<<<<<
@@ -7200,18 +7362,18 @@ static PyObject *__pyx_gb_4cdec_5_cdec_5TRule_1a_2generator2(__pyx_GeneratorObje
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_cur_scope->__pyx_v_i = __pyx_t_2;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":135
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":141
* cdef vector[grammar.AlignmentPoint]* a = &self.rule.get().a_
* for i in range(a.size()):
* yield (a[0][i].s_, a[0][i].t_) # <<<<<<<<<<<<<<
*
* def __set__(self, a):
*/
- __pyx_t_3 = PyInt_FromLong(((__pyx_cur_scope->__pyx_v_a[0])[__pyx_cur_scope->__pyx_v_i]).s_); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong(((__pyx_cur_scope->__pyx_v_a[0])[__pyx_cur_scope->__pyx_v_i]).s_); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyInt_FromLong(((__pyx_cur_scope->__pyx_v_a[0])[__pyx_cur_scope->__pyx_v_i]).t_); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(((__pyx_cur_scope->__pyx_v_a[0])[__pyx_cur_scope->__pyx_v_i]).t_); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
@@ -7231,7 +7393,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_5TRule_1a_2generator2(__pyx_GeneratorObje
__pyx_L6_resume_from_yield:;
__pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
__pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
PyErr_SetNone(PyExc_StopIteration);
goto __pyx_L0;
@@ -7259,7 +7421,7 @@ static int __pyx_pw_4cdec_5_cdec_5TRule_1a_4__set__(PyObject *__pyx_v_self, PyOb
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":137
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":143
* yield (a[0][i].s_, a[0][i].t_)
*
* def __set__(self, a): # <<<<<<<<<<<<<<
@@ -7288,7 +7450,7 @@ static int __pyx_pf_4cdec_5_cdec_5TRule_1a_3__set__(struct __pyx_obj_4cdec_5_cde
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":138
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":144
*
* def __set__(self, a):
* cdef vector[grammar.AlignmentPoint]* a_ = &self.rule.get().a_ # <<<<<<<<<<<<<<
@@ -7297,35 +7459,35 @@ static int __pyx_pf_4cdec_5_cdec_5TRule_1a_3__set__(struct __pyx_obj_4cdec_5_cde
*/
__pyx_v_a_ = (&__pyx_v_self->rule->get()->a_);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":139
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":145
* def __set__(self, a):
* cdef vector[grammar.AlignmentPoint]* a_ = &self.rule.get().a_
* a_.resize(len(a)) # <<<<<<<<<<<<<<
* cdef unsigned i
* cdef int s, t
*/
- __pyx_t_1 = PyObject_Length(__pyx_v_a); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Length(__pyx_v_a); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_a_->resize(__pyx_t_1);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":142
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":148
* cdef unsigned i
* cdef int s, t
* for i in range(len(a)): # <<<<<<<<<<<<<<
* s, t = a[i]
* a_[0][i] = grammar.AlignmentPoint(s, t)
*/
- __pyx_t_1 = PyObject_Length(__pyx_v_a); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Length(__pyx_v_a); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":143
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":149
* cdef int s, t
* for i in range(len(a)):
* s, t = a[i] # <<<<<<<<<<<<<<
* a_[0][i] = grammar.AlignmentPoint(s, t)
*
*/
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_a, __pyx_v_i, sizeof(unsigned int)+1, PyLong_FromUnsignedLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_a, __pyx_v_i, sizeof(unsigned int)+1, PyLong_FromUnsignedLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 149; __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;
@@ -7337,7 +7499,7 @@ static int __pyx_pf_4cdec_5_cdec_5TRule_1a_3__set__(struct __pyx_obj_4cdec_5_cde
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -7350,16 +7512,16 @@ static int __pyx_pf_4cdec_5_cdec_5TRule_1a_3__set__(struct __pyx_obj_4cdec_5_cde
__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[2]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 149; __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[2]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 149; __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[2]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 149; __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;
@@ -7367,7 +7529,7 @@ static int __pyx_pf_4cdec_5_cdec_5TRule_1a_3__set__(struct __pyx_obj_4cdec_5_cde
__Pyx_GOTREF(__pyx_t_4);
index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_5);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_7 = NULL;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
goto __pyx_L6_unpacking_done;
@@ -7375,17 +7537,17 @@ static int __pyx_pf_4cdec_5_cdec_5TRule_1a_3__set__(struct __pyx_obj_4cdec_5_cde
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_7 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L6_unpacking_done:;
}
- __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_s = __pyx_t_8;
__pyx_v_t = __pyx_t_9;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":144
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":150
* for i in range(len(a)):
* s, t = a[i]
* a_[0][i] = grammar.AlignmentPoint(s, t) # <<<<<<<<<<<<<<
@@ -7420,7 +7582,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_5TRule_6scores_1__get__(PyObject *__pyx_v
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":147
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":153
*
* property scores:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -7438,20 +7600,20 @@ static PyObject *__pyx_pf_4cdec_5_cdec_5TRule_6scores___get__(struct __pyx_obj_4
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":148
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":154
* property scores:
* def __get__(self):
* cdef SparseVector scores = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<<
* scores.vector = new FastSparseVector[double](self.rule.get().scores_)
* return scores
*/
- __pyx_t_1 = __pyx_tp_new_4cdec_5_cdec_SparseVector(((PyTypeObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_SparseVector)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_tp_new_4cdec_5_cdec_SparseVector(((PyTypeObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_SparseVector)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4cdec_5_cdec_SparseVector)))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4cdec_5_cdec_SparseVector)))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_scores = ((struct __pyx_obj_4cdec_5_cdec_SparseVector *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":149
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":155
* def __get__(self):
* cdef SparseVector scores = SparseVector.__new__(SparseVector)
* scores.vector = new FastSparseVector[double](self.rule.get().scores_) # <<<<<<<<<<<<<<
@@ -7460,7 +7622,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_5TRule_6scores___get__(struct __pyx_obj_4
*/
__pyx_v_scores->vector = new FastSparseVector<double>(__pyx_v_self->rule->get()->scores_);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":150
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":156
* cdef SparseVector scores = SparseVector.__new__(SparseVector)
* scores.vector = new FastSparseVector[double](self.rule.get().scores_)
* return scores # <<<<<<<<<<<<<<
@@ -7496,7 +7658,7 @@ static int __pyx_pw_4cdec_5_cdec_5TRule_6scores_3__set__(PyObject *__pyx_v_self,
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":152
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":158
* return scores
*
* def __set__(self, scores): # <<<<<<<<<<<<<<
@@ -7528,7 +7690,7 @@ static int __pyx_pf_4cdec_5_cdec_5TRule_6scores_2__set__(struct __pyx_obj_4cdec_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":153
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":159
*
* def __set__(self, scores):
* cdef FastSparseVector[double]* scores_ = &self.rule.get().scores_ # <<<<<<<<<<<<<<
@@ -7537,7 +7699,7 @@ static int __pyx_pf_4cdec_5_cdec_5TRule_6scores_2__set__(struct __pyx_obj_4cdec_
*/
__pyx_v_scores_ = (&__pyx_v_self->rule->get()->scores_);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":154
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":160
* def __set__(self, scores):
* cdef FastSparseVector[double]* scores_ = &self.rule.get().scores_
* scores_.clear() # <<<<<<<<<<<<<<
@@ -7546,23 +7708,23 @@ static int __pyx_pf_4cdec_5_cdec_5TRule_6scores_2__set__(struct __pyx_obj_4cdec_
*/
__pyx_v_scores_->clear();
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":157
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":163
* cdef int fid
* cdef float fval
* for fname, fval in scores.items(): # <<<<<<<<<<<<<<
* fn = as_str(fname)
* fid = FDConvert(fn)
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_scores, __pyx_n_s__items); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_scores, __pyx_n_s__items); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 163; __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[2]; __pyx_lineno = 157; __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[2]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
__pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
__pyx_t_4 = NULL;
} else {
- __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -7571,23 +7733,23 @@ static int __pyx_pf_4cdec_5_cdec_5TRule_6scores_2__set__(struct __pyx_obj_4cdec_
if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_2 = __pyx_t_4(__pyx_t_1);
if (unlikely(!__pyx_t_2)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -7603,7 +7765,7 @@ static int __pyx_pf_4cdec_5_cdec_5TRule_6scores_2__set__(struct __pyx_obj_4cdec_
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -7616,16 +7778,16 @@ static int __pyx_pf_4cdec_5_cdec_5TRule_6scores_2__set__(struct __pyx_obj_4cdec_
__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[2]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 163; __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[2]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
#endif
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
@@ -7633,7 +7795,7 @@ static int __pyx_pf_4cdec_5_cdec_5TRule_6scores_2__set__(struct __pyx_obj_4cdec_
__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[2]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 163; __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;
@@ -7641,40 +7803,40 @@ static int __pyx_pf_4cdec_5_cdec_5TRule_6scores_2__set__(struct __pyx_obj_4cdec_
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L6_unpacking_done:;
}
- __pyx_t_9 = __pyx_PyFloat_AsFloat(__pyx_t_6); if (unlikely((__pyx_t_9 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __pyx_PyFloat_AsFloat(__pyx_t_6); if (unlikely((__pyx_t_9 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF(__pyx_v_fname);
__pyx_v_fname = __pyx_t_5;
__pyx_t_5 = 0;
__pyx_v_fval = __pyx_t_9;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":158
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":164
* cdef float fval
* for fname, fval in scores.items():
* fn = as_str(fname) # <<<<<<<<<<<<<<
* fid = FDConvert(fn)
* if fid < 0: raise KeyError(fname)
*/
- __pyx_t_2 = ((PyObject *)__pyx_f_4cdec_5_cdec_as_str(__pyx_v_fname, NULL)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = ((PyObject *)__pyx_f_4cdec_5_cdec_as_str(__pyx_v_fname, NULL)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_XDECREF(((PyObject *)__pyx_v_fn));
__pyx_v_fn = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":159
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":165
* for fname, fval in scores.items():
* fn = as_str(fname)
* fid = FDConvert(fn) # <<<<<<<<<<<<<<
* if fid < 0: raise KeyError(fname)
* scores_.set_value(fid, fval)
*/
- __pyx_t_10 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_fn)); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_fn)); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_fid = FD::Convert(__pyx_t_10);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":160
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":166
* fn = as_str(fname)
* fid = FDConvert(fn)
* if fid < 0: raise KeyError(fname) # <<<<<<<<<<<<<<
@@ -7683,22 +7845,22 @@ static int __pyx_pf_4cdec_5_cdec_5TRule_6scores_2__set__(struct __pyx_obj_4cdec_
*/
__pyx_t_11 = ((__pyx_v_fid < 0) != 0);
if (__pyx_t_11) {
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_fname);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_fname);
__Pyx_GIVEREF(__pyx_v_fname);
- __pyx_t_6 = PyObject_Call(__pyx_builtin_KeyError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Call(__pyx_builtin_KeyError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L7;
}
__pyx_L7:;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":161
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":167
* fid = FDConvert(fn)
* if fid < 0: raise KeyError(fname)
* scores_.set_value(fid, fval) # <<<<<<<<<<<<<<
@@ -7737,7 +7899,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_5TRule_3lhs_1__get__(PyObject *__pyx_v_se
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":164
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":170
*
* property lhs:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -7755,7 +7917,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_5TRule_3lhs___get__(struct __pyx_obj_4cde
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":165
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":171
* property lhs:
* def __get__(self):
* return NT(TDConvert(-self.rule.get().lhs_).c_str()) # <<<<<<<<<<<<<<
@@ -7763,14 +7925,14 @@ static PyObject *__pyx_pf_4cdec_5_cdec_5TRule_3lhs___get__(struct __pyx_obj_4cde
* def __set__(self, lhs):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyBytes_FromString(TD::Convert((-__pyx_v_self->rule->get()->lhs_)).c_str()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBytes_FromString(TD::Convert((-__pyx_v_self->rule->get()->lhs_)).c_str()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
__Pyx_GIVEREF(((PyObject *)__pyx_t_1));
__pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_NT)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_NT)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
@@ -7801,7 +7963,7 @@ static int __pyx_pw_4cdec_5_cdec_5TRule_3lhs_3__set__(PyObject *__pyx_v_self, Py
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":167
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":173
* return NT(TDConvert(-self.rule.get().lhs_).c_str())
*
* def __set__(self, lhs): # <<<<<<<<<<<<<<
@@ -7823,7 +7985,7 @@ static int __pyx_pf_4cdec_5_cdec_5TRule_3lhs_2__set__(struct __pyx_obj_4cdec_5_c
__Pyx_RefNannySetupContext("__set__", 0);
__Pyx_INCREF(__pyx_v_lhs);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":168
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":174
*
* def __set__(self, lhs):
* if not isinstance(lhs, NT): # <<<<<<<<<<<<<<
@@ -7834,19 +7996,19 @@ static int __pyx_pf_4cdec_5_cdec_5TRule_3lhs_2__set__(struct __pyx_obj_4cdec_5_c
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":169
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":175
* def __set__(self, lhs):
* if not isinstance(lhs, NT):
* lhs = NT(lhs) # <<<<<<<<<<<<<<
* self.rule.get().lhs_ = -TDConvert((<NT> lhs).cat)
*
*/
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_lhs);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_lhs);
__Pyx_GIVEREF(__pyx_v_lhs);
- __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_NT)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_NT)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_v_lhs);
@@ -7856,14 +8018,14 @@ static int __pyx_pf_4cdec_5_cdec_5TRule_3lhs_2__set__(struct __pyx_obj_4cdec_5_c
}
__pyx_L3:;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":170
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":176
* if not isinstance(lhs, NT):
* lhs = NT(lhs)
* self.rule.get().lhs_ = -TDConvert((<NT> lhs).cat) # <<<<<<<<<<<<<<
*
* def __str__(self):
*/
- __pyx_t_5 = __Pyx_PyObject_AsString(((PyObject *)((struct __pyx_obj_4cdec_5_cdec_NT *)__pyx_v_lhs)->cat)); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_AsString(((PyObject *)((struct __pyx_obj_4cdec_5_cdec_NT *)__pyx_v_lhs)->cat)); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->rule->get()->lhs_ = (-TD::Convert(__pyx_t_5));
__pyx_r = 0;
@@ -7889,9 +8051,9 @@ static PyObject *__pyx_pw_4cdec_5_cdec_5TRule_5__str__(PyObject *__pyx_v_self) {
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_5_cdec_5TRule_7__str___2generator19(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4cdec_5_cdec_5TRule_7__str___2generator22(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":173
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":179
*
* def __str__(self):
* scores = ' '.join('%s=%s' % feat for feat in self.scores) # <<<<<<<<<<<<<<
@@ -7917,7 +8079,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_5TRule_7__str___genexpr(PyObject *__pyx_s
__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_5_cdec_5TRule_7__str___2generator19, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_5TRule_7__str___2generator22, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -7935,7 +8097,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_5TRule_7__str___genexpr(PyObject *__pyx_s
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_5_cdec_5TRule_7__str___2generator19(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4cdec_5_cdec_5TRule_7__str___2generator22(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_6_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_6_genexpr *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
@@ -7956,15 +8118,15 @@ static PyObject *__pyx_gb_4cdec_5_cdec_5TRule_7__str___2generator19(__pyx_Genera
return NULL;
}
__pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 173; __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[2]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self), __pyx_n_s__scores); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 179; __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[2]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self), __pyx_n_s__scores); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 179; __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_3 = 0;
__pyx_t_4 = NULL;
} else {
- __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
}
@@ -7973,23 +8135,23 @@ static PyObject *__pyx_gb_4cdec_5_cdec_5TRule_7__str___2generator19(__pyx_Genera
if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_1 = __pyx_t_4(__pyx_t_2);
if (unlikely(!__pyx_t_1)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -8000,7 +8162,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_5TRule_7__str___2generator19(__pyx_Genera
__Pyx_GIVEREF(__pyx_t_1);
__pyx_cur_scope->__pyx_v_feat = __pyx_t_1;
__pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_11), __pyx_cur_scope->__pyx_v_feat); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_11), __pyx_cur_scope->__pyx_v_feat); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__pyx_r = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
@@ -8019,7 +8181,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_5TRule_7__str___2generator19(__pyx_Genera
__Pyx_XGOTREF(__pyx_t_2);
__pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
__pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
PyErr_SetNone(PyExc_StopIteration);
@@ -8036,7 +8198,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_5TRule_7__str___2generator19(__pyx_Genera
return NULL;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":172
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":178
* self.rule.get().lhs_ = -TDConvert((<NT> lhs).cat)
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -8068,30 +8230,30 @@ static PyObject *__pyx_pf_4cdec_5_cdec_5TRule_4__str__(struct __pyx_obj_4cdec_5_
__Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
__Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":173
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":179
*
* def __str__(self):
* scores = ' '.join('%s=%s' % feat for feat in self.scores) # <<<<<<<<<<<<<<
* return '%s ||| %s ||| %s ||| %s' % (self.lhs,
* _phrase(self.f), _phrase(self.e), scores)
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_7), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_7), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __pyx_pf_4cdec_5_cdec_5TRule_7__str___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_pf_4cdec_5_cdec_5TRule_7__str___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 179; __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[2]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 179; __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[2]; __pyx_lineno = 173; __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[2]; __pyx_lineno = 179; __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_scores = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":174
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":180
* def __str__(self):
* scores = ' '.join('%s=%s' % feat for feat in self.scores)
* return '%s ||| %s ||| %s ||| %s' % (self.lhs, # <<<<<<<<<<<<<<
@@ -8099,43 +8261,43 @@ static PyObject *__pyx_pf_4cdec_5_cdec_5TRule_4__str__(struct __pyx_obj_4cdec_5_
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__lhs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__lhs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":175
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":181
* scores = ' '.join('%s=%s' % feat for feat in self.scores)
* return '%s ||| %s ||| %s ||| %s' % (self.lhs,
* _phrase(self.f), _phrase(self.e), scores) # <<<<<<<<<<<<<<
*
* cdef class MRule(TRule):
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s___phrase); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s___phrase); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_4, 0, __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[2]; __pyx_lineno = 175; __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[2]; __pyx_lineno = 181; __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;
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s___phrase); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s___phrase); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__e); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__e); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
@@ -8149,7 +8311,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_5TRule_4__str__(struct __pyx_obj_4cdec_5_
__pyx_t_2 = 0;
__pyx_t_1 = 0;
__pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_12), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_12), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
__pyx_r = ((PyObject *)__pyx_t_3);
@@ -8211,16 +8373,16 @@ static int __pyx_pw_4cdec_5_cdec_5MRule_1__init__(PyObject *__pyx_v_self, PyObje
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__rhs)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__scores)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
@@ -8235,7 +8397,7 @@ static int __pyx_pw_4cdec_5_cdec_5MRule_1__init__(PyObject *__pyx_v_self, PyObje
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("cdec._cdec.MRule.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -8246,7 +8408,7 @@ static int __pyx_pw_4cdec_5_cdec_5MRule_1__init__(PyObject *__pyx_v_self, PyObje
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":178
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":184
*
* cdef class MRule(TRule):
* def __init__(self, lhs, rhs, scores): # <<<<<<<<<<<<<<
@@ -8273,7 +8435,7 @@ static int __pyx_pf_4cdec_5_cdec_5MRule___init__(struct __pyx_obj_4cdec_5_cdec_M
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":183
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":189
* rhs: right hand side phrase (list of words/NT)
* scores: dictionary of feature scores"""
* cdef unsigned i = 1 # <<<<<<<<<<<<<<
@@ -8282,19 +8444,19 @@ static int __pyx_pf_4cdec_5_cdec_5MRule___init__(struct __pyx_obj_4cdec_5_cdec_M
*/
__pyx_v_i = 1;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":184
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":190
* scores: dictionary of feature scores"""
* cdef unsigned i = 1
* e = [] # <<<<<<<<<<<<<<
* for s in rhs:
* if isinstance(s, NT):
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_e = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":185
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":191
* cdef unsigned i = 1
* e = []
* for s in rhs: # <<<<<<<<<<<<<<
@@ -8305,7 +8467,7 @@ static int __pyx_pf_4cdec_5_cdec_5MRule___init__(struct __pyx_obj_4cdec_5_cdec_M
__pyx_t_1 = __pyx_v_rhs; __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_rhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_rhs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -8313,23 +8475,23 @@ static int __pyx_pf_4cdec_5_cdec_5MRule___init__(struct __pyx_obj_4cdec_5_cdec_M
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[2]; __pyx_lineno = 185; __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[2]; __pyx_lineno = 191; __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[2]; __pyx_lineno = 185; __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[2]; __pyx_lineno = 191; __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[2]; __pyx_lineno = 185; __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[2]; __pyx_lineno = 191; __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[2]; __pyx_lineno = 185; __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[2]; __pyx_lineno = 191; __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[2]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -8339,7 +8501,7 @@ static int __pyx_pf_4cdec_5_cdec_5MRule___init__(struct __pyx_obj_4cdec_5_cdec_M
__pyx_v_s = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":186
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":192
* e = []
* for s in rhs:
* if isinstance(s, NT): # <<<<<<<<<<<<<<
@@ -8350,27 +8512,27 @@ static int __pyx_pf_4cdec_5_cdec_5MRule___init__(struct __pyx_obj_4cdec_5_cdec_M
__pyx_t_6 = (__pyx_t_5 != 0);
if (__pyx_t_6) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":187
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":193
* for s in rhs:
* if isinstance(s, NT):
* e.append(NTRef(i)) # <<<<<<<<<<<<<<
* i += 1
* else:
*/
- __pyx_t_4 = PyLong_FromUnsignedLong(__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyLong_FromUnsignedLong(__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_NTRef)), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_NTRef)), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
- __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_e, __pyx_t_4); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_e, __pyx_t_4); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":188
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":194
* if isinstance(s, NT):
* e.append(NTRef(i))
* i += 1 # <<<<<<<<<<<<<<
@@ -8382,27 +8544,27 @@ static int __pyx_pf_4cdec_5_cdec_5MRule___init__(struct __pyx_obj_4cdec_5_cdec_M
}
/*else*/ {
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":190
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":196
* i += 1
* else:
* e.append(s) # <<<<<<<<<<<<<<
* super(MRule, self).__init__(lhs, rhs, e, scores, None)
*
*/
- __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_e, __pyx_v_s); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_e, __pyx_v_s); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_L5:;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":191
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":197
* else:
* e.append(s)
* super(MRule, self).__init__(lhs, rhs, e, scores, None) # <<<<<<<<<<<<<<
*
* cdef class Grammar:
*/
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_MRule)));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_MRule)));
@@ -8410,13 +8572,13 @@ static int __pyx_pf_4cdec_5_cdec_5MRule___init__(struct __pyx_obj_4cdec_5_cdec_M
__Pyx_INCREF(((PyObject *)__pyx_v_self));
PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
- __pyx_t_4 = PyObject_Call(__pyx_builtin_super, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_builtin_super, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s____init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s____init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_lhs);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_lhs);
@@ -8433,7 +8595,7 @@ static int __pyx_pf_4cdec_5_cdec_5MRule___init__(struct __pyx_obj_4cdec_5_cdec_M
__Pyx_INCREF(Py_None);
PyTuple_SET_ITEM(__pyx_t_4, 4, Py_None);
__Pyx_GIVEREF(Py_None);
- __pyx_t_7 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
@@ -8463,7 +8625,7 @@ static void __pyx_pw_4cdec_5_cdec_7Grammar_1__dealloc__(PyObject *__pyx_v_self)
__Pyx_RefNannyFinishContext();
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":196
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":202
* cdef shared_ptr[grammar.Grammar]* grammar
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -8475,7 +8637,7 @@ static void __pyx_pf_4cdec_5_cdec_7Grammar___dealloc__(CYTHON_UNUSED struct __py
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":197
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":203
*
* def __dealloc__(self):
* del self.grammar # <<<<<<<<<<<<<<
@@ -8499,7 +8661,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_7Grammar_3__iter__(PyObject *__pyx_v_self
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":199
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":205
* del self.grammar
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -8525,7 +8687,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_7Grammar_2__iter__(struct __pyx_obj_4cdec
__Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
__Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_7Grammar_4generator3, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_7Grammar_4generator3, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -8563,9 +8725,9 @@ static PyObject *__pyx_gb_4cdec_5_cdec_7Grammar_4generator3(__pyx_GeneratorObjec
return NULL;
}
__pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":200
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":206
*
* def __iter__(self):
* cdef grammar.const_GrammarIter* root = self.grammar.get().GetRoot() # <<<<<<<<<<<<<<
@@ -8574,7 +8736,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_7Grammar_4generator3(__pyx_GeneratorObjec
*/
__pyx_cur_scope->__pyx_v_root = __pyx_cur_scope->__pyx_v_self->grammar->get()->GetRoot();
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":201
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":207
* def __iter__(self):
* cdef grammar.const_GrammarIter* root = self.grammar.get().GetRoot()
* cdef grammar.const_RuleBin* rbin = root.GetRules() # <<<<<<<<<<<<<<
@@ -8583,7 +8745,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_7Grammar_4generator3(__pyx_GeneratorObjec
*/
__pyx_cur_scope->__pyx_v_rbin = __pyx_cur_scope->__pyx_v_root->GetRules();
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":204
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":210
* cdef TRule trule
* cdef unsigned i
* for i in range(rbin.GetNumRules()): # <<<<<<<<<<<<<<
@@ -8594,23 +8756,23 @@ static PyObject *__pyx_gb_4cdec_5_cdec_7Grammar_4generator3(__pyx_GeneratorObjec
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_cur_scope->__pyx_v_i = __pyx_t_2;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":205
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":211
* cdef unsigned i
* for i in range(rbin.GetNumRules()):
* trule = TRule.__new__(TRule) # <<<<<<<<<<<<<<
* trule.rule = new shared_ptr[grammar.TRule](rbin.GetIthRule(i))
* yield trule
*/
- __pyx_t_3 = __pyx_tp_new_4cdec_5_cdec_TRule(((PyTypeObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_TRule)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __pyx_tp_new_4cdec_5_cdec_TRule(((PyTypeObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_TRule)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4cdec_5_cdec_TRule)))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4cdec_5_cdec_TRule)))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_trule));
__Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_trule));
__Pyx_GIVEREF(__pyx_t_3);
__pyx_cur_scope->__pyx_v_trule = ((struct __pyx_obj_4cdec_5_cdec_TRule *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":206
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":212
* for i in range(rbin.GetNumRules()):
* trule = TRule.__new__(TRule)
* trule.rule = new shared_ptr[grammar.TRule](rbin.GetIthRule(i)) # <<<<<<<<<<<<<<
@@ -8619,7 +8781,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_7Grammar_4generator3(__pyx_GeneratorObjec
*/
__pyx_cur_scope->__pyx_v_trule->rule = new boost::shared_ptr<TRule>(__pyx_cur_scope->__pyx_v_rbin->GetIthRule(__pyx_cur_scope->__pyx_v_i));
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":207
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":213
* trule = TRule.__new__(TRule)
* trule.rule = new shared_ptr[grammar.TRule](rbin.GetIthRule(i))
* yield trule # <<<<<<<<<<<<<<
@@ -8638,7 +8800,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_7Grammar_4generator3(__pyx_GeneratorObjec
__pyx_L6_resume_from_yield:;
__pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
__pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
PyErr_SetNone(PyExc_StopIteration);
goto __pyx_L0;
@@ -8664,7 +8826,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_7Grammar_4name_1__get__(PyObject *__pyx_v
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":210
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":216
*
* property name:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -8682,21 +8844,21 @@ static PyObject *__pyx_pf_4cdec_5_cdec_7Grammar_4name___get__(struct __pyx_obj_4
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":211
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":217
* property name:
* def __get__(self):
* str(self.grammar.get().GetGrammarName().c_str()) # <<<<<<<<<<<<<<
*
* def __set__(self, name):
*/
- __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->grammar->get()->GetGrammarName().c_str()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->grammar->get()->GetGrammarName().c_str()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
__Pyx_GIVEREF(((PyObject *)__pyx_t_1));
__pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -8725,7 +8887,7 @@ static int __pyx_pw_4cdec_5_cdec_7Grammar_4name_3__set__(PyObject *__pyx_v_self,
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":213
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":219
* str(self.grammar.get().GetGrammarName().c_str())
*
* def __set__(self, name): # <<<<<<<<<<<<<<
@@ -8744,27 +8906,27 @@ static int __pyx_pf_4cdec_5_cdec_7Grammar_4name_2__set__(struct __pyx_obj_4cdec_
__Pyx_RefNannySetupContext("__set__", 0);
__Pyx_INCREF(__pyx_v_name);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":214
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":220
*
* def __set__(self, name):
* name = as_str(name) # <<<<<<<<<<<<<<
* self.grammar.get().SetGrammarName(name)
*
*/
- __pyx_t_1 = ((PyObject *)__pyx_f_4cdec_5_cdec_as_str(__pyx_v_name, NULL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = ((PyObject *)__pyx_f_4cdec_5_cdec_as_str(__pyx_v_name, NULL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_v_name);
__pyx_v_name = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":215
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":221
* def __set__(self, name):
* name = as_str(name)
* self.grammar.get().SetGrammarName(name) # <<<<<<<<<<<<<<
*
* cdef class TextGrammar(Grammar):
*/
- __pyx_t_2 = __pyx_convert_string_from_py_(__pyx_v_name); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_convert_string_from_py_(__pyx_v_name); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->grammar->get()->SetGrammarName(__pyx_t_2);
__pyx_r = 0;
@@ -8811,7 +8973,7 @@ static int __pyx_pw_4cdec_5_cdec_11TextGrammar_1__init__(PyObject *__pyx_v_self,
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
@@ -8822,7 +8984,7 @@ static int __pyx_pw_4cdec_5_cdec_11TextGrammar_1__init__(PyObject *__pyx_v_self,
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("cdec._cdec.TextGrammar.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -8833,7 +8995,7 @@ static int __pyx_pw_4cdec_5_cdec_11TextGrammar_1__init__(PyObject *__pyx_v_self,
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":218
+/* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":224
*
* cdef class TextGrammar(Grammar):
* def __init__(self, rules): # <<<<<<<<<<<<<<
@@ -8857,7 +9019,7 @@ static int __pyx_pf_4cdec_5_cdec_11TextGrammar___init__(struct __pyx_obj_4cdec_5
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":220
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":226
* def __init__(self, rules):
* """TextGrammar(rules) -> SCFG Grammar containing the rules."""
* self.grammar = new shared_ptr[grammar.Grammar](new grammar.TextGrammar()) # <<<<<<<<<<<<<<
@@ -8866,7 +9028,7 @@ static int __pyx_pf_4cdec_5_cdec_11TextGrammar___init__(struct __pyx_obj_4cdec_5
*/
__pyx_v_self->__pyx_base.grammar = new boost::shared_ptr<Grammar>(new TextGrammar());
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":221
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":227
* """TextGrammar(rules) -> SCFG Grammar containing the rules."""
* self.grammar = new shared_ptr[grammar.Grammar](new grammar.TextGrammar())
* cdef grammar.TextGrammar* _g = <grammar.TextGrammar*> self.grammar.get() # <<<<<<<<<<<<<<
@@ -8875,7 +9037,7 @@ static int __pyx_pf_4cdec_5_cdec_11TextGrammar___init__(struct __pyx_obj_4cdec_5
*/
__pyx_v__g = ((TextGrammar *)__pyx_v_self->__pyx_base.grammar->get());
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":222
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":228
* self.grammar = new shared_ptr[grammar.Grammar](new grammar.TextGrammar())
* cdef grammar.TextGrammar* _g = <grammar.TextGrammar*> self.grammar.get()
* for trule in rules: # <<<<<<<<<<<<<<
@@ -8886,7 +9048,7 @@ static int __pyx_pf_4cdec_5_cdec_11TextGrammar___init__(struct __pyx_obj_4cdec_5
__pyx_t_1 = __pyx_v_rules; __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_rules); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_rules); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -8894,23 +9056,23 @@ static int __pyx_pf_4cdec_5_cdec_11TextGrammar___init__(struct __pyx_obj_4cdec_5
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[2]; __pyx_lineno = 222; __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[2]; __pyx_lineno = 228; __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[2]; __pyx_lineno = 222; __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[2]; __pyx_lineno = 228; __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[2]; __pyx_lineno = 222; __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[2]; __pyx_lineno = 228; __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[2]; __pyx_lineno = 222; __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[2]; __pyx_lineno = 228; __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[2]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -8920,7 +9082,7 @@ static int __pyx_pf_4cdec_5_cdec_11TextGrammar___init__(struct __pyx_obj_4cdec_5
__pyx_v_trule = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":223
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":229
* cdef grammar.TextGrammar* _g = <grammar.TextGrammar*> self.grammar.get()
* for trule in rules:
* if isinstance(trule, _sa.Rule): # <<<<<<<<<<<<<<
@@ -8931,15 +9093,15 @@ static int __pyx_pf_4cdec_5_cdec_11TextGrammar___init__(struct __pyx_obj_4cdec_5
__pyx_t_6 = (__pyx_t_5 != 0);
if (__pyx_t_6) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":224
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":230
* for trule in rules:
* if isinstance(trule, _sa.Rule):
* trule = convert_rule(trule) # <<<<<<<<<<<<<<
* elif not isinstance(trule, TRule):
* raise ValueError('the grammar should contain TRule objects')
*/
- if (!(likely(((__pyx_v_trule) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_trule, __pyx_ptype_4cdec_2sa_3_sa_Rule))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = ((PyObject *)__pyx_f_4cdec_5_cdec_convert_rule(((struct __pyx_obj_4cdec_2sa_3_sa_Rule *)__pyx_v_trule))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_v_trule) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_trule, __pyx_ptype_4cdec_2sa_3_sa_Rule))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = ((PyObject *)__pyx_f_4cdec_5_cdec_convert_rule(((struct __pyx_obj_4cdec_2sa_3_sa_Rule *)__pyx_v_trule))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_v_trule);
__pyx_v_trule = __pyx_t_4;
@@ -8947,7 +9109,7 @@ static int __pyx_pf_4cdec_5_cdec_11TextGrammar___init__(struct __pyx_obj_4cdec_5
goto __pyx_L5;
}
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":225
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":231
* if isinstance(trule, _sa.Rule):
* trule = convert_rule(trule)
* elif not isinstance(trule, TRule): # <<<<<<<<<<<<<<
@@ -8958,22 +9120,22 @@ static int __pyx_pf_4cdec_5_cdec_11TextGrammar___init__(struct __pyx_obj_4cdec_5
__pyx_t_5 = ((!(__pyx_t_6 != 0)) != 0);
if (__pyx_t_5) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":226
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":232
* trule = convert_rule(trule)
* elif not isinstance(trule, TRule):
* raise ValueError('the grammar should contain TRule objects') # <<<<<<<<<<<<<<
* _g.AddRule((<TRule> trule).rule[0])
*/
- __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_14), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_14), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[2]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L5;
}
__pyx_L5:;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":227
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":233
* elif not isinstance(trule, TRule):
* raise ValueError('the grammar should contain TRule objects')
* _g.AddRule((<TRule> trule).rule[0]) # <<<<<<<<<<<<<<
@@ -9004,7 +9166,7 @@ static void __pyx_pw_4cdec_5_cdec_10Hypergraph_1__dealloc__(PyObject *__pyx_v_se
__Pyx_RefNannyFinishContext();
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":8
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":8
* cdef MT19937* rng
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -9017,7 +9179,7 @@ static void __pyx_pf_4cdec_5_cdec_10Hypergraph___dealloc__(struct __pyx_obj_4cde
int __pyx_t_1;
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":9
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":9
*
* def __dealloc__(self):
* del self.hg # <<<<<<<<<<<<<<
@@ -9026,7 +9188,7 @@ static void __pyx_pf_4cdec_5_cdec_10Hypergraph___dealloc__(struct __pyx_obj_4cde
*/
delete __pyx_v_self->hg;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":10
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":10
* def __dealloc__(self):
* del self.hg
* if self.rng != NULL: # <<<<<<<<<<<<<<
@@ -9036,7 +9198,7 @@ static void __pyx_pf_4cdec_5_cdec_10Hypergraph___dealloc__(struct __pyx_obj_4cde
__pyx_t_1 = ((__pyx_v_self->rng != NULL) != 0);
if (__pyx_t_1) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":11
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":11
* del self.hg
* if self.rng != NULL:
* del self.rng # <<<<<<<<<<<<<<
@@ -9051,7 +9213,7 @@ static void __pyx_pf_4cdec_5_cdec_10Hypergraph___dealloc__(struct __pyx_obj_4cde
__Pyx_RefNannyFinishContext();
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":13
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":13
* del self.rng
*
* cdef MT19937* _rng(self): # <<<<<<<<<<<<<<
@@ -9069,7 +9231,7 @@ static MT19937 *__pyx_f_4cdec_5_cdec_10Hypergraph__rng(struct __pyx_obj_4cdec_5_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_rng", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":14
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":14
*
* cdef MT19937* _rng(self):
* if self.rng == NULL: # <<<<<<<<<<<<<<
@@ -9079,7 +9241,7 @@ static MT19937 *__pyx_f_4cdec_5_cdec_10Hypergraph__rng(struct __pyx_obj_4cdec_5_
__pyx_t_1 = ((__pyx_v_self->rng == NULL) != 0);
if (__pyx_t_1) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":15
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":15
* cdef MT19937* _rng(self):
* if self.rng == NULL:
* self.rng = new MT19937() # <<<<<<<<<<<<<<
@@ -9097,7 +9259,7 @@ static MT19937 *__pyx_f_4cdec_5_cdec_10Hypergraph__rng(struct __pyx_obj_4cdec_5_
}
__pyx_L3:;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":16
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":16
* if self.rng == NULL:
* self.rng = new MT19937()
* return self.rng # <<<<<<<<<<<<<<
@@ -9129,7 +9291,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_3viterbi(PyObject *__pyx_v_s
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":18
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":18
* return self.rng
*
* def viterbi(self): # <<<<<<<<<<<<<<
@@ -9148,7 +9310,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_2viterbi(struct __pyx_obj_4c
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("viterbi", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":21
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":21
* """hg.viterbi() -> String for the best hypothesis in the hypergraph."""
* cdef vector[WordID] trans
* hypergraph.ViterbiESentence(self.hg[0], &trans) # <<<<<<<<<<<<<<
@@ -9157,7 +9319,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_2viterbi(struct __pyx_obj_4c
*/
ViterbiESentence((__pyx_v_self->hg[0]), (&__pyx_v_trans));
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":22
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":22
* cdef vector[WordID] trans
* hypergraph.ViterbiESentence(self.hg[0], &trans)
* return unicode(GetString(trans).c_str(), 'utf8') # <<<<<<<<<<<<<<
@@ -9207,7 +9369,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_5viterbi_trees(PyObject *__p
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":24
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":24
* return unicode(GetString(trans).c_str(), 'utf8')
*
* def viterbi_trees(self): # <<<<<<<<<<<<<<
@@ -9227,7 +9389,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_4viterbi_trees(struct __pyx_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("viterbi_trees", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":29
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":29
* e_tree: Target tree for the best hypothesis in the hypergraph.
* """
* f_tree = unicode(hypergraph.ViterbiFTree(self.hg[0]).c_str(), 'utf8') # <<<<<<<<<<<<<<
@@ -9250,7 +9412,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_4viterbi_trees(struct __pyx_
__pyx_v_f_tree = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":30
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":30
* """
* f_tree = unicode(hypergraph.ViterbiFTree(self.hg[0]).c_str(), 'utf8')
* e_tree = unicode(hypergraph.ViterbiETree(self.hg[0]).c_str(), 'utf8') # <<<<<<<<<<<<<<
@@ -9273,7 +9435,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_4viterbi_trees(struct __pyx_
__pyx_v_e_tree = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":31
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":31
* f_tree = unicode(hypergraph.ViterbiFTree(self.hg[0]).c_str(), 'utf8')
* e_tree = unicode(hypergraph.ViterbiETree(self.hg[0]).c_str(), 'utf8')
* return (f_tree, e_tree) # <<<<<<<<<<<<<<
@@ -9320,7 +9482,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_7viterbi_features(PyObject *
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":33
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":33
* return (f_tree, e_tree)
*
* def viterbi_features(self): # <<<<<<<<<<<<<<
@@ -9338,7 +9500,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_6viterbi_features(struct __p
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("viterbi_features", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":36
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":36
* """hg.viterbi_features() -> SparseVector with the features corresponding
* to the best derivation in the hypergraph."""
* cdef SparseVector fmap = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<<
@@ -9351,7 +9513,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_6viterbi_features(struct __p
__pyx_v_fmap = ((struct __pyx_obj_4cdec_5_cdec_SparseVector *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":37
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":37
* to the best derivation in the hypergraph."""
* cdef SparseVector fmap = SparseVector.__new__(SparseVector)
* fmap.vector = new FastSparseVector[weight_t](hypergraph.ViterbiFeatures(self.hg[0])) # <<<<<<<<<<<<<<
@@ -9360,7 +9522,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_6viterbi_features(struct __p
*/
__pyx_v_fmap->vector = new FastSparseVector<weight_t>(ViterbiFeatures((__pyx_v_self->hg[0])));
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":38
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":38
* cdef SparseVector fmap = SparseVector.__new__(SparseVector)
* fmap.vector = new FastSparseVector[weight_t](hypergraph.ViterbiFeatures(self.hg[0]))
* return fmap # <<<<<<<<<<<<<<
@@ -9396,7 +9558,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_9viterbi_forest(PyObject *__
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":40
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":40
* return fmap
*
* def viterbi_forest(self): # <<<<<<<<<<<<<<
@@ -9414,7 +9576,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_8viterbi_forest(struct __pyx
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("viterbi_forest", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":41
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":41
*
* def viterbi_forest(self):
* cdef Hypergraph hg = Hypergraph() # <<<<<<<<<<<<<<
@@ -9426,7 +9588,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_8viterbi_forest(struct __pyx
__pyx_v_hg = ((struct __pyx_obj_4cdec_5_cdec_Hypergraph *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":42
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":42
* def viterbi_forest(self):
* cdef Hypergraph hg = Hypergraph()
* hg.hg = new hypergraph.Hypergraph(self.hg[0].CreateViterbiHypergraph(NULL).get()[0]) # <<<<<<<<<<<<<<
@@ -9435,7 +9597,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_8viterbi_forest(struct __pyx
*/
__pyx_v_hg->hg = new Hypergraph(((__pyx_v_self->hg[0]).CreateViterbiHypergraph(NULL).get()[0]));
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":43
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":43
* cdef Hypergraph hg = Hypergraph()
* hg.hg = new hypergraph.Hypergraph(self.hg[0].CreateViterbiHypergraph(NULL).get()[0])
* return hg # <<<<<<<<<<<<<<
@@ -9472,7 +9634,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_11viterbi_joshua(PyObject *_
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":45
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":45
* return hg
*
* def viterbi_joshua(self): # <<<<<<<<<<<<<<
@@ -9490,7 +9652,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_10viterbi_joshua(struct __py
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("viterbi_joshua", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":47
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":47
* def viterbi_joshua(self):
* """hg.viterbi_joshua() -> Joshua representation of the best derivation."""
* return unicode(hypergraph.JoshuaVisualizationString(self.hg[0]).c_str(), 'utf8') # <<<<<<<<<<<<<<
@@ -9541,12 +9703,12 @@ static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_13kbest(PyObject *__pyx_v_se
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":49
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":49
* return unicode(hypergraph.JoshuaVisualizationString(self.hg[0]).c_str(), 'utf8')
*
* def kbest(self, size): # <<<<<<<<<<<<<<
* """hg.kbest(size) -> List of k-best hypotheses in the hypergraph."""
- * cdef kbest.KBestDerivations[vector[WordID], kbest.ESentenceTraversal]* derivations = new kbest.KBestDerivations[vector[WordID], kbest.ESentenceTraversal](self.hg[0], size)
+ * cdef kbest.KBestDerivations[vector[WordID], kbest.ESentenceTraversal, kbest.NoFilter[vector[int]]]* derivations = new kbest.KBestDerivations[vector[WordID], kbest.ESentenceTraversal, kbest.NoFilter[vector[int]]](self.hg[0], size)
*/
static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_12kbest(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self, PyObject *__pyx_v_size) {
@@ -9612,18 +9774,18 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_14generator4(__pyx_Generator
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":51
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":51
* def kbest(self, size):
* """hg.kbest(size) -> List of k-best hypotheses in the hypergraph."""
- * cdef kbest.KBestDerivations[vector[WordID], kbest.ESentenceTraversal]* derivations = new kbest.KBestDerivations[vector[WordID], kbest.ESentenceTraversal](self.hg[0], size) # <<<<<<<<<<<<<<
- * cdef kbest.KBestDerivations[vector[WordID], kbest.ESentenceTraversal].Derivation* derivation
+ * cdef kbest.KBestDerivations[vector[WordID], kbest.ESentenceTraversal, kbest.NoFilter[vector[int]]]* derivations = new kbest.KBestDerivations[vector[WordID], kbest.ESentenceTraversal, kbest.NoFilter[vector[int]]](self.hg[0], size) # <<<<<<<<<<<<<<
+ * cdef kbest.KBestDerivations[vector[WordID], kbest.ESentenceTraversal, kbest.NoFilter[vector[int]]].Derivation* derivation
* cdef unsigned k
*/
__pyx_t_1 = __Pyx_PyInt_AsUnsignedInt(__pyx_cur_scope->__pyx_v_size); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_cur_scope->__pyx_v_derivations = new KBest::KBestDerivations<std::vector<WordID>,ESentenceTraversal>((__pyx_cur_scope->__pyx_v_self->hg[0]), __pyx_t_1);
+ __pyx_cur_scope->__pyx_v_derivations = new KBest::KBestDerivations<std::vector<WordID>,ESentenceTraversal,KBest::NoFilter<std::vector<int> > >((__pyx_cur_scope->__pyx_v_self->hg[0]), __pyx_t_1);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":54
- * cdef kbest.KBestDerivations[vector[WordID], kbest.ESentenceTraversal].Derivation* derivation
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":54
+ * cdef kbest.KBestDerivations[vector[WordID], kbest.ESentenceTraversal, kbest.NoFilter[vector[int]]].Derivation* derivation
* cdef unsigned k
* try: # <<<<<<<<<<<<<<
* for k in range(size):
@@ -9631,7 +9793,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_14generator4(__pyx_Generator
*/
/*try:*/ {
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":55
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":55
* cdef unsigned k
* try:
* for k in range(size): # <<<<<<<<<<<<<<
@@ -9642,7 +9804,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_14generator4(__pyx_Generator
for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_2; __pyx_t_1+=1) {
__pyx_cur_scope->__pyx_v_k = __pyx_t_1;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":56
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":56
* try:
* for k in range(size):
* derivation = derivations.LazyKthBest(self.hg.nodes_.size() - 1, k) # <<<<<<<<<<<<<<
@@ -9651,7 +9813,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_14generator4(__pyx_Generator
*/
__pyx_cur_scope->__pyx_v_derivation = __pyx_cur_scope->__pyx_v_derivations->LazyKthBest((__pyx_cur_scope->__pyx_v_self->hg->nodes_.size() - 1), __pyx_cur_scope->__pyx_v_k);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":57
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":57
* for k in range(size):
* derivation = derivations.LazyKthBest(self.hg.nodes_.size() - 1, k)
* if not derivation: break # <<<<<<<<<<<<<<
@@ -9665,7 +9827,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_14generator4(__pyx_Generator
}
__pyx_L9:;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":58
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":58
* derivation = derivations.LazyKthBest(self.hg.nodes_.size() - 1, k)
* if not derivation: break
* yield unicode(GetString(derivation._yield).c_str(), 'utf8') # <<<<<<<<<<<<<<
@@ -9702,7 +9864,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_14generator4(__pyx_Generator
__pyx_L8_break:;
}
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":60
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":60
* yield unicode(GetString(derivation._yield).c_str(), 'utf8')
* finally:
* del derivations # <<<<<<<<<<<<<<
@@ -9753,7 +9915,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_17generator5(__pyx_Generator
/* Python wrapper */
static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_16kbest_trees(PyObject *__pyx_v_self, PyObject *__pyx_v_size); /*proto*/
-static char __pyx_doc_4cdec_5_cdec_10Hypergraph_15kbest_trees[] = "hg.kbest_trees(size) -> List of k-best trees in the hypergraph.";
+static char __pyx_doc_4cdec_5_cdec_10Hypergraph_15kbest_trees[] = "hg.kbest_trees(size) -> List of k-best trees in the hypergrapt.NoFilter.";
static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_16kbest_trees(PyObject *__pyx_v_self, PyObject *__pyx_v_size) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
@@ -9763,12 +9925,12 @@ static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_16kbest_trees(PyObject *__py
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":62
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":62
* del derivations
*
* def kbest_trees(self, size): # <<<<<<<<<<<<<<
- * """hg.kbest_trees(size) -> List of k-best trees in the hypergraph."""
- * cdef kbest.KBestDerivations[vector[WordID], kbest.FTreeTraversal]* f_derivations = new kbest.KBestDerivations[vector[WordID], kbest.FTreeTraversal](self.hg[0], size)
+ * """hg.kbest_trees(size) -> List of k-best trees in the hypergrapt.NoFilter."""
+ * cdef kbest.KBestDerivations[vector[WordID], kbest.FTreeTraversal, kbest.NoFilter[vector[int]]]* f_derivations = new kbest.KBestDerivations[vector[WordID], kbest.FTreeTraversal, kbest.NoFilter[vector[int]]](self.hg[0], size)
*/
static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_15kbest_trees(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self, PyObject *__pyx_v_size) {
@@ -9836,28 +9998,28 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_17generator5(__pyx_Generator
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":64
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":64
* def kbest_trees(self, size):
- * """hg.kbest_trees(size) -> List of k-best trees in the hypergraph."""
- * cdef kbest.KBestDerivations[vector[WordID], kbest.FTreeTraversal]* f_derivations = new kbest.KBestDerivations[vector[WordID], kbest.FTreeTraversal](self.hg[0], size) # <<<<<<<<<<<<<<
- * cdef kbest.KBestDerivations[vector[WordID], kbest.FTreeTraversal].Derivation* f_derivation
- * cdef kbest.KBestDerivations[vector[WordID], kbest.ETreeTraversal]* e_derivations = new kbest.KBestDerivations[vector[WordID], kbest.ETreeTraversal](self.hg[0], size)
+ * """hg.kbest_trees(size) -> List of k-best trees in the hypergrapt.NoFilter."""
+ * cdef kbest.KBestDerivations[vector[WordID], kbest.FTreeTraversal, kbest.NoFilter[vector[int]]]* f_derivations = new kbest.KBestDerivations[vector[WordID], kbest.FTreeTraversal, kbest.NoFilter[vector[int]]](self.hg[0], size) # <<<<<<<<<<<<<<
+ * cdef kbest.KBestDerivations[vector[WordID], kbest.FTreeTraversal, kbest.NoFilter[vector[int]]].Derivation* f_derivation
+ * cdef kbest.KBestDerivations[vector[WordID], kbest.ETreeTraversal, kbest.NoFilter[vector[int]]]* e_derivations = new kbest.KBestDerivations[vector[WordID], kbest.ETreeTraversal, kbest.NoFilter[vector[int]]](self.hg[0], size)
*/
__pyx_t_1 = __Pyx_PyInt_AsUnsignedInt(__pyx_cur_scope->__pyx_v_size); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_cur_scope->__pyx_v_f_derivations = new KBest::KBestDerivations<std::vector<WordID>,FTreeTraversal>((__pyx_cur_scope->__pyx_v_self->hg[0]), __pyx_t_1);
+ __pyx_cur_scope->__pyx_v_f_derivations = new KBest::KBestDerivations<std::vector<WordID>,FTreeTraversal,KBest::NoFilter<std::vector<int> > >((__pyx_cur_scope->__pyx_v_self->hg[0]), __pyx_t_1);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":66
- * cdef kbest.KBestDerivations[vector[WordID], kbest.FTreeTraversal]* f_derivations = new kbest.KBestDerivations[vector[WordID], kbest.FTreeTraversal](self.hg[0], size)
- * cdef kbest.KBestDerivations[vector[WordID], kbest.FTreeTraversal].Derivation* f_derivation
- * cdef kbest.KBestDerivations[vector[WordID], kbest.ETreeTraversal]* e_derivations = new kbest.KBestDerivations[vector[WordID], kbest.ETreeTraversal](self.hg[0], size) # <<<<<<<<<<<<<<
- * cdef kbest.KBestDerivations[vector[WordID], kbest.ETreeTraversal].Derivation* e_derivation
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":66
+ * cdef kbest.KBestDerivations[vector[WordID], kbest.FTreeTraversal, kbest.NoFilter[vector[int]]]* f_derivations = new kbest.KBestDerivations[vector[WordID], kbest.FTreeTraversal, kbest.NoFilter[vector[int]]](self.hg[0], size)
+ * cdef kbest.KBestDerivations[vector[WordID], kbest.FTreeTraversal, kbest.NoFilter[vector[int]]].Derivation* f_derivation
+ * cdef kbest.KBestDerivations[vector[WordID], kbest.ETreeTraversal, kbest.NoFilter[vector[int]]]* e_derivations = new kbest.KBestDerivations[vector[WordID], kbest.ETreeTraversal, kbest.NoFilter[vector[int]]](self.hg[0], size) # <<<<<<<<<<<<<<
+ * cdef kbest.KBestDerivations[vector[WordID], kbest.ETreeTraversal, kbest.NoFilter[vector[int]]].Derivation* e_derivation
* cdef unsigned k
*/
__pyx_t_1 = __Pyx_PyInt_AsUnsignedInt(__pyx_cur_scope->__pyx_v_size); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_cur_scope->__pyx_v_e_derivations = new KBest::KBestDerivations<std::vector<WordID>,ETreeTraversal>((__pyx_cur_scope->__pyx_v_self->hg[0]), __pyx_t_1);
+ __pyx_cur_scope->__pyx_v_e_derivations = new KBest::KBestDerivations<std::vector<WordID>,ETreeTraversal,KBest::NoFilter<std::vector<int> > >((__pyx_cur_scope->__pyx_v_self->hg[0]), __pyx_t_1);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":69
- * cdef kbest.KBestDerivations[vector[WordID], kbest.ETreeTraversal].Derivation* e_derivation
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":69
+ * cdef kbest.KBestDerivations[vector[WordID], kbest.ETreeTraversal, kbest.NoFilter[vector[int]]].Derivation* e_derivation
* cdef unsigned k
* try: # <<<<<<<<<<<<<<
* for k in range(size):
@@ -9865,7 +10027,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_17generator5(__pyx_Generator
*/
/*try:*/ {
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":70
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":70
* cdef unsigned k
* try:
* for k in range(size): # <<<<<<<<<<<<<<
@@ -9876,7 +10038,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_17generator5(__pyx_Generator
for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_2; __pyx_t_1+=1) {
__pyx_cur_scope->__pyx_v_k = __pyx_t_1;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":71
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":71
* try:
* for k in range(size):
* f_derivation = f_derivations.LazyKthBest(self.hg.nodes_.size() - 1, k) # <<<<<<<<<<<<<<
@@ -9885,7 +10047,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_17generator5(__pyx_Generator
*/
__pyx_cur_scope->__pyx_v_f_derivation = __pyx_cur_scope->__pyx_v_f_derivations->LazyKthBest((__pyx_cur_scope->__pyx_v_self->hg->nodes_.size() - 1), __pyx_cur_scope->__pyx_v_k);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":72
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":72
* for k in range(size):
* f_derivation = f_derivations.LazyKthBest(self.hg.nodes_.size() - 1, k)
* e_derivation = e_derivations.LazyKthBest(self.hg.nodes_.size() - 1, k) # <<<<<<<<<<<<<<
@@ -9894,7 +10056,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_17generator5(__pyx_Generator
*/
__pyx_cur_scope->__pyx_v_e_derivation = __pyx_cur_scope->__pyx_v_e_derivations->LazyKthBest((__pyx_cur_scope->__pyx_v_self->hg->nodes_.size() - 1), __pyx_cur_scope->__pyx_v_k);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":73
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":73
* f_derivation = f_derivations.LazyKthBest(self.hg.nodes_.size() - 1, k)
* e_derivation = e_derivations.LazyKthBest(self.hg.nodes_.size() - 1, k)
* if not f_derivation or not e_derivation: break # <<<<<<<<<<<<<<
@@ -9914,7 +10076,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_17generator5(__pyx_Generator
}
__pyx_L9:;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":74
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":74
* e_derivation = e_derivations.LazyKthBest(self.hg.nodes_.size() - 1, k)
* if not f_derivation or not e_derivation: break
* f_tree = unicode(GetString(f_derivation._yield).c_str(), 'utf8') # <<<<<<<<<<<<<<
@@ -9940,7 +10102,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_17generator5(__pyx_Generator
__pyx_cur_scope->__pyx_v_f_tree = ((PyObject*)__pyx_t_6);
__pyx_t_6 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":75
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":75
* if not f_derivation or not e_derivation: break
* f_tree = unicode(GetString(f_derivation._yield).c_str(), 'utf8')
* e_tree = unicode(GetString(e_derivation._yield).c_str(), 'utf8') # <<<<<<<<<<<<<<
@@ -9966,7 +10128,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_17generator5(__pyx_Generator
__pyx_cur_scope->__pyx_v_e_tree = ((PyObject*)__pyx_t_6);
__pyx_t_6 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":76
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":76
* f_tree = unicode(GetString(f_derivation._yield).c_str(), 'utf8')
* e_tree = unicode(GetString(e_derivation._yield).c_str(), 'utf8')
* yield (f_tree, e_tree) # <<<<<<<<<<<<<<
@@ -9998,7 +10160,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_17generator5(__pyx_Generator
__pyx_L8_break:;
}
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":78
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":78
* yield (f_tree, e_tree)
* finally:
* del f_derivations # <<<<<<<<<<<<<<
@@ -10022,7 +10184,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_17generator5(__pyx_Generator
__pyx_L6:;
delete __pyx_cur_scope->__pyx_v_f_derivations;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":79
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":79
* finally:
* del f_derivations
* del e_derivations # <<<<<<<<<<<<<<
@@ -10068,12 +10230,12 @@ static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_19kbest_features(PyObject *_
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":81
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":81
* del e_derivations
*
* def kbest_features(self, size): # <<<<<<<<<<<<<<
* """hg.kbest_trees(size) -> List of k-best feature vectors in the hypergraph."""
- * cdef kbest.KBestDerivations[FastSparseVector[weight_t], kbest.FeatureVectorTraversal]* derivations = new kbest.KBestDerivations[FastSparseVector[weight_t], kbest.FeatureVectorTraversal](self.hg[0], size)
+ * cdef kbest.KBestDerivations[FastSparseVector[weight_t], kbest.FeatureVectorTraversal, kbest.NoFilter[FastSparseVector[double]]]* derivations = new kbest.KBestDerivations[FastSparseVector[weight_t], kbest.FeatureVectorTraversal, kbest.NoFilter[FastSparseVector[double]]](self.hg[0], size)
*/
static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_18kbest_features(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self, PyObject *__pyx_v_size) {
@@ -10138,17 +10300,17 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_20generator6(__pyx_Generator
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":83
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":83
* def kbest_features(self, size):
* """hg.kbest_trees(size) -> List of k-best feature vectors in the hypergraph."""
- * cdef kbest.KBestDerivations[FastSparseVector[weight_t], kbest.FeatureVectorTraversal]* derivations = new kbest.KBestDerivations[FastSparseVector[weight_t], kbest.FeatureVectorTraversal](self.hg[0], size) # <<<<<<<<<<<<<<
- * cdef kbest.KBestDerivations[FastSparseVector[weight_t], kbest.FeatureVectorTraversal].Derivation* derivation
+ * cdef kbest.KBestDerivations[FastSparseVector[weight_t], kbest.FeatureVectorTraversal, kbest.NoFilter[FastSparseVector[double]]]* derivations = new kbest.KBestDerivations[FastSparseVector[weight_t], kbest.FeatureVectorTraversal, kbest.NoFilter[FastSparseVector[double]]](self.hg[0], size) # <<<<<<<<<<<<<<
+ * cdef kbest.KBestDerivations[FastSparseVector[weight_t], kbest.FeatureVectorTraversal, kbest.NoFilter[FastSparseVector[double]]].Derivation* derivation
* cdef SparseVector fmap
*/
__pyx_t_1 = __Pyx_PyInt_AsUnsignedInt(__pyx_cur_scope->__pyx_v_size); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_cur_scope->__pyx_v_derivations = new KBest::KBestDerivations<FastSparseVector<weight_t>,FeatureVectorTraversal>((__pyx_cur_scope->__pyx_v_self->hg[0]), __pyx_t_1);
+ __pyx_cur_scope->__pyx_v_derivations = new KBest::KBestDerivations<FastSparseVector<weight_t>,FeatureVectorTraversal,KBest::NoFilter<FastSparseVector<double> > >((__pyx_cur_scope->__pyx_v_self->hg[0]), __pyx_t_1);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":87
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":87
* cdef SparseVector fmap
* cdef unsigned k
* try: # <<<<<<<<<<<<<<
@@ -10157,7 +10319,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_20generator6(__pyx_Generator
*/
/*try:*/ {
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":88
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":88
* cdef unsigned k
* try:
* for k in range(size): # <<<<<<<<<<<<<<
@@ -10168,7 +10330,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_20generator6(__pyx_Generator
for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_2; __pyx_t_1+=1) {
__pyx_cur_scope->__pyx_v_k = __pyx_t_1;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":89
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":89
* try:
* for k in range(size):
* derivation = derivations.LazyKthBest(self.hg.nodes_.size() - 1, k) # <<<<<<<<<<<<<<
@@ -10177,7 +10339,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_20generator6(__pyx_Generator
*/
__pyx_cur_scope->__pyx_v_derivation = __pyx_cur_scope->__pyx_v_derivations->LazyKthBest((__pyx_cur_scope->__pyx_v_self->hg->nodes_.size() - 1), __pyx_cur_scope->__pyx_v_k);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":90
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":90
* for k in range(size):
* derivation = derivations.LazyKthBest(self.hg.nodes_.size() - 1, k)
* if not derivation: break # <<<<<<<<<<<<<<
@@ -10191,7 +10353,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_20generator6(__pyx_Generator
}
__pyx_L9:;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":91
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":91
* derivation = derivations.LazyKthBest(self.hg.nodes_.size() - 1, k)
* if not derivation: break
* fmap = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<<
@@ -10207,7 +10369,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_20generator6(__pyx_Generator
__pyx_cur_scope->__pyx_v_fmap = ((struct __pyx_obj_4cdec_5_cdec_SparseVector *)__pyx_t_4);
__pyx_t_4 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":92
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":92
* if not derivation: break
* fmap = SparseVector.__new__(SparseVector)
* fmap.vector = new FastSparseVector[weight_t](derivation._yield) # <<<<<<<<<<<<<<
@@ -10216,7 +10378,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_20generator6(__pyx_Generator
*/
__pyx_cur_scope->__pyx_v_fmap->vector = new FastSparseVector<weight_t>(__pyx_cur_scope->__pyx_v_derivation->yield);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":93
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":93
* fmap = SparseVector.__new__(SparseVector)
* fmap.vector = new FastSparseVector[weight_t](derivation._yield)
* yield fmap # <<<<<<<<<<<<<<
@@ -10240,12 +10402,12 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_20generator6(__pyx_Generator
__pyx_L8_break:;
}
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":95
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":95
* yield fmap
* finally:
* del derivations # <<<<<<<<<<<<<<
*
- * def sample(self, unsigned n):
+ * def unique_kbest(self, size):
*/
/*finally:*/ {
int __pyx_why;
@@ -10288,9 +10450,767 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_20generator6(__pyx_Generator
static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_23generator7(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
/* Python wrapper */
-static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_22sample(PyObject *__pyx_v_self, PyObject *__pyx_arg_n); /*proto*/
-static char __pyx_doc_4cdec_5_cdec_10Hypergraph_21sample[] = "hg.sample(n) -> Sample of n hypotheses from the hypergraph.";
-static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_22sample(PyObject *__pyx_v_self, PyObject *__pyx_arg_n) {
+static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_22unique_kbest(PyObject *__pyx_v_self, PyObject *__pyx_v_size); /*proto*/
+static char __pyx_doc_4cdec_5_cdec_10Hypergraph_21unique_kbest[] = "hg.kbest(size) -> List of unique k-best hypotheses in the hypergraph.";
+static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_22unique_kbest(PyObject *__pyx_v_self, PyObject *__pyx_v_size) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("unique_kbest (wrapper)", 0);
+ __pyx_r = __pyx_pf_4cdec_5_cdec_10Hypergraph_21unique_kbest(((struct __pyx_obj_4cdec_5_cdec_Hypergraph *)__pyx_v_self), ((PyObject *)__pyx_v_size));
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":97
+ * del derivations
+ *
+ * def unique_kbest(self, size): # <<<<<<<<<<<<<<
+ * """hg.kbest(size) -> List of unique k-best hypotheses in the hypergraph."""
+ * cdef kbest.KBestDerivations[vector[WordID], kbest.ESentenceTraversal, kbest.FilterUnique]* derivations = new kbest.KBestDerivations[vector[WordID], kbest.ESentenceTraversal, kbest.FilterUnique](self.hg[0], size)
+ */
+
+static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_21unique_kbest(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self, PyObject *__pyx_v_size) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest *__pyx_cur_scope;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("unique_kbest", 0);
+ __pyx_cur_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest *)__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest(__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest, __pyx_empty_tuple, NULL);
+ if (unlikely(!__pyx_cur_scope)) {
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ }
+ __Pyx_GOTREF(__pyx_cur_scope);
+ __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
+ __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
+ __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
+ __pyx_cur_scope->__pyx_v_size = __pyx_v_size;
+ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_size);
+ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_size);
+ {
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_10Hypergraph_23generator7, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_cur_scope);
+ __Pyx_RefNannyFinishContext();
+ return (PyObject *) gen;
+ }
+
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_AddTraceback("cdec._cdec.Hypergraph.unique_kbest", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_23generator7(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+{
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest *__pyx_cur_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest *)__pyx_generator->closure);
+ PyObject *__pyx_r = NULL;
+ unsigned int __pyx_t_1;
+ long __pyx_t_2;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("None", 0);
+ switch (__pyx_generator->resume_label) {
+ case 0: goto __pyx_L3_first_run;
+ case 1: goto __pyx_L10_resume_from_yield;
+ default: /* CPython raises the right error here */
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ }
+ __pyx_L3_first_run:;
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":99
+ * def unique_kbest(self, size):
+ * """hg.kbest(size) -> List of unique k-best hypotheses in the hypergraph."""
+ * cdef kbest.KBestDerivations[vector[WordID], kbest.ESentenceTraversal, kbest.FilterUnique]* derivations = new kbest.KBestDerivations[vector[WordID], kbest.ESentenceTraversal, kbest.FilterUnique](self.hg[0], size) # <<<<<<<<<<<<<<
+ * cdef kbest.KBestDerivations[vector[WordID], kbest.ESentenceTraversal, kbest.FilterUnique].Derivation* derivation
+ * cdef unsigned k
+ */
+ __pyx_t_1 = __Pyx_PyInt_AsUnsignedInt(__pyx_cur_scope->__pyx_v_size); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_cur_scope->__pyx_v_derivations = new KBest::KBestDerivations<std::vector<WordID>,ESentenceTraversal,KBest::FilterUnique>((__pyx_cur_scope->__pyx_v_self->hg[0]), __pyx_t_1);
+
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":102
+ * cdef kbest.KBestDerivations[vector[WordID], kbest.ESentenceTraversal, kbest.FilterUnique].Derivation* derivation
+ * cdef unsigned k
+ * try: # <<<<<<<<<<<<<<
+ * for k in range(size):
+ * derivation = derivations.LazyKthBest(self.hg.nodes_.size() - 1, k)
+ */
+ /*try:*/ {
+
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":103
+ * cdef unsigned k
+ * try:
+ * for k in range(size): # <<<<<<<<<<<<<<
+ * derivation = derivations.LazyKthBest(self.hg.nodes_.size() - 1, k)
+ * if not derivation: break
+ */
+ __pyx_t_2 = __Pyx_PyInt_AsLong(__pyx_cur_scope->__pyx_v_size); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L5;}
+ for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_2; __pyx_t_1+=1) {
+ __pyx_cur_scope->__pyx_v_k = __pyx_t_1;
+
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":104
+ * try:
+ * for k in range(size):
+ * derivation = derivations.LazyKthBest(self.hg.nodes_.size() - 1, k) # <<<<<<<<<<<<<<
+ * if not derivation: break
+ * yield unicode(GetString(derivation._yield).c_str(), 'utf8')
+ */
+ __pyx_cur_scope->__pyx_v_derivation = __pyx_cur_scope->__pyx_v_derivations->LazyKthBest((__pyx_cur_scope->__pyx_v_self->hg->nodes_.size() - 1), __pyx_cur_scope->__pyx_v_k);
+
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":105
+ * for k in range(size):
+ * derivation = derivations.LazyKthBest(self.hg.nodes_.size() - 1, k)
+ * if not derivation: break # <<<<<<<<<<<<<<
+ * yield unicode(GetString(derivation._yield).c_str(), 'utf8')
+ * finally:
+ */
+ __pyx_t_3 = ((!(__pyx_cur_scope->__pyx_v_derivation != 0)) != 0);
+ if (__pyx_t_3) {
+ goto __pyx_L8_break;
+ goto __pyx_L9;
+ }
+ __pyx_L9:;
+
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":106
+ * derivation = derivations.LazyKthBest(self.hg.nodes_.size() - 1, k)
+ * if not derivation: break
+ * yield unicode(GetString(derivation._yield).c_str(), 'utf8') # <<<<<<<<<<<<<<
+ * finally:
+ * del derivations
+ */
+ __pyx_t_4 = __Pyx_PyBytes_FromString(TD::GetString(__pyx_cur_scope->__pyx_v_derivation->yield).c_str()); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L5;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_4));
+ __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L5;}
+ __Pyx_GOTREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4));
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
+ __Pyx_INCREF(((PyObject *)__pyx_n_s__utf8));
+ PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_n_s__utf8));
+ __Pyx_GIVEREF(((PyObject *)__pyx_n_s__utf8));
+ __pyx_t_4 = 0;
+ __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyUnicode_Type))), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L5;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+ __pyx_r = __pyx_t_4;
+ __pyx_t_4 = 0;
+ __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
+ __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ /* return from generator, yielding value */
+ __pyx_generator->resume_label = 1;
+ return __pyx_r;
+ __pyx_L10_resume_from_yield:;
+ __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
+ __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L5;}
+ }
+ __pyx_L8_break:;
+ }
+
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":108
+ * yield unicode(GetString(derivation._yield).c_str(), 'utf8')
+ * finally:
+ * del derivations # <<<<<<<<<<<<<<
+ *
+ * def unique_kbest_trees(self, size):
+ */
+ /*finally:*/ {
+ int __pyx_why;
+ PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
+ int __pyx_exc_lineno;
+ __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
+ __pyx_why = 0; goto __pyx_L6;
+ __pyx_L5: {
+ __pyx_why = 4;
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
+ __pyx_exc_lineno = __pyx_lineno;
+ goto __pyx_L6;
+ }
+ __pyx_L6:;
+ delete __pyx_cur_scope->__pyx_v_derivations;
+ switch (__pyx_why) {
+ case 4: {
+ __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
+ __pyx_lineno = __pyx_exc_lineno;
+ __pyx_exc_type = 0;
+ __pyx_exc_value = 0;
+ __pyx_exc_tb = 0;
+ goto __pyx_L1_error;
+ }
+ }
+ }
+ PyErr_SetNone(PyExc_StopIteration);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("unique_kbest", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_generator->resume_label = -1;
+ __Pyx_Generator_clear((PyObject*)__pyx_generator);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+}
+static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_26generator8(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_25unique_kbest_trees(PyObject *__pyx_v_self, PyObject *__pyx_v_size); /*proto*/
+static char __pyx_doc_4cdec_5_cdec_10Hypergraph_24unique_kbest_trees[] = "hg.kbest_trees(size) -> List of unique k-best trees in the hypergraph.";
+static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_25unique_kbest_trees(PyObject *__pyx_v_self, PyObject *__pyx_v_size) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("unique_kbest_trees (wrapper)", 0);
+ __pyx_r = __pyx_pf_4cdec_5_cdec_10Hypergraph_24unique_kbest_trees(((struct __pyx_obj_4cdec_5_cdec_Hypergraph *)__pyx_v_self), ((PyObject *)__pyx_v_size));
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":110
+ * del derivations
+ *
+ * def unique_kbest_trees(self, size): # <<<<<<<<<<<<<<
+ * """hg.kbest_trees(size) -> List of unique k-best trees in the hypergraph."""
+ * cdef kbest.KBestDerivations[vector[WordID], kbest.FTreeTraversal, kbest.FilterUnique]* f_derivations = new kbest.KBestDerivations[vector[WordID], kbest.FTreeTraversal, kbest.FilterUnique](self.hg[0], size)
+ */
+
+static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_24unique_kbest_trees(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self, PyObject *__pyx_v_size) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees *__pyx_cur_scope;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("unique_kbest_trees", 0);
+ __pyx_cur_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees *)__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees(__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees, __pyx_empty_tuple, NULL);
+ if (unlikely(!__pyx_cur_scope)) {
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ }
+ __Pyx_GOTREF(__pyx_cur_scope);
+ __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
+ __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
+ __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
+ __pyx_cur_scope->__pyx_v_size = __pyx_v_size;
+ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_size);
+ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_size);
+ {
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_10Hypergraph_26generator8, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_cur_scope);
+ __Pyx_RefNannyFinishContext();
+ return (PyObject *) gen;
+ }
+
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_AddTraceback("cdec._cdec.Hypergraph.unique_kbest_trees", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_26generator8(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+{
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees *__pyx_cur_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees *)__pyx_generator->closure);
+ PyObject *__pyx_r = NULL;
+ unsigned int __pyx_t_1;
+ long __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ int __pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("None", 0);
+ switch (__pyx_generator->resume_label) {
+ case 0: goto __pyx_L3_first_run;
+ case 1: goto __pyx_L10_resume_from_yield;
+ default: /* CPython raises the right error here */
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ }
+ __pyx_L3_first_run:;
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":112
+ * def unique_kbest_trees(self, size):
+ * """hg.kbest_trees(size) -> List of unique k-best trees in the hypergraph."""
+ * cdef kbest.KBestDerivations[vector[WordID], kbest.FTreeTraversal, kbest.FilterUnique]* f_derivations = new kbest.KBestDerivations[vector[WordID], kbest.FTreeTraversal, kbest.FilterUnique](self.hg[0], size) # <<<<<<<<<<<<<<
+ * cdef kbest.KBestDerivations[vector[WordID], kbest.FTreeTraversal, kbest.FilterUnique].Derivation* f_derivation
+ * cdef kbest.KBestDerivations[vector[WordID], kbest.ETreeTraversal, kbest.FilterUnique]* e_derivations = new kbest.KBestDerivations[vector[WordID], kbest.ETreeTraversal, kbest.FilterUnique](self.hg[0], size)
+ */
+ __pyx_t_1 = __Pyx_PyInt_AsUnsignedInt(__pyx_cur_scope->__pyx_v_size); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_cur_scope->__pyx_v_f_derivations = new KBest::KBestDerivations<std::vector<WordID>,FTreeTraversal,KBest::FilterUnique>((__pyx_cur_scope->__pyx_v_self->hg[0]), __pyx_t_1);
+
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":114
+ * cdef kbest.KBestDerivations[vector[WordID], kbest.FTreeTraversal, kbest.FilterUnique]* f_derivations = new kbest.KBestDerivations[vector[WordID], kbest.FTreeTraversal, kbest.FilterUnique](self.hg[0], size)
+ * cdef kbest.KBestDerivations[vector[WordID], kbest.FTreeTraversal, kbest.FilterUnique].Derivation* f_derivation
+ * cdef kbest.KBestDerivations[vector[WordID], kbest.ETreeTraversal, kbest.FilterUnique]* e_derivations = new kbest.KBestDerivations[vector[WordID], kbest.ETreeTraversal, kbest.FilterUnique](self.hg[0], size) # <<<<<<<<<<<<<<
+ * cdef kbest.KBestDerivations[vector[WordID], kbest.ETreeTraversal, kbest.FilterUnique].Derivation* e_derivation
+ * cdef unsigned k
+ */
+ __pyx_t_1 = __Pyx_PyInt_AsUnsignedInt(__pyx_cur_scope->__pyx_v_size); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_cur_scope->__pyx_v_e_derivations = new KBest::KBestDerivations<std::vector<WordID>,ETreeTraversal,KBest::FilterUnique>((__pyx_cur_scope->__pyx_v_self->hg[0]), __pyx_t_1);
+
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":117
+ * cdef kbest.KBestDerivations[vector[WordID], kbest.ETreeTraversal, kbest.FilterUnique].Derivation* e_derivation
+ * cdef unsigned k
+ * try: # <<<<<<<<<<<<<<
+ * for k in range(size):
+ * f_derivation = f_derivations.LazyKthBest(self.hg.nodes_.size() - 1, k)
+ */
+ /*try:*/ {
+
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":118
+ * cdef unsigned k
+ * try:
+ * for k in range(size): # <<<<<<<<<<<<<<
+ * f_derivation = f_derivations.LazyKthBest(self.hg.nodes_.size() - 1, k)
+ * e_derivation = e_derivations.LazyKthBest(self.hg.nodes_.size() - 1, k)
+ */
+ __pyx_t_2 = __Pyx_PyInt_AsLong(__pyx_cur_scope->__pyx_v_size); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L5;}
+ for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_2; __pyx_t_1+=1) {
+ __pyx_cur_scope->__pyx_v_k = __pyx_t_1;
+
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":119
+ * try:
+ * for k in range(size):
+ * f_derivation = f_derivations.LazyKthBest(self.hg.nodes_.size() - 1, k) # <<<<<<<<<<<<<<
+ * e_derivation = e_derivations.LazyKthBest(self.hg.nodes_.size() - 1, k)
+ * if not f_derivation or not e_derivation: break
+ */
+ __pyx_cur_scope->__pyx_v_f_derivation = __pyx_cur_scope->__pyx_v_f_derivations->LazyKthBest((__pyx_cur_scope->__pyx_v_self->hg->nodes_.size() - 1), __pyx_cur_scope->__pyx_v_k);
+
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":120
+ * for k in range(size):
+ * f_derivation = f_derivations.LazyKthBest(self.hg.nodes_.size() - 1, k)
+ * e_derivation = e_derivations.LazyKthBest(self.hg.nodes_.size() - 1, k) # <<<<<<<<<<<<<<
+ * if not f_derivation or not e_derivation: break
+ * f_tree = unicode(GetString(f_derivation._yield).c_str(), 'utf8')
+ */
+ __pyx_cur_scope->__pyx_v_e_derivation = __pyx_cur_scope->__pyx_v_e_derivations->LazyKthBest((__pyx_cur_scope->__pyx_v_self->hg->nodes_.size() - 1), __pyx_cur_scope->__pyx_v_k);
+
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":121
+ * f_derivation = f_derivations.LazyKthBest(self.hg.nodes_.size() - 1, k)
+ * e_derivation = e_derivations.LazyKthBest(self.hg.nodes_.size() - 1, k)
+ * if not f_derivation or not e_derivation: break # <<<<<<<<<<<<<<
+ * f_tree = unicode(GetString(f_derivation._yield).c_str(), 'utf8')
+ * e_tree = unicode(GetString(e_derivation._yield).c_str(), 'utf8')
+ */
+ __pyx_t_3 = ((!(__pyx_cur_scope->__pyx_v_f_derivation != 0)) != 0);
+ if (!__pyx_t_3) {
+ __pyx_t_4 = ((!(__pyx_cur_scope->__pyx_v_e_derivation != 0)) != 0);
+ __pyx_t_5 = __pyx_t_4;
+ } else {
+ __pyx_t_5 = __pyx_t_3;
+ }
+ if (__pyx_t_5) {
+ goto __pyx_L8_break;
+ goto __pyx_L9;
+ }
+ __pyx_L9:;
+
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":122
+ * e_derivation = e_derivations.LazyKthBest(self.hg.nodes_.size() - 1, k)
+ * if not f_derivation or not e_derivation: break
+ * f_tree = unicode(GetString(f_derivation._yield).c_str(), 'utf8') # <<<<<<<<<<<<<<
+ * e_tree = unicode(GetString(e_derivation._yield).c_str(), 'utf8')
+ * yield (f_tree, e_tree)
+ */
+ __pyx_t_6 = __Pyx_PyBytes_FromString(TD::GetString(__pyx_cur_scope->__pyx_v_f_derivation->yield).c_str()); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L5;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_6));
+ __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L5;}
+ __Pyx_GOTREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_t_6));
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
+ __Pyx_INCREF(((PyObject *)__pyx_n_s__utf8));
+ PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_n_s__utf8));
+ __Pyx_GIVEREF(((PyObject *)__pyx_n_s__utf8));
+ __pyx_t_6 = 0;
+ __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)(&PyUnicode_Type))), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L5;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
+ __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_f_tree));
+ __Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_f_tree));
+ __Pyx_GIVEREF(__pyx_t_6);
+ __pyx_cur_scope->__pyx_v_f_tree = ((PyObject*)__pyx_t_6);
+ __pyx_t_6 = 0;
+
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":123
+ * if not f_derivation or not e_derivation: break
+ * f_tree = unicode(GetString(f_derivation._yield).c_str(), 'utf8')
+ * e_tree = unicode(GetString(e_derivation._yield).c_str(), 'utf8') # <<<<<<<<<<<<<<
+ * yield (f_tree, e_tree)
+ * finally:
+ */
+ __pyx_t_6 = __Pyx_PyBytes_FromString(TD::GetString(__pyx_cur_scope->__pyx_v_e_derivation->yield).c_str()); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L5;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_6));
+ __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L5;}
+ __Pyx_GOTREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_t_6));
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
+ __Pyx_INCREF(((PyObject *)__pyx_n_s__utf8));
+ PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_n_s__utf8));
+ __Pyx_GIVEREF(((PyObject *)__pyx_n_s__utf8));
+ __pyx_t_6 = 0;
+ __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)(&PyUnicode_Type))), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L5;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
+ __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_e_tree));
+ __Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_e_tree));
+ __Pyx_GIVEREF(__pyx_t_6);
+ __pyx_cur_scope->__pyx_v_e_tree = ((PyObject*)__pyx_t_6);
+ __pyx_t_6 = 0;
+
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":124
+ * f_tree = unicode(GetString(f_derivation._yield).c_str(), 'utf8')
+ * e_tree = unicode(GetString(e_derivation._yield).c_str(), 'utf8')
+ * yield (f_tree, e_tree) # <<<<<<<<<<<<<<
+ * finally:
+ * del f_derivations
+ */
+ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L5;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_f_tree));
+ PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_f_tree));
+ __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_f_tree));
+ __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_e_tree));
+ PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_cur_scope->__pyx_v_e_tree));
+ __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_e_tree));
+ __pyx_r = ((PyObject *)__pyx_t_6);
+ __pyx_t_6 = 0;
+ __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
+ __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ /* return from generator, yielding value */
+ __pyx_generator->resume_label = 1;
+ return __pyx_r;
+ __pyx_L10_resume_from_yield:;
+ __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
+ __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L5;}
+ }
+ __pyx_L8_break:;
+ }
+
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":126
+ * yield (f_tree, e_tree)
+ * finally:
+ * del f_derivations # <<<<<<<<<<<<<<
+ * del e_derivations
+ *
+ */
+ /*finally:*/ {
+ int __pyx_why;
+ PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
+ int __pyx_exc_lineno;
+ __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
+ __pyx_why = 0; goto __pyx_L6;
+ __pyx_L5: {
+ __pyx_why = 4;
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
+ __pyx_exc_lineno = __pyx_lineno;
+ goto __pyx_L6;
+ }
+ __pyx_L6:;
+ delete __pyx_cur_scope->__pyx_v_f_derivations;
+
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":127
+ * finally:
+ * del f_derivations
+ * del e_derivations # <<<<<<<<<<<<<<
+ *
+ * def unique_kbest_features(self, size):
+ */
+ delete __pyx_cur_scope->__pyx_v_e_derivations;
+ switch (__pyx_why) {
+ case 4: {
+ __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
+ __pyx_lineno = __pyx_exc_lineno;
+ __pyx_exc_type = 0;
+ __pyx_exc_value = 0;
+ __pyx_exc_tb = 0;
+ goto __pyx_L1_error;
+ }
+ }
+ }
+ PyErr_SetNone(PyExc_StopIteration);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_AddTraceback("unique_kbest_trees", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_generator->resume_label = -1;
+ __Pyx_Generator_clear((PyObject*)__pyx_generator);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+}
+static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_29generator9(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_28unique_kbest_features(PyObject *__pyx_v_self, PyObject *__pyx_v_size); /*proto*/
+static char __pyx_doc_4cdec_5_cdec_10Hypergraph_27unique_kbest_features[] = "hg.kbest_trees(size) -> List of unique k-best feature vectors in the hypergraph.";
+static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_28unique_kbest_features(PyObject *__pyx_v_self, PyObject *__pyx_v_size) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("unique_kbest_features (wrapper)", 0);
+ __pyx_r = __pyx_pf_4cdec_5_cdec_10Hypergraph_27unique_kbest_features(((struct __pyx_obj_4cdec_5_cdec_Hypergraph *)__pyx_v_self), ((PyObject *)__pyx_v_size));
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":129
+ * del e_derivations
+ *
+ * def unique_kbest_features(self, size): # <<<<<<<<<<<<<<
+ * """hg.kbest_trees(size) -> List of unique k-best feature vectors in the hypergraph."""
+ * cdef kbest.KBestDerivations[FastSparseVector[weight_t], kbest.FeatureVectorTraversal, kbest.NoFilter[FastSparseVector[double]]]* derivations = new kbest.KBestDerivations[FastSparseVector[weight_t], kbest.FeatureVectorTraversal, kbest.NoFilter[FastSparseVector[double]]](self.hg[0], size)
+ */
+
+static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_27unique_kbest_features(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self, PyObject *__pyx_v_size) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features *__pyx_cur_scope;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("unique_kbest_features", 0);
+ __pyx_cur_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features *)__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features(__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features, __pyx_empty_tuple, NULL);
+ if (unlikely(!__pyx_cur_scope)) {
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ }
+ __Pyx_GOTREF(__pyx_cur_scope);
+ __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
+ __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
+ __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
+ __pyx_cur_scope->__pyx_v_size = __pyx_v_size;
+ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_size);
+ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_size);
+ {
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_10Hypergraph_29generator9, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_cur_scope);
+ __Pyx_RefNannyFinishContext();
+ return (PyObject *) gen;
+ }
+
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_AddTraceback("cdec._cdec.Hypergraph.unique_kbest_features", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_29generator9(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+{
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features *__pyx_cur_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features *)__pyx_generator->closure);
+ PyObject *__pyx_r = NULL;
+ unsigned int __pyx_t_1;
+ long __pyx_t_2;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("None", 0);
+ switch (__pyx_generator->resume_label) {
+ case 0: goto __pyx_L3_first_run;
+ case 1: goto __pyx_L10_resume_from_yield;
+ default: /* CPython raises the right error here */
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ }
+ __pyx_L3_first_run:;
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":131
+ * def unique_kbest_features(self, size):
+ * """hg.kbest_trees(size) -> List of unique k-best feature vectors in the hypergraph."""
+ * cdef kbest.KBestDerivations[FastSparseVector[weight_t], kbest.FeatureVectorTraversal, kbest.NoFilter[FastSparseVector[double]]]* derivations = new kbest.KBestDerivations[FastSparseVector[weight_t], kbest.FeatureVectorTraversal, kbest.NoFilter[FastSparseVector[double]]](self.hg[0], size) # <<<<<<<<<<<<<<
+ * cdef kbest.KBestDerivations[FastSparseVector[weight_t], kbest.FeatureVectorTraversal, kbest.NoFilter[FastSparseVector[double]]].Derivation* derivation
+ * cdef SparseVector fmap
+ */
+ __pyx_t_1 = __Pyx_PyInt_AsUnsignedInt(__pyx_cur_scope->__pyx_v_size); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_cur_scope->__pyx_v_derivations = new KBest::KBestDerivations<FastSparseVector<weight_t>,FeatureVectorTraversal,KBest::NoFilter<FastSparseVector<double> > >((__pyx_cur_scope->__pyx_v_self->hg[0]), __pyx_t_1);
+
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":135
+ * cdef SparseVector fmap
+ * cdef unsigned k
+ * try: # <<<<<<<<<<<<<<
+ * for k in range(size):
+ * derivation = derivations.LazyKthBest(self.hg.nodes_.size() - 1, k)
+ */
+ /*try:*/ {
+
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":136
+ * cdef unsigned k
+ * try:
+ * for k in range(size): # <<<<<<<<<<<<<<
+ * derivation = derivations.LazyKthBest(self.hg.nodes_.size() - 1, k)
+ * if not derivation: break
+ */
+ __pyx_t_2 = __Pyx_PyInt_AsLong(__pyx_cur_scope->__pyx_v_size); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L5;}
+ for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_2; __pyx_t_1+=1) {
+ __pyx_cur_scope->__pyx_v_k = __pyx_t_1;
+
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":137
+ * try:
+ * for k in range(size):
+ * derivation = derivations.LazyKthBest(self.hg.nodes_.size() - 1, k) # <<<<<<<<<<<<<<
+ * if not derivation: break
+ * fmap = SparseVector.__new__(SparseVector)
+ */
+ __pyx_cur_scope->__pyx_v_derivation = __pyx_cur_scope->__pyx_v_derivations->LazyKthBest((__pyx_cur_scope->__pyx_v_self->hg->nodes_.size() - 1), __pyx_cur_scope->__pyx_v_k);
+
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":138
+ * for k in range(size):
+ * derivation = derivations.LazyKthBest(self.hg.nodes_.size() - 1, k)
+ * if not derivation: break # <<<<<<<<<<<<<<
+ * fmap = SparseVector.__new__(SparseVector)
+ * fmap.vector = new FastSparseVector[weight_t](derivation._yield)
+ */
+ __pyx_t_3 = ((!(__pyx_cur_scope->__pyx_v_derivation != 0)) != 0);
+ if (__pyx_t_3) {
+ goto __pyx_L8_break;
+ goto __pyx_L9;
+ }
+ __pyx_L9:;
+
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":139
+ * derivation = derivations.LazyKthBest(self.hg.nodes_.size() - 1, k)
+ * if not derivation: break
+ * fmap = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<<
+ * fmap.vector = new FastSparseVector[weight_t](derivation._yield)
+ * yield fmap
+ */
+ __pyx_t_4 = __pyx_tp_new_4cdec_5_cdec_SparseVector(((PyTypeObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_SparseVector)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L5;}
+ __Pyx_GOTREF(__pyx_t_4);
+ if (!(likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4cdec_5_cdec_SparseVector)))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L5;}
+ __Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_fmap));
+ __Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_fmap));
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_cur_scope->__pyx_v_fmap = ((struct __pyx_obj_4cdec_5_cdec_SparseVector *)__pyx_t_4);
+ __pyx_t_4 = 0;
+
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":140
+ * if not derivation: break
+ * fmap = SparseVector.__new__(SparseVector)
+ * fmap.vector = new FastSparseVector[weight_t](derivation._yield) # <<<<<<<<<<<<<<
+ * yield fmap
+ * finally:
+ */
+ __pyx_cur_scope->__pyx_v_fmap->vector = new FastSparseVector<weight_t>(__pyx_cur_scope->__pyx_v_derivation->yield);
+
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":141
+ * fmap = SparseVector.__new__(SparseVector)
+ * fmap.vector = new FastSparseVector[weight_t](derivation._yield)
+ * yield fmap # <<<<<<<<<<<<<<
+ * finally:
+ * del derivations
+ */
+ __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_fmap));
+ __pyx_r = ((PyObject *)__pyx_cur_scope->__pyx_v_fmap);
+ __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
+ __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ /* return from generator, yielding value */
+ __pyx_generator->resume_label = 1;
+ return __pyx_r;
+ __pyx_L10_resume_from_yield:;
+ __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
+ __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L5;}
+ }
+ __pyx_L8_break:;
+ }
+
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":143
+ * yield fmap
+ * finally:
+ * del derivations # <<<<<<<<<<<<<<
+ *
+ * def sample(self, unsigned n):
+ */
+ /*finally:*/ {
+ int __pyx_why;
+ PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
+ int __pyx_exc_lineno;
+ __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
+ __pyx_why = 0; goto __pyx_L6;
+ __pyx_L5: {
+ __pyx_why = 4;
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
+ __pyx_exc_lineno = __pyx_lineno;
+ goto __pyx_L6;
+ }
+ __pyx_L6:;
+ delete __pyx_cur_scope->__pyx_v_derivations;
+ switch (__pyx_why) {
+ case 4: {
+ __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
+ __pyx_lineno = __pyx_exc_lineno;
+ __pyx_exc_type = 0;
+ __pyx_exc_value = 0;
+ __pyx_exc_tb = 0;
+ goto __pyx_L1_error;
+ }
+ }
+ }
+ PyErr_SetNone(PyExc_StopIteration);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_AddTraceback("unique_kbest_features", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_generator->resume_label = -1;
+ __Pyx_Generator_clear((PyObject*)__pyx_generator);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+}
+static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_32generator10(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_31sample(PyObject *__pyx_v_self, PyObject *__pyx_arg_n); /*proto*/
+static char __pyx_doc_4cdec_5_cdec_10Hypergraph_30sample[] = "hg.sample(n) -> Sample of n hypotheses from the hypergraph.";
+static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_31sample(PyObject *__pyx_v_self, PyObject *__pyx_arg_n) {
unsigned int __pyx_v_n;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
@@ -10299,7 +11219,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_22sample(PyObject *__pyx_v_s
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("sample (wrapper)", 0);
assert(__pyx_arg_n); {
- __pyx_v_n = __Pyx_PyInt_AsUnsignedInt(__pyx_arg_n); if (unlikely((__pyx_v_n == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_n = __Pyx_PyInt_AsUnsignedInt(__pyx_arg_n); if (unlikely((__pyx_v_n == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
@@ -10307,12 +11227,12 @@ static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_22sample(PyObject *__pyx_v_s
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_4cdec_5_cdec_10Hypergraph_21sample(((struct __pyx_obj_4cdec_5_cdec_Hypergraph *)__pyx_v_self), ((unsigned int)__pyx_v_n));
+ __pyx_r = __pyx_pf_4cdec_5_cdec_10Hypergraph_30sample(((struct __pyx_obj_4cdec_5_cdec_Hypergraph *)__pyx_v_self), ((unsigned int)__pyx_v_n));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":97
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":145
* del derivations
*
* def sample(self, unsigned n): # <<<<<<<<<<<<<<
@@ -10320,15 +11240,15 @@ static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_22sample(PyObject *__pyx_v_s
* cdef vector[hypergraph.Hypothesis]* hypos = new vector[hypergraph.Hypothesis]()
*/
-static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_21sample(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self, unsigned int __pyx_v_n) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_sample *__pyx_cur_scope;
+static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_30sample(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self, unsigned int __pyx_v_n) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14_sample *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("sample", 0);
- __pyx_cur_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_sample *)__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_11_sample(__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_11_sample, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14_sample *)__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_14_sample(__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_14_sample, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__Pyx_RefNannyFinishContext();
return NULL;
@@ -10339,7 +11259,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_21sample(struct __pyx_obj_4c
__Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
__pyx_cur_scope->__pyx_v_n = __pyx_v_n;
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_10Hypergraph_23generator7, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_10Hypergraph_32generator10, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -10357,9 +11277,9 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_21sample(struct __pyx_obj_4c
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_23generator7(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_32generator10(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_sample *__pyx_cur_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_sample *)__pyx_generator->closure);
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14_sample *__pyx_cur_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14_sample *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
std::vector<HypergraphSampler::Hypothesis> *__pyx_t_1;
size_t __pyx_t_2;
@@ -10379,9 +11299,9 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_23generator7(__pyx_Generator
return NULL;
}
__pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":99
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":147
* def sample(self, unsigned n):
* """hg.sample(n) -> Sample of n hypotheses from the hypergraph."""
* cdef vector[hypergraph.Hypothesis]* hypos = new vector[hypergraph.Hypothesis]() # <<<<<<<<<<<<<<
@@ -10392,11 +11312,11 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_23generator7(__pyx_Generator
__pyx_t_1 = new std::vector<HypergraphSampler::Hypothesis>();
} catch(...) {
__Pyx_CppExn2PyErr();
- {__pyx_filename = __pyx_f[3]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[3]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_cur_scope->__pyx_v_hypos = __pyx_t_1;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":100
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":148
* """hg.sample(n) -> Sample of n hypotheses from the hypergraph."""
* cdef vector[hypergraph.Hypothesis]* hypos = new vector[hypergraph.Hypothesis]()
* hypergraph.sample_hypotheses(self.hg[0], n, self._rng(), hypos) # <<<<<<<<<<<<<<
@@ -10405,7 +11325,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_23generator7(__pyx_Generator
*/
HypergraphSampler::sample_hypotheses((__pyx_cur_scope->__pyx_v_self->hg[0]), __pyx_cur_scope->__pyx_v_n, ((struct __pyx_vtabstruct_4cdec_5_cdec_Hypergraph *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->_rng(__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_hypos);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":102
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":150
* hypergraph.sample_hypotheses(self.hg[0], n, self._rng(), hypos)
* cdef unsigned k
* try: # <<<<<<<<<<<<<<
@@ -10414,7 +11334,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_23generator7(__pyx_Generator
*/
/*try:*/ {
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":103
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":151
* cdef unsigned k
* try:
* for k in range(hypos.size()): # <<<<<<<<<<<<<<
@@ -10425,16 +11345,16 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_23generator7(__pyx_Generator
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_cur_scope->__pyx_v_k = __pyx_t_3;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":104
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":152
* try:
* for k in range(hypos.size()):
* yield unicode(GetString(hypos[0][k].words).c_str(), 'utf8') # <<<<<<<<<<<<<<
* finally:
* del hypos
*/
- __pyx_t_4 = __Pyx_PyBytes_FromString(TD::GetString(((__pyx_cur_scope->__pyx_v_hypos[0])[__pyx_cur_scope->__pyx_v_k]).words).c_str()); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L5;}
+ __pyx_t_4 = __Pyx_PyBytes_FromString(TD::GetString(((__pyx_cur_scope->__pyx_v_hypos[0])[__pyx_cur_scope->__pyx_v_k]).words).c_str()); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L5;}
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L5;}
+ __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L5;}
__Pyx_GOTREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4));
__Pyx_GIVEREF(((PyObject *)__pyx_t_4));
@@ -10442,7 +11362,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_23generator7(__pyx_Generator
PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_n_s__utf8));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__utf8));
__pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyUnicode_Type))), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L5;}
+ __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyUnicode_Type))), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L5;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
__pyx_r = __pyx_t_4;
@@ -10457,11 +11377,11 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_23generator7(__pyx_Generator
__pyx_L9_resume_from_yield:;
__pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
__pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L5;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L5;}
}
}
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":106
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":154
* yield unicode(GetString(hypos[0][k].words).c_str(), 'utf8')
* finally:
* del hypos # <<<<<<<<<<<<<<
@@ -10508,12 +11428,12 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_23generator7(__pyx_Generator
__Pyx_RefNannyFinishContext();
return NULL;
}
-static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_26generator8(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_35generator11(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
/* Python wrapper */
-static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_25sample_trees(PyObject *__pyx_v_self, PyObject *__pyx_arg_n); /*proto*/
-static char __pyx_doc_4cdec_5_cdec_10Hypergraph_24sample_trees[] = "hg.sample_trees(n) -> Sample of n trees from the hypergraph.";
-static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_25sample_trees(PyObject *__pyx_v_self, PyObject *__pyx_arg_n) {
+static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_34sample_trees(PyObject *__pyx_v_self, PyObject *__pyx_arg_n); /*proto*/
+static char __pyx_doc_4cdec_5_cdec_10Hypergraph_33sample_trees[] = "hg.sample_trees(n) -> Sample of n trees from the hypergraph.";
+static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_34sample_trees(PyObject *__pyx_v_self, PyObject *__pyx_arg_n) {
unsigned int __pyx_v_n;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
@@ -10522,7 +11442,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_25sample_trees(PyObject *__p
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("sample_trees (wrapper)", 0);
assert(__pyx_arg_n); {
- __pyx_v_n = __Pyx_PyInt_AsUnsignedInt(__pyx_arg_n); if (unlikely((__pyx_v_n == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_n = __Pyx_PyInt_AsUnsignedInt(__pyx_arg_n); if (unlikely((__pyx_v_n == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
@@ -10530,12 +11450,12 @@ static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_25sample_trees(PyObject *__p
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_4cdec_5_cdec_10Hypergraph_24sample_trees(((struct __pyx_obj_4cdec_5_cdec_Hypergraph *)__pyx_v_self), ((unsigned int)__pyx_v_n));
+ __pyx_r = __pyx_pf_4cdec_5_cdec_10Hypergraph_33sample_trees(((struct __pyx_obj_4cdec_5_cdec_Hypergraph *)__pyx_v_self), ((unsigned int)__pyx_v_n));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":108
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":156
* del hypos
*
* def sample_trees(self, unsigned n): # <<<<<<<<<<<<<<
@@ -10543,15 +11463,15 @@ static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_25sample_trees(PyObject *__p
* cdef vector[string]* trees = new vector[string]()
*/
-static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_24sample_trees(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self, unsigned int __pyx_v_n) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_sample_trees *__pyx_cur_scope;
+static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_33sample_trees(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self, unsigned int __pyx_v_n) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15_sample_trees *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("sample_trees", 0);
- __pyx_cur_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_sample_trees *)__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_12_sample_trees(__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_12_sample_trees, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15_sample_trees *)__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_15_sample_trees(__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_15_sample_trees, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__Pyx_RefNannyFinishContext();
return NULL;
@@ -10562,7 +11482,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_24sample_trees(struct __pyx_
__Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
__pyx_cur_scope->__pyx_v_n = __pyx_v_n;
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_10Hypergraph_26generator8, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_10Hypergraph_35generator11, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -10580,9 +11500,9 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_24sample_trees(struct __pyx_
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_26generator8(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_35generator11(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_sample_trees *__pyx_cur_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_sample_trees *)__pyx_generator->closure);
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15_sample_trees *__pyx_cur_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15_sample_trees *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
std::vector<std::string> *__pyx_t_1;
size_t __pyx_t_2;
@@ -10602,9 +11522,9 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_26generator8(__pyx_Generator
return NULL;
}
__pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":110
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":158
* def sample_trees(self, unsigned n):
* """hg.sample_trees(n) -> Sample of n trees from the hypergraph."""
* cdef vector[string]* trees = new vector[string]() # <<<<<<<<<<<<<<
@@ -10615,11 +11535,11 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_26generator8(__pyx_Generator
__pyx_t_1 = new std::vector<std::string>();
} catch(...) {
__Pyx_CppExn2PyErr();
- {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[3]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_cur_scope->__pyx_v_trees = __pyx_t_1;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":111
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":159
* """hg.sample_trees(n) -> Sample of n trees from the hypergraph."""
* cdef vector[string]* trees = new vector[string]()
* hypergraph.sample_trees(self.hg[0], n, self._rng(), trees) # <<<<<<<<<<<<<<
@@ -10628,7 +11548,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_26generator8(__pyx_Generator
*/
HypergraphSampler::sample_trees((__pyx_cur_scope->__pyx_v_self->hg[0]), __pyx_cur_scope->__pyx_v_n, ((struct __pyx_vtabstruct_4cdec_5_cdec_Hypergraph *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->_rng(__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_trees);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":113
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":161
* hypergraph.sample_trees(self.hg[0], n, self._rng(), trees)
* cdef unsigned k
* try: # <<<<<<<<<<<<<<
@@ -10637,7 +11557,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_26generator8(__pyx_Generator
*/
/*try:*/ {
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":114
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":162
* cdef unsigned k
* try:
* for k in range(trees.size()): # <<<<<<<<<<<<<<
@@ -10648,16 +11568,16 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_26generator8(__pyx_Generator
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_cur_scope->__pyx_v_k = __pyx_t_3;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":115
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":163
* try:
* for k in range(trees.size()):
* yield unicode(trees[0][k].c_str(), 'utf8') # <<<<<<<<<<<<<<
* finally:
* del trees
*/
- __pyx_t_4 = __Pyx_PyBytes_FromString(((__pyx_cur_scope->__pyx_v_trees[0])[__pyx_cur_scope->__pyx_v_k]).c_str()); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L5;}
+ __pyx_t_4 = __Pyx_PyBytes_FromString(((__pyx_cur_scope->__pyx_v_trees[0])[__pyx_cur_scope->__pyx_v_k]).c_str()); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L5;}
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L5;}
+ __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L5;}
__Pyx_GOTREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4));
__Pyx_GIVEREF(((PyObject *)__pyx_t_4));
@@ -10665,7 +11585,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_26generator8(__pyx_Generator
PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_n_s__utf8));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__utf8));
__pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyUnicode_Type))), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L5;}
+ __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyUnicode_Type))), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L5;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
__pyx_r = __pyx_t_4;
@@ -10680,11 +11600,11 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_26generator8(__pyx_Generator
__pyx_L9_resume_from_yield:;
__pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
__pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L5;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L5;}
}
}
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":117
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":165
* yield unicode(trees[0][k].c_str(), 'utf8')
* finally:
* del trees # <<<<<<<<<<<<<<
@@ -10733,18 +11653,18 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_26generator8(__pyx_Generator
}
/* Python wrapper */
-static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_28intersect(PyObject *__pyx_v_self, PyObject *__pyx_v_inp); /*proto*/
-static char __pyx_doc_4cdec_5_cdec_10Hypergraph_27intersect[] = "hg.intersect(Lattice/string): Intersect the hypergraph with the provided reference.";
-static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_28intersect(PyObject *__pyx_v_self, PyObject *__pyx_v_inp) {
+static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_37intersect(PyObject *__pyx_v_self, PyObject *__pyx_v_inp); /*proto*/
+static char __pyx_doc_4cdec_5_cdec_10Hypergraph_36intersect[] = "hg.intersect(Lattice/string): Intersect the hypergraph with the provided reference.";
+static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_37intersect(PyObject *__pyx_v_self, PyObject *__pyx_v_inp) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("intersect (wrapper)", 0);
- __pyx_r = __pyx_pf_4cdec_5_cdec_10Hypergraph_27intersect(((struct __pyx_obj_4cdec_5_cdec_Hypergraph *)__pyx_v_self), ((PyObject *)__pyx_v_inp));
+ __pyx_r = __pyx_pf_4cdec_5_cdec_10Hypergraph_36intersect(((struct __pyx_obj_4cdec_5_cdec_Hypergraph *)__pyx_v_self), ((PyObject *)__pyx_v_inp));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":119
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":167
* del trees
*
* def intersect(self, inp): # <<<<<<<<<<<<<<
@@ -10752,7 +11672,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_28intersect(PyObject *__pyx_
* cdef Lattice lat
*/
-static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_27intersect(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self, PyObject *__pyx_v_inp) {
+static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_36intersect(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self, PyObject *__pyx_v_inp) {
struct __pyx_obj_4cdec_5_cdec_Lattice *__pyx_v_lat = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
@@ -10765,7 +11685,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_27intersect(struct __pyx_obj
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("intersect", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":122
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":170
* """hg.intersect(Lattice/string): Intersect the hypergraph with the provided reference."""
* cdef Lattice lat
* if isinstance(inp, Lattice): # <<<<<<<<<<<<<<
@@ -10776,7 +11696,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_27intersect(struct __pyx_obj
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":123
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":171
* cdef Lattice lat
* if isinstance(inp, Lattice):
* lat = <Lattice> inp # <<<<<<<<<<<<<<
@@ -10788,7 +11708,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_27intersect(struct __pyx_obj
goto __pyx_L3;
}
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":124
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":172
* if isinstance(inp, Lattice):
* lat = <Lattice> inp
* elif isinstance(inp, basestring): # <<<<<<<<<<<<<<
@@ -10799,19 +11719,19 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_27intersect(struct __pyx_obj
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":125
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":173
* lat = <Lattice> inp
* elif isinstance(inp, basestring):
* lat = Lattice(inp) # <<<<<<<<<<<<<<
* else:
* raise TypeError('cannot intersect hypergraph with %s' % type(inp))
*/
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_inp);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_inp);
__Pyx_GIVEREF(__pyx_v_inp);
- __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_Lattice)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_Lattice)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__pyx_v_lat = ((struct __pyx_obj_4cdec_5_cdec_Lattice *)__pyx_t_4);
@@ -10820,30 +11740,30 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_27intersect(struct __pyx_obj
}
/*else*/ {
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":127
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":175
* lat = Lattice(inp)
* else:
* raise TypeError('cannot intersect hypergraph with %s' % type(inp)) # <<<<<<<<<<<<<<
* return hypergraph.Intersect(lat.lattice[0], self.hg)
*
*/
- __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_15), ((PyObject *)Py_TYPE(__pyx_v_inp))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_15), ((PyObject *)Py_TYPE(__pyx_v_inp))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4));
__Pyx_GIVEREF(((PyObject *)__pyx_t_4));
__pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[3]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[3]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_L3:;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":128
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":176
* else:
* raise TypeError('cannot intersect hypergraph with %s' % type(inp))
* return hypergraph.Intersect(lat.lattice[0], self.hg) # <<<<<<<<<<<<<<
@@ -10851,7 +11771,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_27intersect(struct __pyx_obj
* def prune(self, beam_alpha=0, density=0, **kwargs):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_4 = __Pyx_PyBool_FromLong(HG::Intersect((__pyx_v_lat->lattice[0]), __pyx_v_self->hg)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyBool_FromLong(HG::Intersect((__pyx_v_lat->lattice[0]), __pyx_v_self->hg)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
@@ -10872,9 +11792,9 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_27intersect(struct __pyx_obj
}
/* Python wrapper */
-static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_30prune(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_4cdec_5_cdec_10Hypergraph_29prune[] = "hg.prune(beam_alpha=0, density=0): Prune the hypergraph.\n beam_alpha: use beam pruning\n density: use density pruning";
-static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_30prune(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_39prune(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4cdec_5_cdec_10Hypergraph_38prune[] = "hg.prune(beam_alpha=0, density=0): Prune the hypergraph.\n beam_alpha: use beam pruning\n density: use density pruning";
+static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_39prune(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_beam_alpha = 0;
PyObject *__pyx_v_density = 0;
PyObject *__pyx_v_kwargs = 0;
@@ -10914,7 +11834,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_30prune(PyObject *__pyx_v_se
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "prune") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "prune") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -10929,20 +11849,20 @@ static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_30prune(PyObject *__pyx_v_se
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("prune", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("prune", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
__Pyx_AddTraceback("cdec._cdec.Hypergraph.prune", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_4cdec_5_cdec_10Hypergraph_29prune(((struct __pyx_obj_4cdec_5_cdec_Hypergraph *)__pyx_v_self), __pyx_v_beam_alpha, __pyx_v_density, __pyx_v_kwargs);
+ __pyx_r = __pyx_pf_4cdec_5_cdec_10Hypergraph_38prune(((struct __pyx_obj_4cdec_5_cdec_Hypergraph *)__pyx_v_self), __pyx_v_beam_alpha, __pyx_v_density, __pyx_v_kwargs);
__Pyx_XDECREF(__pyx_v_kwargs);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":130
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":178
* return hypergraph.Intersect(lat.lattice[0], self.hg)
*
* def prune(self, beam_alpha=0, density=0, **kwargs): # <<<<<<<<<<<<<<
@@ -10950,7 +11870,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_30prune(PyObject *__pyx_v_se
* beam_alpha: use beam pruning
*/
-static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_29prune(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self, PyObject *__pyx_v_beam_alpha, PyObject *__pyx_v_density, PyObject *__pyx_v_kwargs) {
+static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_38prune(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self, PyObject *__pyx_v_beam_alpha, PyObject *__pyx_v_density, PyObject *__pyx_v_kwargs) {
std::vector<bool> *__pyx_v_preserve_mask;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
@@ -10963,7 +11883,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_29prune(struct __pyx_obj_4cd
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("prune", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":134
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":182
* beam_alpha: use beam pruning
* density: use density pruning"""
* cdef hypergraph.EdgeMask* preserve_mask = NULL # <<<<<<<<<<<<<<
@@ -10972,18 +11892,18 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_29prune(struct __pyx_obj_4cd
*/
__pyx_v_preserve_mask = NULL;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":135
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":183
* density: use density pruning"""
* cdef hypergraph.EdgeMask* preserve_mask = NULL
* if 'csplit_preserve_full_word' in kwargs: # <<<<<<<<<<<<<<
* preserve_mask = new hypergraph.EdgeMask(self.hg.edges_.size())
* preserve_mask[0][hypergraph.GetFullWordEdgeIndex(self.hg[0])] = True
*/
- __pyx_t_1 = (__Pyx_PyDict_Contains(((PyObject *)__pyx_n_s_16), ((PyObject *)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = (__Pyx_PyDict_Contains(((PyObject *)__pyx_n_s_16), ((PyObject *)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":136
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":184
* cdef hypergraph.EdgeMask* preserve_mask = NULL
* if 'csplit_preserve_full_word' in kwargs:
* preserve_mask = new hypergraph.EdgeMask(self.hg.edges_.size()) # <<<<<<<<<<<<<<
@@ -10992,7 +11912,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_29prune(struct __pyx_obj_4cd
*/
__pyx_v_preserve_mask = new std::vector<bool>(__pyx_v_self->hg->edges_.size());
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":137
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":185
* if 'csplit_preserve_full_word' in kwargs:
* preserve_mask = new hypergraph.EdgeMask(self.hg.edges_.size())
* preserve_mask[0][hypergraph.GetFullWordEdgeIndex(self.hg[0])] = True # <<<<<<<<<<<<<<
@@ -11004,18 +11924,18 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_29prune(struct __pyx_obj_4cd
}
__pyx_L3:;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":138
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":186
* preserve_mask = new hypergraph.EdgeMask(self.hg.edges_.size())
* preserve_mask[0][hypergraph.GetFullWordEdgeIndex(self.hg[0])] = True
* self.hg.PruneInsideOutside(beam_alpha, density, preserve_mask, False, 1, False) # <<<<<<<<<<<<<<
* if preserve_mask:
* del preserve_mask
*/
- __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_beam_alpha); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_density); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_beam_alpha); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_density); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->hg->PruneInsideOutside(__pyx_t_3, __pyx_t_4, __pyx_v_preserve_mask, 0, 1.0, 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":139
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":187
* preserve_mask[0][hypergraph.GetFullWordEdgeIndex(self.hg[0])] = True
* self.hg.PruneInsideOutside(beam_alpha, density, preserve_mask, False, 1, False)
* if preserve_mask: # <<<<<<<<<<<<<<
@@ -11025,7 +11945,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_29prune(struct __pyx_obj_4cd
__pyx_t_2 = (__pyx_v_preserve_mask != 0);
if (__pyx_t_2) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":140
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":188
* self.hg.PruneInsideOutside(beam_alpha, density, preserve_mask, False, 1, False)
* if preserve_mask:
* del preserve_mask # <<<<<<<<<<<<<<
@@ -11049,18 +11969,18 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_29prune(struct __pyx_obj_4cd
}
/* Python wrapper */
-static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_32lattice(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_4cdec_5_cdec_10Hypergraph_31lattice[] = "hg.lattice() -> Lattice corresponding to the hypergraph.";
-static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_32lattice(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_41lattice(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_4cdec_5_cdec_10Hypergraph_40lattice[] = "hg.lattice() -> Lattice corresponding to the hypergraph.";
+static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_41lattice(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("lattice (wrapper)", 0);
- __pyx_r = __pyx_pf_4cdec_5_cdec_10Hypergraph_31lattice(((struct __pyx_obj_4cdec_5_cdec_Hypergraph *)__pyx_v_self));
+ __pyx_r = __pyx_pf_4cdec_5_cdec_10Hypergraph_40lattice(((struct __pyx_obj_4cdec_5_cdec_Hypergraph *)__pyx_v_self));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":142
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":190
* del preserve_mask
*
* def lattice(self): # TODO direct hg -> lattice conversion in cdec # <<<<<<<<<<<<<<
@@ -11068,7 +11988,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_32lattice(PyObject *__pyx_v_
* cdef bytes plf = hypergraph.AsPLF(self.hg[0], True).c_str()
*/
-static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_31lattice(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self) {
+static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_40lattice(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self) {
PyObject *__pyx_v_plf = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
@@ -11080,19 +12000,19 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_31lattice(struct __pyx_obj_4
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("lattice", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":144
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":192
* def lattice(self): # TODO direct hg -> lattice conversion in cdec
* """hg.lattice() -> Lattice corresponding to the hypergraph."""
* cdef bytes plf = hypergraph.AsPLF(self.hg[0], True).c_str() # <<<<<<<<<<<<<<
* return Lattice(eval(plf))
*
*/
- __pyx_t_1 = __Pyx_PyBytes_FromString(HypergraphIO::AsPLF((__pyx_v_self->hg[0]), 1).c_str()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBytes_FromString(HypergraphIO::AsPLF((__pyx_v_self->hg[0]), 1).c_str()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__pyx_v_plf = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":145
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":193
* """hg.lattice() -> Lattice corresponding to the hypergraph."""
* cdef bytes plf = hypergraph.AsPLF(self.hg[0], True).c_str()
* return Lattice(eval(plf)) # <<<<<<<<<<<<<<
@@ -11100,17 +12020,17 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_31lattice(struct __pyx_obj_4
* def plf(self):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
if (((PyObject *)__pyx_v_plf)) {
- if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__plf), ((PyObject *)__pyx_v_plf)) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__plf), ((PyObject *)__pyx_v_plf)) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
if (((PyObject *)__pyx_v_self)) {
- if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__self), ((PyObject *)__pyx_v_self)) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__self), ((PyObject *)__pyx_v_self)) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_v_plf));
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_plf));
@@ -11121,15 +12041,15 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_31lattice(struct __pyx_obj_4
__Pyx_GIVEREF(((PyObject *)__pyx_t_2));
__pyx_t_1 = 0;
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_builtin_eval, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_builtin_eval, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__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[3]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 193; __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(((PyObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_Lattice)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_Lattice)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 193; __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;
@@ -11152,18 +12072,18 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_31lattice(struct __pyx_obj_4
}
/* Python wrapper */
-static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_34plf(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_4cdec_5_cdec_10Hypergraph_33plf[] = "hg.plf() -> Lattice PLF representation corresponding to the hypergraph.";
-static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_34plf(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_43plf(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_4cdec_5_cdec_10Hypergraph_42plf[] = "hg.plf() -> Lattice PLF representation corresponding to the hypergraph.";
+static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_43plf(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("plf (wrapper)", 0);
- __pyx_r = __pyx_pf_4cdec_5_cdec_10Hypergraph_33plf(((struct __pyx_obj_4cdec_5_cdec_Hypergraph *)__pyx_v_self));
+ __pyx_r = __pyx_pf_4cdec_5_cdec_10Hypergraph_42plf(((struct __pyx_obj_4cdec_5_cdec_Hypergraph *)__pyx_v_self));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":147
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":195
* return Lattice(eval(plf))
*
* def plf(self): # <<<<<<<<<<<<<<
@@ -11171,7 +12091,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_34plf(PyObject *__pyx_v_self
* return bytes(hypergraph.AsPLF(self.hg[0], True).c_str())
*/
-static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_33plf(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self) {
+static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_42plf(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
@@ -11181,7 +12101,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_33plf(struct __pyx_obj_4cdec
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("plf", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":149
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":197
* def plf(self):
* """hg.plf() -> Lattice PLF representation corresponding to the hypergraph."""
* return bytes(hypergraph.AsPLF(self.hg[0], True).c_str()) # <<<<<<<<<<<<<<
@@ -11189,14 +12109,14 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_33plf(struct __pyx_obj_4cdec
* def reweight(self, weights):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyBytes_FromString(HypergraphIO::AsPLF((__pyx_v_self->hg[0]), 1).c_str()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBytes_FromString(HypergraphIO::AsPLF((__pyx_v_self->hg[0]), 1).c_str()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
__Pyx_GIVEREF(((PyObject *)__pyx_t_1));
__pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyBytes_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyBytes_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
@@ -11217,18 +12137,18 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_33plf(struct __pyx_obj_4cdec
}
/* Python wrapper */
-static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_36reweight(PyObject *__pyx_v_self, PyObject *__pyx_v_weights); /*proto*/
-static char __pyx_doc_4cdec_5_cdec_10Hypergraph_35reweight[] = "hg.reweight(SparseVector/DenseVector): Reweight the hypergraph with a new vector.";
-static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_36reweight(PyObject *__pyx_v_self, PyObject *__pyx_v_weights) {
+static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_45reweight(PyObject *__pyx_v_self, PyObject *__pyx_v_weights); /*proto*/
+static char __pyx_doc_4cdec_5_cdec_10Hypergraph_44reweight[] = "hg.reweight(SparseVector/DenseVector): Reweight the hypergraph with a new vector.";
+static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_45reweight(PyObject *__pyx_v_self, PyObject *__pyx_v_weights) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("reweight (wrapper)", 0);
- __pyx_r = __pyx_pf_4cdec_5_cdec_10Hypergraph_35reweight(((struct __pyx_obj_4cdec_5_cdec_Hypergraph *)__pyx_v_self), ((PyObject *)__pyx_v_weights));
+ __pyx_r = __pyx_pf_4cdec_5_cdec_10Hypergraph_44reweight(((struct __pyx_obj_4cdec_5_cdec_Hypergraph *)__pyx_v_self), ((PyObject *)__pyx_v_weights));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":151
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":199
* return bytes(hypergraph.AsPLF(self.hg[0], True).c_str())
*
* def reweight(self, weights): # <<<<<<<<<<<<<<
@@ -11236,7 +12156,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_36reweight(PyObject *__pyx_v
* if isinstance(weights, SparseVector):
*/
-static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_35reweight(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self, PyObject *__pyx_v_weights) {
+static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_44reweight(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self, PyObject *__pyx_v_weights) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
@@ -11248,7 +12168,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_35reweight(struct __pyx_obj_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("reweight", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":153
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":201
* def reweight(self, weights):
* """hg.reweight(SparseVector/DenseVector): Reweight the hypergraph with a new vector."""
* if isinstance(weights, SparseVector): # <<<<<<<<<<<<<<
@@ -11259,7 +12179,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_35reweight(struct __pyx_obj_
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":154
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":202
* """hg.reweight(SparseVector/DenseVector): Reweight the hypergraph with a new vector."""
* if isinstance(weights, SparseVector):
* self.hg.Reweight((<SparseVector> weights).vector[0]) # <<<<<<<<<<<<<<
@@ -11270,7 +12190,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_35reweight(struct __pyx_obj_
goto __pyx_L3;
}
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":155
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":203
* if isinstance(weights, SparseVector):
* self.hg.Reweight((<SparseVector> weights).vector[0])
* elif isinstance(weights, DenseVector): # <<<<<<<<<<<<<<
@@ -11281,7 +12201,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_35reweight(struct __pyx_obj_
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":156
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":204
* self.hg.Reweight((<SparseVector> weights).vector[0])
* elif isinstance(weights, DenseVector):
* self.hg.Reweight((<DenseVector> weights).vector[0]) # <<<<<<<<<<<<<<
@@ -11293,26 +12213,26 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_35reweight(struct __pyx_obj_
}
/*else*/ {
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":158
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":206
* self.hg.Reweight((<DenseVector> weights).vector[0])
* else:
* raise TypeError('cannot reweight hypergraph with %s' % type(weights)) # <<<<<<<<<<<<<<
*
* property edges:
*/
- __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_17), ((PyObject *)Py_TYPE(__pyx_v_weights))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_17), ((PyObject *)Py_TYPE(__pyx_v_weights))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
__Pyx_GIVEREF(((PyObject *)__pyx_t_3));
__pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[3]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[3]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_L3:;
@@ -11328,7 +12248,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_35reweight(struct __pyx_obj_
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_5edges_2generator9(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_5edges_2generator12(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
/* Python wrapper */
static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_5edges_1__get__(PyObject *__pyx_v_self); /*proto*/
@@ -11341,7 +12261,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_5edges_1__get__(PyObject *__
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":161
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":209
*
* property edges:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -11350,14 +12270,14 @@ static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_5edges_1__get__(PyObject *__
*/
static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_5edges___get__(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13___get__ *__pyx_cur_scope;
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_16___get__ *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- __pyx_cur_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13___get__ *)__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_13___get__(__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_13___get__, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_16___get__ *)__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_16___get__(__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_16___get__, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__Pyx_RefNannyFinishContext();
return NULL;
@@ -11367,7 +12287,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_5edges___get__(struct __pyx_
__Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
__Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_10Hypergraph_5edges_2generator9, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_10Hypergraph_5edges_2generator12, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -11385,9 +12305,9 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_5edges___get__(struct __pyx_
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_5edges_2generator9(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_5edges_2generator12(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13___get__ *__pyx_cur_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13___get__ *)__pyx_generator->closure);
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_16___get__ *__pyx_cur_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_16___get__ *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
size_t __pyx_t_1;
unsigned int __pyx_t_2;
@@ -11406,9 +12326,9 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_5edges_2generator9(__pyx_Gen
return NULL;
}
__pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":163
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":211
* def __get__(self):
* cdef unsigned i
* for i in range(self.hg.edges_.size()): # <<<<<<<<<<<<<<
@@ -11419,16 +12339,16 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_5edges_2generator9(__pyx_Gen
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_cur_scope->__pyx_v_i = __pyx_t_2;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":164
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":212
* cdef unsigned i
* for i in range(self.hg.edges_.size()):
* yield HypergraphEdge().init(self.hg, i) # <<<<<<<<<<<<<<
*
* property nodes:
*/
- __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_HypergraphEdge)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_HypergraphEdge)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = ((struct __pyx_vtabstruct_4cdec_5_cdec_HypergraphEdge *)((struct __pyx_obj_4cdec_5_cdec_HypergraphEdge *)__pyx_t_3)->__pyx_vtab)->init(((struct __pyx_obj_4cdec_5_cdec_HypergraphEdge *)__pyx_t_3), __pyx_cur_scope->__pyx_v_self->hg, __pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = ((struct __pyx_vtabstruct_4cdec_5_cdec_HypergraphEdge *)((struct __pyx_obj_4cdec_5_cdec_HypergraphEdge *)__pyx_t_3)->__pyx_vtab)->init(((struct __pyx_obj_4cdec_5_cdec_HypergraphEdge *)__pyx_t_3), __pyx_cur_scope->__pyx_v_self->hg, __pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_4;
@@ -11443,7 +12363,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_5edges_2generator9(__pyx_Gen
__pyx_L6_resume_from_yield:;
__pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
__pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
PyErr_SetNone(PyExc_StopIteration);
goto __pyx_L0;
@@ -11458,7 +12378,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_5edges_2generator9(__pyx_Gen
__Pyx_RefNannyFinishContext();
return NULL;
}
-static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_5nodes_2generator10(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_5nodes_2generator13(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
/* Python wrapper */
static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_5nodes_1__get__(PyObject *__pyx_v_self); /*proto*/
@@ -11471,7 +12391,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_5nodes_1__get__(PyObject *__
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":167
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":215
*
* property nodes:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -11480,14 +12400,14 @@ static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_5nodes_1__get__(PyObject *__
*/
static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_5nodes___get__(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14___get__ *__pyx_cur_scope;
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__ *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- __pyx_cur_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14___get__ *)__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_14___get__(__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_14___get__, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__ *)__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_17___get__(__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_17___get__, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__Pyx_RefNannyFinishContext();
return NULL;
@@ -11497,7 +12417,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_5nodes___get__(struct __pyx_
__Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
__Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_10Hypergraph_5nodes_2generator10, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_10Hypergraph_5nodes_2generator13, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -11515,9 +12435,9 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_5nodes___get__(struct __pyx_
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_5nodes_2generator10(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_5nodes_2generator13(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14___get__ *__pyx_cur_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14___get__ *)__pyx_generator->closure);
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__ *__pyx_cur_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__ *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
size_t __pyx_t_1;
unsigned int __pyx_t_2;
@@ -11536,9 +12456,9 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_5nodes_2generator10(__pyx_Ge
return NULL;
}
__pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":169
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":217
* def __get__(self):
* cdef unsigned i
* for i in range(self.hg.nodes_.size()): # <<<<<<<<<<<<<<
@@ -11549,16 +12469,16 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_5nodes_2generator10(__pyx_Ge
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_cur_scope->__pyx_v_i = __pyx_t_2;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":170
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":218
* cdef unsigned i
* for i in range(self.hg.nodes_.size()):
* yield HypergraphNode().init(self.hg, i) # <<<<<<<<<<<<<<
*
* property goal:
*/
- __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_HypergraphNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_HypergraphNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = ((struct __pyx_vtabstruct_4cdec_5_cdec_HypergraphNode *)((struct __pyx_obj_4cdec_5_cdec_HypergraphNode *)__pyx_t_3)->__pyx_vtab)->init(((struct __pyx_obj_4cdec_5_cdec_HypergraphNode *)__pyx_t_3), __pyx_cur_scope->__pyx_v_self->hg, __pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = ((struct __pyx_vtabstruct_4cdec_5_cdec_HypergraphNode *)((struct __pyx_obj_4cdec_5_cdec_HypergraphNode *)__pyx_t_3)->__pyx_vtab)->init(((struct __pyx_obj_4cdec_5_cdec_HypergraphNode *)__pyx_t_3), __pyx_cur_scope->__pyx_v_self->hg, __pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_4;
@@ -11573,7 +12493,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_10Hypergraph_5nodes_2generator10(__pyx_Ge
__pyx_L6_resume_from_yield:;
__pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
__pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
PyErr_SetNone(PyExc_StopIteration);
goto __pyx_L0;
@@ -11600,7 +12520,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_4goal_1__get__(PyObject *__p
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":173
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":221
*
* property goal:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -11618,7 +12538,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_4goal___get__(struct __pyx_o
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":174
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":222
* property goal:
* def __get__(self):
* return HypergraphNode().init(self.hg, self.hg.GoalNode()) # <<<<<<<<<<<<<<
@@ -11626,9 +12546,9 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_4goal___get__(struct __pyx_o
* property npaths:
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_HypergraphNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_HypergraphNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = ((struct __pyx_vtabstruct_4cdec_5_cdec_HypergraphNode *)((struct __pyx_obj_4cdec_5_cdec_HypergraphNode *)__pyx_t_1)->__pyx_vtab)->init(((struct __pyx_obj_4cdec_5_cdec_HypergraphNode *)__pyx_t_1), __pyx_v_self->hg, __pyx_v_self->hg->GoalNode()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = ((struct __pyx_vtabstruct_4cdec_5_cdec_HypergraphNode *)((struct __pyx_obj_4cdec_5_cdec_HypergraphNode *)__pyx_t_1)->__pyx_vtab)->init(((struct __pyx_obj_4cdec_5_cdec_HypergraphNode *)__pyx_t_1), __pyx_v_self->hg, __pyx_v_self->hg->GoalNode()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_2;
@@ -11659,7 +12579,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_6npaths_1__get__(PyObject *_
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":177
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":225
*
* property npaths:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -11676,7 +12596,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_6npaths___get__(struct __pyx
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":178
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":226
* property npaths:
* def __get__(self):
* return self.hg.NumberOfPaths() # <<<<<<<<<<<<<<
@@ -11684,7 +12604,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_6npaths___get__(struct __pyx
* def inside_outside(self):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->hg->NumberOfPaths()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->hg->NumberOfPaths()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -11703,18 +12623,18 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_6npaths___get__(struct __pyx
}
/* Python wrapper */
-static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_38inside_outside(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_4cdec_5_cdec_10Hypergraph_37inside_outside[] = "hg.inside_outside() -> SparseVector with inside-outside scores for each feature.";
-static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_38inside_outside(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_47inside_outside(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_4cdec_5_cdec_10Hypergraph_46inside_outside[] = "hg.inside_outside() -> SparseVector with inside-outside scores for each feature.";
+static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_47inside_outside(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("inside_outside (wrapper)", 0);
- __pyx_r = __pyx_pf_4cdec_5_cdec_10Hypergraph_37inside_outside(((struct __pyx_obj_4cdec_5_cdec_Hypergraph *)__pyx_v_self));
+ __pyx_r = __pyx_pf_4cdec_5_cdec_10Hypergraph_46inside_outside(((struct __pyx_obj_4cdec_5_cdec_Hypergraph *)__pyx_v_self));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":180
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":228
* return self.hg.NumberOfPaths()
*
* def inside_outside(self): # <<<<<<<<<<<<<<
@@ -11722,7 +12642,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_10Hypergraph_38inside_outside(PyObject *_
* cdef FastSparseVector[prob_t]* result = new FastSparseVector[prob_t]()
*/
-static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_37inside_outside(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self) {
+static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_46inside_outside(struct __pyx_obj_4cdec_5_cdec_Hypergraph *__pyx_v_self) {
FastSparseVector<prob_t> *__pyx_v_result;
prob_t __pyx_v_z;
struct __pyx_obj_4cdec_5_cdec_SparseVector *__pyx_v_vector = 0;
@@ -11738,7 +12658,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_37inside_outside(struct __py
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("inside_outside", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":182
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":230
* def inside_outside(self):
* """hg.inside_outside() -> SparseVector with inside-outside scores for each feature."""
* cdef FastSparseVector[prob_t]* result = new FastSparseVector[prob_t]() # <<<<<<<<<<<<<<
@@ -11747,7 +12667,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_37inside_outside(struct __py
*/
__pyx_v_result = new FastSparseVector<prob_t>();
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":183
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":231
* """hg.inside_outside() -> SparseVector with inside-outside scores for each feature."""
* cdef FastSparseVector[prob_t]* result = new FastSparseVector[prob_t]()
* cdef prob_t z = hypergraph.InsideOutside(self.hg[0], result) # <<<<<<<<<<<<<<
@@ -11756,7 +12676,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_37inside_outside(struct __py
*/
__pyx_v_z = InsideOutside<prob_t, EdgeProb, SparseVector<prob_t>, EdgeFeaturesAndProbWeightFunction>((__pyx_v_self->hg[0]), __pyx_v_result);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":184
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":232
* cdef FastSparseVector[prob_t]* result = new FastSparseVector[prob_t]()
* cdef prob_t z = hypergraph.InsideOutside(self.hg[0], result)
* result[0] /= z # <<<<<<<<<<<<<<
@@ -11765,20 +12685,20 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_37inside_outside(struct __py
*/
(__pyx_v_result[0]) /= __pyx_v_z;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":185
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":233
* cdef prob_t z = hypergraph.InsideOutside(self.hg[0], result)
* result[0] /= z
* cdef SparseVector vector = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<<
* vector.vector = new FastSparseVector[double]()
* cdef FastSparseVector[prob_t].const_iterator* it = new FastSparseVector[prob_t].const_iterator(result[0], False)
*/
- __pyx_t_1 = __pyx_tp_new_4cdec_5_cdec_SparseVector(((PyTypeObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_SparseVector)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_tp_new_4cdec_5_cdec_SparseVector(((PyTypeObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_SparseVector)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4cdec_5_cdec_SparseVector)))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4cdec_5_cdec_SparseVector)))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_vector = ((struct __pyx_obj_4cdec_5_cdec_SparseVector *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":186
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":234
* result[0] /= z
* cdef SparseVector vector = SparseVector.__new__(SparseVector)
* vector.vector = new FastSparseVector[double]() # <<<<<<<<<<<<<<
@@ -11787,7 +12707,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_37inside_outside(struct __py
*/
__pyx_v_vector->vector = new FastSparseVector<double>();
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":187
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":235
* cdef SparseVector vector = SparseVector.__new__(SparseVector)
* vector.vector = new FastSparseVector[double]()
* cdef FastSparseVector[prob_t].const_iterator* it = new FastSparseVector[prob_t].const_iterator(result[0], False) # <<<<<<<<<<<<<<
@@ -11796,7 +12716,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_37inside_outside(struct __py
*/
__pyx_v_it = new FastSparseVector<prob_t>::const_iterator((__pyx_v_result[0]), 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":189
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":237
* cdef FastSparseVector[prob_t].const_iterator* it = new FastSparseVector[prob_t].const_iterator(result[0], False)
* cdef unsigned i
* for i in range(result.size()): # <<<<<<<<<<<<<<
@@ -11807,7 +12727,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_37inside_outside(struct __py
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":190
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":238
* cdef unsigned i
* for i in range(result.size()):
* vector.vector.set_value(it[0].ptr().first, log(it[0].ptr().second)) # <<<<<<<<<<<<<<
@@ -11816,7 +12736,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_37inside_outside(struct __py
*/
__pyx_v_vector->vector->set_value((__pyx_v_it[0]).operator->()->first, log((__pyx_v_it[0]).operator->()->second));
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":191
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":239
* for i in range(result.size()):
* vector.vector.set_value(it[0].ptr().first, log(it[0].ptr().second))
* pinc(it[0]) # ++it # <<<<<<<<<<<<<<
@@ -11826,7 +12746,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_37inside_outside(struct __py
(++(__pyx_v_it[0]));
}
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":192
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":240
* vector.vector.set_value(it[0].ptr().first, log(it[0].ptr().second))
* pinc(it[0]) # ++it
* del it # <<<<<<<<<<<<<<
@@ -11835,7 +12755,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_37inside_outside(struct __py
*/
delete __pyx_v_it;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":193
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":241
* pinc(it[0]) # ++it
* del it
* del result # <<<<<<<<<<<<<<
@@ -11844,7 +12764,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_37inside_outside(struct __py
*/
delete __pyx_v_result;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":194
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":242
* del it
* del result
* return vector # <<<<<<<<<<<<<<
@@ -11869,7 +12789,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_10Hypergraph_37inside_outside(struct __py
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":201
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":249
* cdef public TRule trule
*
* cdef init(self, hypergraph.Hypergraph* hg, unsigned i): # <<<<<<<<<<<<<<
@@ -11886,7 +12806,7 @@ static PyObject *__pyx_f_4cdec_5_cdec_14HypergraphEdge_init(struct __pyx_obj_4cd
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("init", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":202
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":250
*
* cdef init(self, hypergraph.Hypergraph* hg, unsigned i):
* self.hg = hg # <<<<<<<<<<<<<<
@@ -11895,7 +12815,7 @@ static PyObject *__pyx_f_4cdec_5_cdec_14HypergraphEdge_init(struct __pyx_obj_4cd
*/
__pyx_v_self->hg = __pyx_v_hg;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":203
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":251
* cdef init(self, hypergraph.Hypergraph* hg, unsigned i):
* self.hg = hg
* self.edge = &hg.edges_[i] # <<<<<<<<<<<<<<
@@ -11904,23 +12824,23 @@ static PyObject *__pyx_f_4cdec_5_cdec_14HypergraphEdge_init(struct __pyx_obj_4cd
*/
__pyx_v_self->edge = (&(__pyx_v_hg->edges_[__pyx_v_i]));
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":204
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":252
* self.hg = hg
* self.edge = &hg.edges_[i]
* self.trule = TRule.__new__(TRule) # <<<<<<<<<<<<<<
* self.trule.rule = new shared_ptr[grammar.TRule](self.edge.rule_)
* return self
*/
- __pyx_t_1 = __pyx_tp_new_4cdec_5_cdec_TRule(((PyTypeObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_TRule)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_tp_new_4cdec_5_cdec_TRule(((PyTypeObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_TRule)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4cdec_5_cdec_TRule)))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4cdec_5_cdec_TRule)))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->trule);
__Pyx_DECREF(((PyObject *)__pyx_v_self->trule));
__pyx_v_self->trule = ((struct __pyx_obj_4cdec_5_cdec_TRule *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":205
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":253
* self.edge = &hg.edges_[i]
* self.trule = TRule.__new__(TRule)
* self.trule.rule = new shared_ptr[grammar.TRule](self.edge.rule_) # <<<<<<<<<<<<<<
@@ -11929,7 +12849,7 @@ static PyObject *__pyx_f_4cdec_5_cdec_14HypergraphEdge_init(struct __pyx_obj_4cd
*/
__pyx_v_self->trule->rule = new boost::shared_ptr<TRule>(__pyx_v_self->edge->rule_);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":206
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":254
* self.trule = TRule.__new__(TRule)
* self.trule.rule = new shared_ptr[grammar.TRule](self.edge.rule_)
* return self # <<<<<<<<<<<<<<
@@ -11964,7 +12884,7 @@ static Py_ssize_t __pyx_pw_4cdec_5_cdec_14HypergraphEdge_1__len__(PyObject *__py
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":208
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":256
* return self
*
* def __len__(self): # <<<<<<<<<<<<<<
@@ -11977,7 +12897,7 @@ static Py_ssize_t __pyx_pf_4cdec_5_cdec_14HypergraphEdge___len__(struct __pyx_ob
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__len__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":209
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":257
*
* def __len__(self):
* return self.edge.tail_nodes_.size() # <<<<<<<<<<<<<<
@@ -12004,7 +12924,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_14HypergraphEdge_9head_node_1__get__(PyOb
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":212
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":260
*
* property head_node:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -12022,7 +12942,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphEdge_9head_node___get__(struc
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":213
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":261
* property head_node:
* def __get__(self):
* return HypergraphNode().init(self.hg, self.edge.head_node_) # <<<<<<<<<<<<<<
@@ -12030,9 +12950,9 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphEdge_9head_node___get__(struc
* property tail_nodes:
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_HypergraphNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_HypergraphNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = ((struct __pyx_vtabstruct_4cdec_5_cdec_HypergraphNode *)((struct __pyx_obj_4cdec_5_cdec_HypergraphNode *)__pyx_t_1)->__pyx_vtab)->init(((struct __pyx_obj_4cdec_5_cdec_HypergraphNode *)__pyx_t_1), __pyx_v_self->hg, __pyx_v_self->edge->head_node_); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = ((struct __pyx_vtabstruct_4cdec_5_cdec_HypergraphNode *)((struct __pyx_obj_4cdec_5_cdec_HypergraphNode *)__pyx_t_1)->__pyx_vtab)->init(((struct __pyx_obj_4cdec_5_cdec_HypergraphNode *)__pyx_t_1), __pyx_v_self->hg, __pyx_v_self->edge->head_node_); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_2;
@@ -12051,7 +12971,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphEdge_9head_node___get__(struc
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_5_cdec_14HypergraphEdge_10tail_nodes_2generator11(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4cdec_5_cdec_14HypergraphEdge_10tail_nodes_2generator14(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
/* Python wrapper */
static PyObject *__pyx_pw_4cdec_5_cdec_14HypergraphEdge_10tail_nodes_1__get__(PyObject *__pyx_v_self); /*proto*/
@@ -12064,7 +12984,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_14HypergraphEdge_10tail_nodes_1__get__(Py
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":216
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":264
*
* property tail_nodes:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -12073,14 +12993,14 @@ static PyObject *__pyx_pw_4cdec_5_cdec_14HypergraphEdge_10tail_nodes_1__get__(Py
*/
static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphEdge_10tail_nodes___get__(struct __pyx_obj_4cdec_5_cdec_HypergraphEdge *__pyx_v_self) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15___get__ *__pyx_cur_scope;
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___get__ *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- __pyx_cur_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15___get__ *)__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_15___get__(__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_15___get__, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___get__ *)__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_18___get__(__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_18___get__, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__Pyx_RefNannyFinishContext();
return NULL;
@@ -12090,7 +13010,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphEdge_10tail_nodes___get__(str
__Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
__Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_14HypergraphEdge_10tail_nodes_2generator11, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_14HypergraphEdge_10tail_nodes_2generator14, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -12108,9 +13028,9 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphEdge_10tail_nodes___get__(str
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_5_cdec_14HypergraphEdge_10tail_nodes_2generator11(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4cdec_5_cdec_14HypergraphEdge_10tail_nodes_2generator14(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15___get__ *__pyx_cur_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15___get__ *)__pyx_generator->closure);
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___get__ *__pyx_cur_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___get__ *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
unsigned int __pyx_t_1;
unsigned int __pyx_t_2;
@@ -12129,9 +13049,9 @@ static PyObject *__pyx_gb_4cdec_5_cdec_14HypergraphEdge_10tail_nodes_2generator1
return NULL;
}
__pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":218
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":266
* def __get__(self):
* cdef unsigned i
* for i in range(self.edge.tail_nodes_.size()): # <<<<<<<<<<<<<<
@@ -12142,16 +13062,16 @@ static PyObject *__pyx_gb_4cdec_5_cdec_14HypergraphEdge_10tail_nodes_2generator1
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_cur_scope->__pyx_v_i = __pyx_t_2;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":219
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":267
* cdef unsigned i
* for i in range(self.edge.tail_nodes_.size()):
* yield HypergraphNode().init(self.hg, self.edge.tail_nodes_[i]) # <<<<<<<<<<<<<<
*
* property span:
*/
- __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_HypergraphNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_HypergraphNode)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = ((struct __pyx_vtabstruct_4cdec_5_cdec_HypergraphNode *)((struct __pyx_obj_4cdec_5_cdec_HypergraphNode *)__pyx_t_3)->__pyx_vtab)->init(((struct __pyx_obj_4cdec_5_cdec_HypergraphNode *)__pyx_t_3), __pyx_cur_scope->__pyx_v_self->hg, (__pyx_cur_scope->__pyx_v_self->edge->tail_nodes_[__pyx_cur_scope->__pyx_v_i])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = ((struct __pyx_vtabstruct_4cdec_5_cdec_HypergraphNode *)((struct __pyx_obj_4cdec_5_cdec_HypergraphNode *)__pyx_t_3)->__pyx_vtab)->init(((struct __pyx_obj_4cdec_5_cdec_HypergraphNode *)__pyx_t_3), __pyx_cur_scope->__pyx_v_self->hg, (__pyx_cur_scope->__pyx_v_self->edge->tail_nodes_[__pyx_cur_scope->__pyx_v_i])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_4;
@@ -12166,7 +13086,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_14HypergraphEdge_10tail_nodes_2generator1
__pyx_L6_resume_from_yield:;
__pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
__pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
PyErr_SetNone(PyExc_StopIteration);
goto __pyx_L0;
@@ -12193,7 +13113,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_14HypergraphEdge_4span_1__get__(PyObject
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":222
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":270
*
* property span:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -12212,7 +13132,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphEdge_4span___get__(struct __p
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":223
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":271
* property span:
* def __get__(self):
* return (self.edge.i_, self.edge.j_) # <<<<<<<<<<<<<<
@@ -12220,11 +13140,11 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphEdge_4span___get__(struct __p
* property src_span:
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyInt_FromLong(__pyx_v_self->edge->i_); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_v_self->edge->i_); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyInt_FromLong(__pyx_v_self->edge->j_); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong(__pyx_v_self->edge->j_); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 271; __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[3]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 271; __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);
@@ -12261,7 +13181,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_14HypergraphEdge_8src_span_1__get__(PyObj
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":226
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":274
*
* property src_span:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -12280,7 +13200,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphEdge_8src_span___get__(struct
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":227
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":275
* property src_span:
* def __get__(self):
* return (self.edge.prev_i_, self.edge.prev_j_) # <<<<<<<<<<<<<<
@@ -12288,11 +13208,11 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphEdge_8src_span___get__(struct
* property feature_values:
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyInt_FromLong(__pyx_v_self->edge->prev_i_); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_v_self->edge->prev_i_); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyInt_FromLong(__pyx_v_self->edge->prev_j_); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong(__pyx_v_self->edge->prev_j_); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 275; __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[3]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 275; __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);
@@ -12329,7 +13249,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_14HypergraphEdge_14feature_values_1__get_
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":230
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":278
*
* property feature_values:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -12347,20 +13267,20 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphEdge_14feature_values___get__
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":231
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":279
* property feature_values:
* def __get__(self):
* cdef SparseVector vector = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<<
* vector.vector = new FastSparseVector[double](self.edge.feature_values_)
* return vector
*/
- __pyx_t_1 = __pyx_tp_new_4cdec_5_cdec_SparseVector(((PyTypeObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_SparseVector)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_tp_new_4cdec_5_cdec_SparseVector(((PyTypeObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_SparseVector)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4cdec_5_cdec_SparseVector)))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4cdec_5_cdec_SparseVector)))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_vector = ((struct __pyx_obj_4cdec_5_cdec_SparseVector *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":232
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":280
* def __get__(self):
* cdef SparseVector vector = SparseVector.__new__(SparseVector)
* vector.vector = new FastSparseVector[double](self.edge.feature_values_) # <<<<<<<<<<<<<<
@@ -12369,7 +13289,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphEdge_14feature_values___get__
*/
__pyx_v_vector->vector = new FastSparseVector<double>(__pyx_v_self->edge->feature_values_);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":233
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":281
* cdef SparseVector vector = SparseVector.__new__(SparseVector)
* vector.vector = new FastSparseVector[double](self.edge.feature_values_)
* return vector # <<<<<<<<<<<<<<
@@ -12405,7 +13325,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_14HypergraphEdge_4prob_1__get__(PyObject
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":236
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":284
*
* property prob:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -12422,7 +13342,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphEdge_4prob___get__(struct __p
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":237
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":285
* property prob:
* def __get__(self):
* return self.edge.edge_prob_.as_float() # <<<<<<<<<<<<<<
@@ -12430,7 +13350,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphEdge_4prob___get__(struct __p
* def __richcmp__(HypergraphEdge x, HypergraphEdge y, int op):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->edge->edge_prob_.as_float()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->edge->edge_prob_.as_float()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -12457,8 +13377,8 @@ static PyObject *__pyx_pw_4cdec_5_cdec_14HypergraphEdge_3__richcmp__(PyObject *_
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_4cdec_5_cdec_HypergraphEdge, 1, "x", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_4cdec_5_cdec_HypergraphEdge, 1, "y", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_4cdec_5_cdec_HypergraphEdge, 1, "x", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_4cdec_5_cdec_HypergraphEdge, 1, "y", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_r = __pyx_pf_4cdec_5_cdec_14HypergraphEdge_2__richcmp__(((struct __pyx_obj_4cdec_5_cdec_HypergraphEdge *)__pyx_v_x), ((struct __pyx_obj_4cdec_5_cdec_HypergraphEdge *)__pyx_v_y), ((int)__pyx_v_op));
goto __pyx_L0;
__pyx_L1_error:;
@@ -12468,7 +13388,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_14HypergraphEdge_3__richcmp__(PyObject *_
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":239
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":287
* return self.edge.edge_prob_.as_float()
*
* def __richcmp__(HypergraphEdge x, HypergraphEdge y, int op): # <<<<<<<<<<<<<<
@@ -12486,7 +13406,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphEdge_2__richcmp__(struct __py
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__richcmp__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":242
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":290
* if op == 2: # ==
* return x.edge == y.edge
* elif op == 3: # != # <<<<<<<<<<<<<<
@@ -12495,7 +13415,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphEdge_2__richcmp__(struct __py
*/
switch (__pyx_v_op) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":240
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":288
*
* def __richcmp__(HypergraphEdge x, HypergraphEdge y, int op):
* if op == 2: # == # <<<<<<<<<<<<<<
@@ -12504,7 +13424,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphEdge_2__richcmp__(struct __py
*/
case 2:
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":241
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":289
* def __richcmp__(HypergraphEdge x, HypergraphEdge y, int op):
* if op == 2: # ==
* return x.edge == y.edge # <<<<<<<<<<<<<<
@@ -12512,14 +13432,14 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphEdge_2__richcmp__(struct __py
* return not (x == y)
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_x->edge == __pyx_v_y->edge)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_x->edge == __pyx_v_y->edge)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
break;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":242
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":290
* if op == 2: # ==
* return x.edge == y.edge
* elif op == 3: # != # <<<<<<<<<<<<<<
@@ -12528,7 +13448,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphEdge_2__richcmp__(struct __py
*/
case 3:
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":243
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":291
* return x.edge == y.edge
* elif op == 3: # !=
* return not (x == y) # <<<<<<<<<<<<<<
@@ -12536,10 +13456,10 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphEdge_2__richcmp__(struct __py
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_x), ((PyObject *)__pyx_v_y), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 243; __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[3]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_x), ((PyObject *)__pyx_v_y), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 291; __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[3]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyBool_FromLong((!__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong((!__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -12547,18 +13467,18 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphEdge_2__richcmp__(struct __py
break;
}
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":244
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":292
* elif op == 3: # !=
* return not (x == y)
* raise NotImplemented('comparison not implemented for HypergraphEdge') # <<<<<<<<<<<<<<
*
* cdef class HypergraphNode:
*/
- __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplemented, ((PyObject *)__pyx_k_tuple_19), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplemented, ((PyObject *)__pyx_k_tuple_19), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 292; __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[3]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[3]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
@@ -12583,7 +13503,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_14HypergraphEdge_5trule_1__get__(PyObject
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":199
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":247
* cdef hypergraph.Hypergraph* hg
* cdef hypergraph.HypergraphEdge* edge
* cdef public TRule trule # <<<<<<<<<<<<<<
@@ -12625,7 +13545,7 @@ static int __pyx_pf_4cdec_5_cdec_14HypergraphEdge_5trule_2__set__(struct __pyx_o
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
- if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_4cdec_5_cdec_TRule))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_4cdec_5_cdec_TRule))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_INCREF(__pyx_v_value);
__Pyx_GIVEREF(__pyx_v_value);
__Pyx_GOTREF(__pyx_v_self->trule);
@@ -12668,7 +13588,7 @@ static int __pyx_pf_4cdec_5_cdec_14HypergraphEdge_5trule_4__del__(struct __pyx_o
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":250
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":298
* cdef hypergraph.HypergraphNode* node
*
* cdef init(self, hypergraph.Hypergraph* hg, unsigned i): # <<<<<<<<<<<<<<
@@ -12681,7 +13601,7 @@ static PyObject *__pyx_f_4cdec_5_cdec_14HypergraphNode_init(struct __pyx_obj_4cd
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("init", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":251
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":299
*
* cdef init(self, hypergraph.Hypergraph* hg, unsigned i):
* self.hg = hg # <<<<<<<<<<<<<<
@@ -12690,7 +13610,7 @@ static PyObject *__pyx_f_4cdec_5_cdec_14HypergraphNode_init(struct __pyx_obj_4cd
*/
__pyx_v_self->hg = __pyx_v_hg;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":252
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":300
* cdef init(self, hypergraph.Hypergraph* hg, unsigned i):
* self.hg = hg
* self.node = &hg.nodes_[i] # <<<<<<<<<<<<<<
@@ -12699,7 +13619,7 @@ static PyObject *__pyx_f_4cdec_5_cdec_14HypergraphNode_init(struct __pyx_obj_4cd
*/
__pyx_v_self->node = (&(__pyx_v_hg->nodes_[__pyx_v_i]));
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":253
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":301
* self.hg = hg
* self.node = &hg.nodes_[i]
* return self # <<<<<<<<<<<<<<
@@ -12729,7 +13649,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_14HypergraphNode_2id_1__get__(PyObject *_
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":256
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":304
*
* property id:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -12746,7 +13666,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphNode_2id___get__(struct __pyx
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":257
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":305
* property id:
* def __get__(self):
* return self.node.id_ # <<<<<<<<<<<<<<
@@ -12754,7 +13674,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphNode_2id___get__(struct __pyx
* property in_edges:
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyInt_FromLong(__pyx_v_self->node->id_); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_v_self->node->id_); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -12771,7 +13691,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphNode_2id___get__(struct __pyx
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_5_cdec_14HypergraphNode_8in_edges_2generator12(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4cdec_5_cdec_14HypergraphNode_8in_edges_2generator15(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
/* Python wrapper */
static PyObject *__pyx_pw_4cdec_5_cdec_14HypergraphNode_8in_edges_1__get__(PyObject *__pyx_v_self); /*proto*/
@@ -12784,7 +13704,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_14HypergraphNode_8in_edges_1__get__(PyObj
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":260
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":308
*
* property in_edges:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -12793,14 +13713,14 @@ static PyObject *__pyx_pw_4cdec_5_cdec_14HypergraphNode_8in_edges_1__get__(PyObj
*/
static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphNode_8in_edges___get__(struct __pyx_obj_4cdec_5_cdec_HypergraphNode *__pyx_v_self) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_16___get__ *__pyx_cur_scope;
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19___get__ *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- __pyx_cur_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_16___get__ *)__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_16___get__(__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_16___get__, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19___get__ *)__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_19___get__(__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_19___get__, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__Pyx_RefNannyFinishContext();
return NULL;
@@ -12810,7 +13730,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphNode_8in_edges___get__(struct
__Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
__Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_14HypergraphNode_8in_edges_2generator12, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_14HypergraphNode_8in_edges_2generator15, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -12828,9 +13748,9 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphNode_8in_edges___get__(struct
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_5_cdec_14HypergraphNode_8in_edges_2generator12(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4cdec_5_cdec_14HypergraphNode_8in_edges_2generator15(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_16___get__ *__pyx_cur_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_16___get__ *)__pyx_generator->closure);
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19___get__ *__pyx_cur_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19___get__ *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
size_t __pyx_t_1;
unsigned int __pyx_t_2;
@@ -12849,9 +13769,9 @@ static PyObject *__pyx_gb_4cdec_5_cdec_14HypergraphNode_8in_edges_2generator12(_
return NULL;
}
__pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":262
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":310
* def __get__(self):
* cdef unsigned i
* for i in range(self.node.in_edges_.size()): # <<<<<<<<<<<<<<
@@ -12862,16 +13782,16 @@ static PyObject *__pyx_gb_4cdec_5_cdec_14HypergraphNode_8in_edges_2generator12(_
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_cur_scope->__pyx_v_i = __pyx_t_2;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":263
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":311
* cdef unsigned i
* for i in range(self.node.in_edges_.size()):
* yield HypergraphEdge().init(self.hg, self.node.in_edges_[i]) # <<<<<<<<<<<<<<
*
* property out_edges:
*/
- __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_HypergraphEdge)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_HypergraphEdge)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = ((struct __pyx_vtabstruct_4cdec_5_cdec_HypergraphEdge *)((struct __pyx_obj_4cdec_5_cdec_HypergraphEdge *)__pyx_t_3)->__pyx_vtab)->init(((struct __pyx_obj_4cdec_5_cdec_HypergraphEdge *)__pyx_t_3), __pyx_cur_scope->__pyx_v_self->hg, (__pyx_cur_scope->__pyx_v_self->node->in_edges_[__pyx_cur_scope->__pyx_v_i])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = ((struct __pyx_vtabstruct_4cdec_5_cdec_HypergraphEdge *)((struct __pyx_obj_4cdec_5_cdec_HypergraphEdge *)__pyx_t_3)->__pyx_vtab)->init(((struct __pyx_obj_4cdec_5_cdec_HypergraphEdge *)__pyx_t_3), __pyx_cur_scope->__pyx_v_self->hg, (__pyx_cur_scope->__pyx_v_self->node->in_edges_[__pyx_cur_scope->__pyx_v_i])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_4;
@@ -12886,7 +13806,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_14HypergraphNode_8in_edges_2generator12(_
__pyx_L6_resume_from_yield:;
__pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
__pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
PyErr_SetNone(PyExc_StopIteration);
goto __pyx_L0;
@@ -12901,7 +13821,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_14HypergraphNode_8in_edges_2generator12(_
__Pyx_RefNannyFinishContext();
return NULL;
}
-static PyObject *__pyx_gb_4cdec_5_cdec_14HypergraphNode_9out_edges_2generator13(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4cdec_5_cdec_14HypergraphNode_9out_edges_2generator16(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
/* Python wrapper */
static PyObject *__pyx_pw_4cdec_5_cdec_14HypergraphNode_9out_edges_1__get__(PyObject *__pyx_v_self); /*proto*/
@@ -12914,7 +13834,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_14HypergraphNode_9out_edges_1__get__(PyOb
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":266
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":314
*
* property out_edges:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -12923,14 +13843,14 @@ static PyObject *__pyx_pw_4cdec_5_cdec_14HypergraphNode_9out_edges_1__get__(PyOb
*/
static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphNode_9out_edges___get__(struct __pyx_obj_4cdec_5_cdec_HypergraphNode *__pyx_v_self) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__ *__pyx_cur_scope;
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20___get__ *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- __pyx_cur_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__ *)__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_17___get__(__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_17___get__, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20___get__ *)__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_20___get__(__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_20___get__, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__Pyx_RefNannyFinishContext();
return NULL;
@@ -12940,7 +13860,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphNode_9out_edges___get__(struc
__Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
__Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_14HypergraphNode_9out_edges_2generator13, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_14HypergraphNode_9out_edges_2generator16, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -12958,9 +13878,9 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphNode_9out_edges___get__(struc
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_5_cdec_14HypergraphNode_9out_edges_2generator13(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4cdec_5_cdec_14HypergraphNode_9out_edges_2generator16(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__ *__pyx_cur_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__ *)__pyx_generator->closure);
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20___get__ *__pyx_cur_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20___get__ *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
size_t __pyx_t_1;
unsigned int __pyx_t_2;
@@ -12979,9 +13899,9 @@ static PyObject *__pyx_gb_4cdec_5_cdec_14HypergraphNode_9out_edges_2generator13(
return NULL;
}
__pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":268
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":316
* def __get__(self):
* cdef unsigned i
* for i in range(self.node.out_edges_.size()): # <<<<<<<<<<<<<<
@@ -12992,16 +13912,16 @@ static PyObject *__pyx_gb_4cdec_5_cdec_14HypergraphNode_9out_edges_2generator13(
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_cur_scope->__pyx_v_i = __pyx_t_2;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":269
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":317
* cdef unsigned i
* for i in range(self.node.out_edges_.size()):
* yield HypergraphEdge().init(self.hg, self.node.out_edges_[i]) # <<<<<<<<<<<<<<
*
* property span:
*/
- __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_HypergraphEdge)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4cdec_5_cdec_HypergraphEdge)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = ((struct __pyx_vtabstruct_4cdec_5_cdec_HypergraphEdge *)((struct __pyx_obj_4cdec_5_cdec_HypergraphEdge *)__pyx_t_3)->__pyx_vtab)->init(((struct __pyx_obj_4cdec_5_cdec_HypergraphEdge *)__pyx_t_3), __pyx_cur_scope->__pyx_v_self->hg, (__pyx_cur_scope->__pyx_v_self->node->out_edges_[__pyx_cur_scope->__pyx_v_i])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = ((struct __pyx_vtabstruct_4cdec_5_cdec_HypergraphEdge *)((struct __pyx_obj_4cdec_5_cdec_HypergraphEdge *)__pyx_t_3)->__pyx_vtab)->init(((struct __pyx_obj_4cdec_5_cdec_HypergraphEdge *)__pyx_t_3), __pyx_cur_scope->__pyx_v_self->hg, (__pyx_cur_scope->__pyx_v_self->node->out_edges_[__pyx_cur_scope->__pyx_v_i])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_4;
@@ -13016,7 +13936,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_14HypergraphNode_9out_edges_2generator13(
__pyx_L6_resume_from_yield:;
__pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
__pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
PyErr_SetNone(PyExc_StopIteration);
goto __pyx_L0;
@@ -13043,7 +13963,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_14HypergraphNode_4span_1__get__(PyObject
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":272
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":320
*
* property span:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -13061,7 +13981,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphNode_4span___get__(struct __p
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":273
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":321
* property span:
* def __get__(self):
* return next(self.in_edges).span # <<<<<<<<<<<<<<
@@ -13069,12 +13989,12 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphNode_4span___get__(struct __p
* property cat:
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__in_edges); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__in_edges); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 321; __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_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__span); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__span); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
@@ -13105,7 +14025,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_14HypergraphNode_3cat_1__get__(PyObject *
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":276
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":324
*
* property cat:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -13124,7 +14044,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphNode_3cat___get__(struct __py
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":277
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":325
* property cat:
* def __get__(self):
* if self.node.cat_: # <<<<<<<<<<<<<<
@@ -13134,7 +14054,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphNode_3cat___get__(struct __py
__pyx_t_1 = (__pyx_v_self->node->cat_ != 0);
if (__pyx_t_1) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":278
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":326
* def __get__(self):
* if self.node.cat_:
* return str(TDConvert(-self.node.cat_).c_str()) # <<<<<<<<<<<<<<
@@ -13142,14 +14062,14 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphNode_3cat___get__(struct __py
* def __richcmp__(HypergraphNode x, HypergraphNode y, int op):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyBytes_FromString(TD::Convert((-__pyx_v_self->node->cat_)).c_str()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyBytes_FromString(TD::Convert((-__pyx_v_self->node->cat_)).c_str()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
__Pyx_GIVEREF(((PyObject *)__pyx_t_2));
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 326; __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;
@@ -13181,8 +14101,8 @@ static PyObject *__pyx_pw_4cdec_5_cdec_14HypergraphNode_1__richcmp__(PyObject *_
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_4cdec_5_cdec_HypergraphNode, 1, "x", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_4cdec_5_cdec_HypergraphNode, 1, "y", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_4cdec_5_cdec_HypergraphNode, 1, "x", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_y), __pyx_ptype_4cdec_5_cdec_HypergraphNode, 1, "y", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_r = __pyx_pf_4cdec_5_cdec_14HypergraphNode___richcmp__(((struct __pyx_obj_4cdec_5_cdec_HypergraphNode *)__pyx_v_x), ((struct __pyx_obj_4cdec_5_cdec_HypergraphNode *)__pyx_v_y), ((int)__pyx_v_op));
goto __pyx_L0;
__pyx_L1_error:;
@@ -13192,7 +14112,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_14HypergraphNode_1__richcmp__(PyObject *_
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":280
+/* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":328
* return str(TDConvert(-self.node.cat_).c_str())
*
* def __richcmp__(HypergraphNode x, HypergraphNode y, int op): # <<<<<<<<<<<<<<
@@ -13210,7 +14130,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphNode___richcmp__(struct __pyx
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__richcmp__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":283
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":331
* if op == 2: # ==
* return x.node == y.node
* elif op == 3: # != # <<<<<<<<<<<<<<
@@ -13219,7 +14139,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphNode___richcmp__(struct __pyx
*/
switch (__pyx_v_op) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":281
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":329
*
* def __richcmp__(HypergraphNode x, HypergraphNode y, int op):
* if op == 2: # == # <<<<<<<<<<<<<<
@@ -13228,7 +14148,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphNode___richcmp__(struct __pyx
*/
case 2:
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":282
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":330
* def __richcmp__(HypergraphNode x, HypergraphNode y, int op):
* if op == 2: # ==
* return x.node == y.node # <<<<<<<<<<<<<<
@@ -13236,14 +14156,14 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphNode___richcmp__(struct __pyx
* return not (x == y)
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_x->node == __pyx_v_y->node)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_x->node == __pyx_v_y->node)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
break;
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":283
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":331
* if op == 2: # ==
* return x.node == y.node
* elif op == 3: # != # <<<<<<<<<<<<<<
@@ -13252,17 +14172,17 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphNode___richcmp__(struct __pyx
*/
case 3:
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":284
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":332
* return x.node == y.node
* elif op == 3: # !=
* return not (x == y) # <<<<<<<<<<<<<<
* raise NotImplemented('comparison not implemented for HypergraphNode')
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_x), ((PyObject *)__pyx_v_y), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 284; __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[3]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_x), ((PyObject *)__pyx_v_y), Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 332; __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[3]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyBool_FromLong((!__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong((!__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -13270,16 +14190,16 @@ static PyObject *__pyx_pf_4cdec_5_cdec_14HypergraphNode___richcmp__(struct __pyx
break;
}
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":285
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":333
* elif op == 3: # !=
* return not (x == y)
* raise NotImplemented('comparison not implemented for HypergraphNode') # <<<<<<<<<<<<<<
*/
- __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplemented, ((PyObject *)__pyx_k_tuple_21), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_builtin_NotImplemented, ((PyObject *)__pyx_k_tuple_21), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 333; __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[3]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[3]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
@@ -13307,7 +14227,7 @@ static int __pyx_pw_4cdec_5_cdec_7Lattice_1__cinit__(PyObject *__pyx_v_self, PyO
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":6
+/* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":6
* cdef lattice.Lattice* lattice
*
* def __cinit__(self): # <<<<<<<<<<<<<<
@@ -13320,7 +14240,7 @@ static int __pyx_pf_4cdec_5_cdec_7Lattice___cinit__(struct __pyx_obj_4cdec_5_cde
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":7
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":7
*
* def __cinit__(self):
* self.lattice = new lattice.Lattice() # <<<<<<<<<<<<<<
@@ -13388,7 +14308,7 @@ static int __pyx_pw_4cdec_5_cdec_7Lattice_3__init__(PyObject *__pyx_v_self, PyOb
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":9
+/* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":9
* self.lattice = new lattice.Lattice()
*
* def __init__(self, inp): # <<<<<<<<<<<<<<
@@ -13414,7 +14334,7 @@ static int __pyx_pf_4cdec_5_cdec_7Lattice_2__init__(struct __pyx_obj_4cdec_5_cde
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":12
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":12
* """Lattice(tuple) -> Lattice from node list.
* Lattice(string) -> Lattice from PLF representation."""
* if isinstance(inp, tuple): # <<<<<<<<<<<<<<
@@ -13425,7 +14345,7 @@ static int __pyx_pf_4cdec_5_cdec_7Lattice_2__init__(struct __pyx_obj_4cdec_5_cde
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":13
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":13
* Lattice(string) -> Lattice from PLF representation."""
* if isinstance(inp, tuple):
* self.lattice.resize(len(inp)) # <<<<<<<<<<<<<<
@@ -13435,7 +14355,7 @@ static int __pyx_pf_4cdec_5_cdec_7Lattice_2__init__(struct __pyx_obj_4cdec_5_cde
__pyx_t_3 = PyObject_Length(__pyx_v_inp); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->lattice->resize(__pyx_t_3);
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":14
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":14
* if isinstance(inp, tuple):
* self.lattice.resize(len(inp))
* for i, arcs in enumerate(inp): # <<<<<<<<<<<<<<
@@ -13490,7 +14410,7 @@ static int __pyx_pf_4cdec_5_cdec_7Lattice_2__init__(struct __pyx_obj_4cdec_5_cde
__pyx_t_4 = __pyx_t_7;
__pyx_t_7 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":15
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":15
* self.lattice.resize(len(inp))
* for i, arcs in enumerate(inp):
* self[i] = arcs # <<<<<<<<<<<<<<
@@ -13504,7 +14424,7 @@ static int __pyx_pf_4cdec_5_cdec_7Lattice_2__init__(struct __pyx_obj_4cdec_5_cde
goto __pyx_L3;
}
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":16
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":16
* for i, arcs in enumerate(inp):
* self[i] = arcs
* elif isinstance(inp, basestring): # <<<<<<<<<<<<<<
@@ -13515,7 +14435,7 @@ static int __pyx_pf_4cdec_5_cdec_7Lattice_2__init__(struct __pyx_obj_4cdec_5_cde
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":17
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":17
* self[i] = arcs
* elif isinstance(inp, basestring):
* lattice.ConvertTextOrPLF(as_str(inp), self.lattice) # <<<<<<<<<<<<<<
@@ -13531,7 +14451,7 @@ static int __pyx_pf_4cdec_5_cdec_7Lattice_2__init__(struct __pyx_obj_4cdec_5_cde
}
/*else*/ {
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":19
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":19
* lattice.ConvertTextOrPLF(as_str(inp), self.lattice)
* else:
* raise TypeError('cannot create lattice from %s' % type(inp)) # <<<<<<<<<<<<<<
@@ -13578,7 +14498,7 @@ static void __pyx_pw_4cdec_5_cdec_7Lattice_5__dealloc__(PyObject *__pyx_v_self)
__Pyx_RefNannyFinishContext();
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":21
+/* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":21
* raise TypeError('cannot create lattice from %s' % type(inp))
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -13590,7 +14510,7 @@ static void __pyx_pf_4cdec_5_cdec_7Lattice_4__dealloc__(CYTHON_UNUSED struct __p
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":22
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":22
*
* def __dealloc__(self):
* del self.lattice # <<<<<<<<<<<<<<
@@ -13626,7 +14546,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_7Lattice_7__getitem__(PyObject *__pyx_v_s
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":24
+/* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":24
* del self.lattice
*
* def __getitem__(self, int index): # <<<<<<<<<<<<<<
@@ -13656,7 +14576,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_7Lattice_6__getitem__(struct __pyx_obj_4c
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__getitem__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":25
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":25
*
* def __getitem__(self, int index):
* if not 0 <= index < len(self): # <<<<<<<<<<<<<<
@@ -13671,7 +14591,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_7Lattice_6__getitem__(struct __pyx_obj_4c
__pyx_t_3 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_3) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":26
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":26
* def __getitem__(self, int index):
* if not 0 <= index < len(self):
* raise IndexError('lattice index out of range') # <<<<<<<<<<<<<<
@@ -13687,7 +14607,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_7Lattice_6__getitem__(struct __pyx_obj_4c
}
__pyx_L3:;
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":27
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":27
* if not 0 <= index < len(self):
* raise IndexError('lattice index out of range')
* arcs = [] # <<<<<<<<<<<<<<
@@ -13699,7 +14619,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_7Lattice_6__getitem__(struct __pyx_obj_4c
__pyx_v_arcs = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":28
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":28
* raise IndexError('lattice index out of range')
* arcs = []
* cdef vector[lattice.LatticeArc] arc_vector = self.lattice[0][index] # <<<<<<<<<<<<<<
@@ -13708,7 +14628,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_7Lattice_6__getitem__(struct __pyx_obj_4c
*/
__pyx_v_arc_vector = ((__pyx_v_self->lattice[0])[__pyx_v_index]);
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":31
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":31
* cdef lattice.LatticeArc* arc
* cdef unsigned i
* for i in range(arc_vector.size()): # <<<<<<<<<<<<<<
@@ -13719,7 +14639,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_7Lattice_6__getitem__(struct __pyx_obj_4c
for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
__pyx_v_i = __pyx_t_6;
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":32
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":32
* cdef unsigned i
* for i in range(arc_vector.size()):
* arc = &arc_vector[i] # <<<<<<<<<<<<<<
@@ -13728,7 +14648,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_7Lattice_6__getitem__(struct __pyx_obj_4c
*/
__pyx_v_arc = (&(__pyx_v_arc_vector[__pyx_v_i]));
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":33
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":33
* for i in range(arc_vector.size()):
* arc = &arc_vector[i]
* label = unicode(TDConvert(arc.label).c_str(), 'utf8') # <<<<<<<<<<<<<<
@@ -13752,7 +14672,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_7Lattice_6__getitem__(struct __pyx_obj_4c
__pyx_v_label = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":34
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":34
* arc = &arc_vector[i]
* label = unicode(TDConvert(arc.label).c_str(), 'utf8')
* arcs.append((label, arc.cost, arc.dist2next)) # <<<<<<<<<<<<<<
@@ -13778,7 +14698,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_7Lattice_6__getitem__(struct __pyx_obj_4c
__Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
}
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":35
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":35
* label = unicode(TDConvert(arc.label).c_str(), 'utf8')
* arcs.append((label, arc.cost, arc.dist2next))
* return tuple(arcs) # <<<<<<<<<<<<<<
@@ -13837,7 +14757,7 @@ static int __pyx_pw_4cdec_5_cdec_7Lattice_9__setitem__(PyObject *__pyx_v_self, P
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":37
+/* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":37
* return tuple(arcs)
*
* def __setitem__(self, int index, tuple arcs): # <<<<<<<<<<<<<<
@@ -13871,7 +14791,7 @@ static int __pyx_pf_4cdec_5_cdec_7Lattice_8__setitem__(struct __pyx_obj_4cdec_5_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__setitem__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":38
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":38
*
* def __setitem__(self, int index, tuple arcs):
* if not 0 <= index < len(self): # <<<<<<<<<<<<<<
@@ -13886,7 +14806,7 @@ static int __pyx_pf_4cdec_5_cdec_7Lattice_8__setitem__(struct __pyx_obj_4cdec_5_
__pyx_t_3 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_3) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":39
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":39
* def __setitem__(self, int index, tuple arcs):
* if not 0 <= index < len(self):
* raise IndexError('lattice index out of range') # <<<<<<<<<<<<<<
@@ -13902,7 +14822,7 @@ static int __pyx_pf_4cdec_5_cdec_7Lattice_8__setitem__(struct __pyx_obj_4cdec_5_
}
__pyx_L3:;
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":41
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":41
* raise IndexError('lattice index out of range')
* cdef lattice.LatticeArc* arc
* for (label, cost, dist2next) in arcs: # <<<<<<<<<<<<<<
@@ -13989,7 +14909,7 @@ static int __pyx_pf_4cdec_5_cdec_7Lattice_8__setitem__(struct __pyx_obj_4cdec_5_
__pyx_v_dist2next = __pyx_t_8;
__pyx_t_8 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":42
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":42
* cdef lattice.LatticeArc* arc
* for (label, cost, dist2next) in arcs:
* label_str = as_str(label) # <<<<<<<<<<<<<<
@@ -14002,7 +14922,7 @@ static int __pyx_pf_4cdec_5_cdec_7Lattice_8__setitem__(struct __pyx_obj_4cdec_5_
__pyx_v_label_str = ((PyObject*)__pyx_t_5);
__pyx_t_5 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":43
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":43
* for (label, cost, dist2next) in arcs:
* label_str = as_str(label)
* arc = new lattice.LatticeArc(TDConvert(label_str), cost, dist2next) # <<<<<<<<<<<<<<
@@ -14014,7 +14934,7 @@ static int __pyx_pf_4cdec_5_cdec_7Lattice_8__setitem__(struct __pyx_obj_4cdec_5_
__pyx_t_13 = __Pyx_PyInt_AsInt(__pyx_v_dist2next); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_arc = new LatticeArc(TD::Convert(__pyx_t_11), __pyx_t_12, __pyx_t_13);
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":44
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":44
* label_str = as_str(label)
* arc = new lattice.LatticeArc(TDConvert(label_str), cost, dist2next)
* self.lattice[0][index].push_back(arc[0]) # <<<<<<<<<<<<<<
@@ -14023,7 +14943,7 @@ static int __pyx_pf_4cdec_5_cdec_7Lattice_8__setitem__(struct __pyx_obj_4cdec_5_
*/
((__pyx_v_self->lattice[0])[__pyx_v_index]).push_back((__pyx_v_arc[0]));
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":45
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":45
* arc = new lattice.LatticeArc(TDConvert(label_str), cost, dist2next)
* self.lattice[0][index].push_back(arc[0])
* del arc # <<<<<<<<<<<<<<
@@ -14065,7 +14985,7 @@ static Py_ssize_t __pyx_pw_4cdec_5_cdec_7Lattice_11__len__(PyObject *__pyx_v_sel
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":47
+/* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":47
* del arc
*
* def __len__(self): # <<<<<<<<<<<<<<
@@ -14078,7 +14998,7 @@ static Py_ssize_t __pyx_pf_4cdec_5_cdec_7Lattice_10__len__(struct __pyx_obj_4cde
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__len__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":48
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":48
*
* def __len__(self):
* return self.lattice.size() # <<<<<<<<<<<<<<
@@ -14105,7 +15025,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_7Lattice_13__str__(PyObject *__pyx_v_self
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":50
+/* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":50
* return self.lattice.size()
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -14123,7 +15043,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_7Lattice_12__str__(struct __pyx_obj_4cdec
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__str__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":51
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":51
*
* def __str__(self):
* return str(hypergraph.AsPLF(self.lattice[0], True).c_str()) # <<<<<<<<<<<<<<
@@ -14169,7 +15089,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_7Lattice_15__unicode__(PyObject *__pyx_v_
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":53
+/* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":53
* return str(hypergraph.AsPLF(self.lattice[0], True).c_str())
*
* def __unicode__(self): # <<<<<<<<<<<<<<
@@ -14187,7 +15107,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_7Lattice_14__unicode__(struct __pyx_obj_4
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__unicode__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":54
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":54
*
* def __unicode__(self):
* return unicode(str(self), 'utf8') # <<<<<<<<<<<<<<
@@ -14230,7 +15150,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_7Lattice_14__unicode__(struct __pyx_obj_4
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_5_cdec_7Lattice_18generator14(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4cdec_5_cdec_7Lattice_18generator17(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
/* Python wrapper */
static PyObject *__pyx_pw_4cdec_5_cdec_7Lattice_17__iter__(PyObject *__pyx_v_self); /*proto*/
@@ -14243,7 +15163,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_7Lattice_17__iter__(PyObject *__pyx_v_sel
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":56
+/* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":56
* return unicode(str(self), 'utf8')
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -14252,14 +15172,14 @@ static PyObject *__pyx_pw_4cdec_5_cdec_7Lattice_17__iter__(PyObject *__pyx_v_sel
*/
static PyObject *__pyx_pf_4cdec_5_cdec_7Lattice_16__iter__(struct __pyx_obj_4cdec_5_cdec_Lattice *__pyx_v_self) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___iter__ *__pyx_cur_scope;
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_21___iter__ *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__iter__", 0);
- __pyx_cur_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___iter__ *)__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_18___iter__(__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_18___iter__, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_21___iter__ *)__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_21___iter__(__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_21___iter__, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__Pyx_RefNannyFinishContext();
return NULL;
@@ -14269,7 +15189,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_7Lattice_16__iter__(struct __pyx_obj_4cde
__Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
__Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_7Lattice_18generator14, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_7Lattice_18generator17, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -14287,9 +15207,9 @@ static PyObject *__pyx_pf_4cdec_5_cdec_7Lattice_16__iter__(struct __pyx_obj_4cde
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_5_cdec_7Lattice_18generator14(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4cdec_5_cdec_7Lattice_18generator17(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___iter__ *__pyx_cur_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___iter__ *)__pyx_generator->closure);
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_21___iter__ *__pyx_cur_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_21___iter__ *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
Py_ssize_t __pyx_t_1;
unsigned int __pyx_t_2;
@@ -14309,7 +15229,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_7Lattice_18generator14(__pyx_GeneratorObj
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":58
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":58
* def __iter__(self):
* cdef unsigned i
* for i in range(len(self)): # <<<<<<<<<<<<<<
@@ -14320,7 +15240,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_7Lattice_18generator14(__pyx_GeneratorObj
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_cur_scope->__pyx_v_i = __pyx_t_2;
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":59
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":59
* cdef unsigned i
* for i in range(len(self)):
* yield self[i] # <<<<<<<<<<<<<<
@@ -14367,7 +15287,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_7Lattice_20todot(PyObject *__pyx_v_self,
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_5_cdec_7Lattice_5todot_2generator20(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4cdec_5_cdec_7Lattice_5todot_2generator23(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
/* Python wrapper */
static PyObject *__pyx_pw_4cdec_5_cdec_7Lattice_5todot_1lines(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
@@ -14381,7 +15301,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_7Lattice_5todot_1lines(PyObject *__pyx_se
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":63
+/* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":63
* def todot(self):
* """lattice.todot() -> Representation of the lattice in GraphViz dot format."""
* def lines(): # <<<<<<<<<<<<<<
@@ -14390,24 +15310,24 @@ static PyObject *__pyx_pw_4cdec_5_cdec_7Lattice_5todot_1lines(PyObject *__pyx_se
*/
static PyObject *__pyx_pf_4cdec_5_cdec_7Lattice_5todot_lines(PyObject *__pyx_self) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20_lines *__pyx_cur_scope;
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23_lines *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("lines", 0);
- __pyx_cur_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20_lines *)__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_20_lines(__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_20_lines, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23_lines *)__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_23_lines(__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_23_lines, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__Pyx_RefNannyFinishContext();
return NULL;
}
__Pyx_GOTREF(__pyx_cur_scope);
- __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19_todot *) __Pyx_CyFunction_GetClosure(__pyx_self);
+ __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22_todot *) __Pyx_CyFunction_GetClosure(__pyx_self);
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_7Lattice_5todot_2generator20, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_7Lattice_5todot_2generator23, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -14425,9 +15345,9 @@ static PyObject *__pyx_pf_4cdec_5_cdec_7Lattice_5todot_lines(PyObject *__pyx_sel
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_5_cdec_7Lattice_5todot_2generator20(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4cdec_5_cdec_7Lattice_5todot_2generator23(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20_lines *__pyx_cur_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20_lines *)__pyx_generator->closure);
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23_lines *__pyx_cur_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23_lines *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
@@ -14461,7 +15381,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_7Lattice_5todot_2generator20(__pyx_Genera
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":64
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":64
* """lattice.todot() -> Representation of the lattice in GraphViz dot format."""
* def lines():
* yield 'digraph lattice {' # <<<<<<<<<<<<<<
@@ -14478,7 +15398,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_7Lattice_5todot_2generator20(__pyx_Genera
__pyx_L4_resume_from_yield:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":65
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":65
* def lines():
* yield 'digraph lattice {'
* yield 'rankdir = LR;' # <<<<<<<<<<<<<<
@@ -14495,7 +15415,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_7Lattice_5todot_2generator20(__pyx_Genera
__pyx_L5_resume_from_yield:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":66
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":66
* yield 'digraph lattice {'
* yield 'rankdir = LR;'
* yield 'node [shape=circle];' # <<<<<<<<<<<<<<
@@ -14512,7 +15432,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_7Lattice_5todot_2generator20(__pyx_Genera
__pyx_L6_resume_from_yield:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":67
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":67
* yield 'rankdir = LR;'
* yield 'node [shape=circle];'
* for i in range(len(self)): # <<<<<<<<<<<<<<
@@ -14575,7 +15495,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_7Lattice_5todot_2generator20(__pyx_Genera
__pyx_cur_scope->__pyx_v_i = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":68
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":68
* yield 'node [shape=circle];'
* for i in range(len(self)):
* for label, weight, delta in self[i]: # <<<<<<<<<<<<<<
@@ -14693,7 +15613,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_7Lattice_5todot_2generator20(__pyx_Genera
__pyx_cur_scope->__pyx_v_delta = __pyx_t_10;
__pyx_t_10 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":69
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":69
* for i in range(len(self)):
* for label, weight, delta in self[i]:
* yield '%d -> %d [label="%s"];' % (i, i+delta, label.replace('"', '\\"')) # <<<<<<<<<<<<<<
@@ -14753,7 +15673,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_7Lattice_5todot_2generator20(__pyx_Genera
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":70
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":70
* for label, weight, delta in self[i]:
* yield '%d -> %d [label="%s"];' % (i, i+delta, label.replace('"', '\\"'))
* yield '%d [shape=doublecircle]' % len(self) # <<<<<<<<<<<<<<
@@ -14779,7 +15699,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_7Lattice_5todot_2generator20(__pyx_Genera
__pyx_L14_resume_from_yield:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":71
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":71
* yield '%d -> %d [label="%s"];' % (i, i+delta, label.replace('"', '\\"'))
* yield '%d [shape=doublecircle]' % len(self)
* yield '}' # <<<<<<<<<<<<<<
@@ -14814,7 +15734,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_7Lattice_5todot_2generator20(__pyx_Genera
return NULL;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":61
+/* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":61
* yield self[i]
*
* def todot(self): # <<<<<<<<<<<<<<
@@ -14823,7 +15743,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_7Lattice_5todot_2generator20(__pyx_Genera
*/
static PyObject *__pyx_pf_4cdec_5_cdec_7Lattice_19todot(struct __pyx_obj_4cdec_5_cdec_Lattice *__pyx_v_self) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19_todot *__pyx_cur_scope;
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22_todot *__pyx_cur_scope;
PyObject *__pyx_v_lines = 0;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
@@ -14834,7 +15754,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_7Lattice_19todot(struct __pyx_obj_4cdec_5
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("todot", 0);
- __pyx_cur_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19_todot *)__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_19_todot(__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_19_todot, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22_todot *)__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_22_todot(__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_22_todot, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__Pyx_RefNannyFinishContext();
return NULL;
@@ -14844,7 +15764,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_7Lattice_19todot(struct __pyx_obj_4cdec_5
__Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
__Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":63
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":63
* def todot(self):
* """lattice.todot() -> Representation of the lattice in GraphViz dot format."""
* def lines(): # <<<<<<<<<<<<<<
@@ -14856,7 +15776,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_7Lattice_19todot(struct __pyx_obj_4cdec_5
__pyx_v_lines = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":72
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":72
* yield '%d [shape=doublecircle]' % len(self)
* yield '}'
* return '\n'.join(lines()).encode('utf8') # <<<<<<<<<<<<<<
@@ -14915,7 +15835,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_7Lattice_22as_hypergraph(PyObject *__pyx_
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":74
+/* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":74
* return '\n'.join(lines()).encode('utf8')
*
* def as_hypergraph(self): # <<<<<<<<<<<<<<
@@ -14936,7 +15856,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_7Lattice_21as_hypergraph(struct __pyx_obj
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("as_hypergraph", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":76
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":76
* def as_hypergraph(self):
* """lattice.as_hypergraph() -> Hypergraph representation of the lattice."""
* cdef Hypergraph result = Hypergraph.__new__(Hypergraph) # <<<<<<<<<<<<<<
@@ -14949,7 +15869,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_7Lattice_21as_hypergraph(struct __pyx_obj
__pyx_v_result = ((struct __pyx_obj_4cdec_5_cdec_Hypergraph *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":77
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":77
* """lattice.as_hypergraph() -> Hypergraph representation of the lattice."""
* cdef Hypergraph result = Hypergraph.__new__(Hypergraph)
* result.hg = new hypergraph.Hypergraph() # <<<<<<<<<<<<<<
@@ -14958,7 +15878,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_7Lattice_21as_hypergraph(struct __pyx_obj
*/
__pyx_v_result->hg = new Hypergraph();
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":78
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":78
* cdef Hypergraph result = Hypergraph.__new__(Hypergraph)
* result.hg = new hypergraph.Hypergraph()
* cdef bytes plf = str(self) # <<<<<<<<<<<<<<
@@ -14977,7 +15897,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_7Lattice_21as_hypergraph(struct __pyx_obj
__pyx_v_plf = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":79
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":79
* result.hg = new hypergraph.Hypergraph()
* cdef bytes plf = str(self)
* hypergraph.ReadFromPLF(plf, result.hg) # <<<<<<<<<<<<<<
@@ -14986,7 +15906,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_7Lattice_21as_hypergraph(struct __pyx_obj
__pyx_t_3 = __pyx_convert_string_from_py_(((PyObject *)__pyx_v_plf)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
HypergraphIO::ReadFromPLF(__pyx_t_3, __pyx_v_result->hg);
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":80
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":80
* cdef bytes plf = str(self)
* hypergraph.ReadFromPLF(plf, result.hg)
* return result # <<<<<<<<<<<<<<
@@ -15011,7 +15931,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_7Lattice_21as_hypergraph(struct __pyx_obj
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":3
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":3
* cimport mteval
*
* cdef SufficientStats as_stats(x, y): # <<<<<<<<<<<<<<
@@ -15033,7 +15953,7 @@ static struct __pyx_obj_4cdec_5_cdec_SufficientStats *__pyx_f_4cdec_5_cdec_as_st
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("as_stats", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":4
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":4
*
* cdef SufficientStats as_stats(x, y):
* if isinstance(x, SufficientStats): # <<<<<<<<<<<<<<
@@ -15044,7 +15964,7 @@ static struct __pyx_obj_4cdec_5_cdec_SufficientStats *__pyx_f_4cdec_5_cdec_as_st
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":5
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":5
* cdef SufficientStats as_stats(x, y):
* if isinstance(x, SufficientStats):
* return x # <<<<<<<<<<<<<<
@@ -15059,7 +15979,7 @@ static struct __pyx_obj_4cdec_5_cdec_SufficientStats *__pyx_f_4cdec_5_cdec_as_st
goto __pyx_L3;
}
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":6
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":6
* if isinstance(x, SufficientStats):
* return x
* elif x == 0 and isinstance(y, SufficientStats): # <<<<<<<<<<<<<<
@@ -15077,7 +15997,7 @@ static struct __pyx_obj_4cdec_5_cdec_SufficientStats *__pyx_f_4cdec_5_cdec_as_st
}
if (__pyx_t_4) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":7
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":7
* return x
* elif x == 0 and isinstance(y, SufficientStats):
* stats = SufficientStats() # <<<<<<<<<<<<<<
@@ -15089,7 +16009,7 @@ static struct __pyx_obj_4cdec_5_cdec_SufficientStats *__pyx_f_4cdec_5_cdec_as_st
__pyx_v_stats = ((struct __pyx_obj_4cdec_5_cdec_SufficientStats *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":8
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":8
* elif x == 0 and isinstance(y, SufficientStats):
* stats = SufficientStats()
* stats.stats = new mteval.SufficientStats() # <<<<<<<<<<<<<<
@@ -15098,7 +16018,7 @@ static struct __pyx_obj_4cdec_5_cdec_SufficientStats *__pyx_f_4cdec_5_cdec_as_st
*/
__pyx_v_stats->stats = new SufficientStats();
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":9
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":9
* stats = SufficientStats()
* stats.stats = new mteval.SufficientStats()
* stats.metric = (<SufficientStats> y).metric # <<<<<<<<<<<<<<
@@ -15108,7 +16028,7 @@ static struct __pyx_obj_4cdec_5_cdec_SufficientStats *__pyx_f_4cdec_5_cdec_as_st
__pyx_t_5 = ((struct __pyx_obj_4cdec_5_cdec_SufficientStats *)__pyx_v_y)->metric;
__pyx_v_stats->metric = __pyx_t_5;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":10
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":10
* stats.stats = new mteval.SufficientStats()
* stats.metric = (<SufficientStats> y).metric
* return stats # <<<<<<<<<<<<<<
@@ -15147,7 +16067,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_9Candidate_5words_1__get__(PyObject *__py
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":17
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":17
*
* property words:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -15166,7 +16086,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_9Candidate_5words___get__(struct __pyx_ob
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":18
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":18
* property words:
* def __get__(self):
* return unicode(GetString(self.candidate.ewords).c_str(), encoding='utf8') # <<<<<<<<<<<<<<
@@ -15217,7 +16137,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_9Candidate_4fmap_1__get__(PyObject *__pyx
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":21
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":21
*
* property fmap:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -15235,7 +16155,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_9Candidate_4fmap___get__(struct __pyx_obj
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":22
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":22
* property fmap:
* def __get__(self):
* cdef SparseVector fmap = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<<
@@ -15248,7 +16168,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_9Candidate_4fmap___get__(struct __pyx_obj
__pyx_v_fmap = ((struct __pyx_obj_4cdec_5_cdec_SparseVector *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":23
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":23
* def __get__(self):
* cdef SparseVector fmap = SparseVector.__new__(SparseVector)
* fmap.vector = new FastSparseVector[weight_t](self.candidate.fmap) # <<<<<<<<<<<<<<
@@ -15257,7 +16177,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_9Candidate_4fmap___get__(struct __pyx_obj
*/
__pyx_v_fmap->vector = new FastSparseVector<weight_t>(__pyx_v_self->candidate->fmap);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":24
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":24
* cdef SparseVector fmap = SparseVector.__new__(SparseVector)
* fmap.vector = new FastSparseVector[weight_t](self.candidate.fmap)
* return fmap # <<<<<<<<<<<<<<
@@ -15293,7 +16213,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_9Candidate_5score_1__get__(PyObject *__py
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":14
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":14
* cdef class Candidate:
* cdef mteval.const_Candidate* candidate
* cdef public float score # <<<<<<<<<<<<<<
@@ -15369,7 +16289,7 @@ static void __pyx_pw_4cdec_5_cdec_15SufficientStats_1__dealloc__(PyObject *__pyx
__Pyx_RefNannyFinishContext();
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":30
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":30
* cdef mteval.EvaluationMetric* metric
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -15381,7 +16301,7 @@ static void __pyx_pf_4cdec_5_cdec_15SufficientStats___dealloc__(CYTHON_UNUSED st
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":31
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":31
*
* def __dealloc__(self):
* del self.stats # <<<<<<<<<<<<<<
@@ -15404,7 +16324,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_15SufficientStats_5score_1__get__(PyObjec
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":34
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":34
*
* property score:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -15421,7 +16341,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_15SufficientStats_5score___get__(struct _
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":35
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":35
* property score:
* def __get__(self):
* return self.metric.ComputeScore(self.stats[0]) # <<<<<<<<<<<<<<
@@ -15458,7 +16378,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_15SufficientStats_6detail_1__get__(PyObje
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":38
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":38
*
* property detail:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -15476,7 +16396,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_15SufficientStats_6detail___get__(struct
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":39
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":39
* property detail:
* def __get__(self):
* return str(self.metric.DetailedScore(self.stats[0]).c_str()) # <<<<<<<<<<<<<<
@@ -15522,7 +16442,7 @@ static Py_ssize_t __pyx_pw_4cdec_5_cdec_15SufficientStats_3__len__(PyObject *__p
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":41
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":41
* return str(self.metric.DetailedScore(self.stats[0]).c_str())
*
* def __len__(self): # <<<<<<<<<<<<<<
@@ -15535,7 +16455,7 @@ static Py_ssize_t __pyx_pf_4cdec_5_cdec_15SufficientStats_2__len__(struct __pyx_
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__len__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":42
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":42
*
* def __len__(self):
* return self.stats.size() # <<<<<<<<<<<<<<
@@ -15550,7 +16470,7 @@ static Py_ssize_t __pyx_pf_4cdec_5_cdec_15SufficientStats_2__len__(struct __pyx_
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_5_cdec_15SufficientStats_6generator15(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4cdec_5_cdec_15SufficientStats_6generator18(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
/* Python wrapper */
static PyObject *__pyx_pw_4cdec_5_cdec_15SufficientStats_5__iter__(PyObject *__pyx_v_self); /*proto*/
@@ -15563,7 +16483,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_15SufficientStats_5__iter__(PyObject *__p
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":44
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":44
* return self.stats.size()
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -15572,14 +16492,14 @@ static PyObject *__pyx_pw_4cdec_5_cdec_15SufficientStats_5__iter__(PyObject *__p
*/
static PyObject *__pyx_pf_4cdec_5_cdec_15SufficientStats_4__iter__(struct __pyx_obj_4cdec_5_cdec_SufficientStats *__pyx_v_self) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_21___iter__ *__pyx_cur_scope;
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___iter__ *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__iter__", 0);
- __pyx_cur_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_21___iter__ *)__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_21___iter__(__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_21___iter__, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___iter__ *)__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_24___iter__(__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_24___iter__, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__Pyx_RefNannyFinishContext();
return NULL;
@@ -15589,7 +16509,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_15SufficientStats_4__iter__(struct __pyx_
__Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
__Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_15SufficientStats_6generator15, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_15SufficientStats_6generator18, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -15607,9 +16527,9 @@ static PyObject *__pyx_pf_4cdec_5_cdec_15SufficientStats_4__iter__(struct __pyx_
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_5_cdec_15SufficientStats_6generator15(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4cdec_5_cdec_15SufficientStats_6generator18(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_21___iter__ *__pyx_cur_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_21___iter__ *)__pyx_generator->closure);
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___iter__ *__pyx_cur_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___iter__ *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
Py_ssize_t __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
@@ -15630,7 +16550,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_15SufficientStats_6generator15(__pyx_Gene
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":45
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":45
*
* def __iter__(self):
* for i in range(len(self)): # <<<<<<<<<<<<<<
@@ -15689,7 +16609,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_15SufficientStats_6generator15(__pyx_Gene
__pyx_cur_scope->__pyx_v_i = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":46
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":46
* def __iter__(self):
* for i in range(len(self)):
* yield self[i] # <<<<<<<<<<<<<<
@@ -15756,7 +16676,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_15SufficientStats_8__getitem__(PyObject *
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":48
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":48
* yield self[i]
*
* def __getitem__(self, int index): # <<<<<<<<<<<<<<
@@ -15776,7 +16696,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_15SufficientStats_7__getitem__(struct __p
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__getitem__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":49
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":49
*
* def __getitem__(self, int index):
* if not 0 <= index < len(self): # <<<<<<<<<<<<<<
@@ -15791,7 +16711,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_15SufficientStats_7__getitem__(struct __p
__pyx_t_3 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_3) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":50
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":50
* def __getitem__(self, int index):
* if not 0 <= index < len(self):
* raise IndexError('sufficient stats vector index out of range') # <<<<<<<<<<<<<<
@@ -15807,7 +16727,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_15SufficientStats_7__getitem__(struct __p
}
__pyx_L3:;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":51
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":51
* if not 0 <= index < len(self):
* raise IndexError('sufficient stats vector index out of range')
* return self.stats[0][index] # <<<<<<<<<<<<<<
@@ -15852,7 +16772,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_15SufficientStats_10__iadd__(PyObject *__
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":53
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":53
* return self.stats[0][index]
*
* def __iadd__(SufficientStats self, SufficientStats other): # <<<<<<<<<<<<<<
@@ -15865,7 +16785,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_15SufficientStats_9__iadd__(struct __pyx_
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iadd__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":54
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":54
*
* def __iadd__(SufficientStats self, SufficientStats other):
* self.stats[0] += other.stats[0] # <<<<<<<<<<<<<<
@@ -15874,7 +16794,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_15SufficientStats_9__iadd__(struct __pyx_
*/
(__pyx_v_self->stats[0]) += (__pyx_v_other->stats[0]);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":55
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":55
* def __iadd__(SufficientStats self, SufficientStats other):
* self.stats[0] += other.stats[0]
* return self # <<<<<<<<<<<<<<
@@ -15904,7 +16824,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_15SufficientStats_12__add__(PyObject *__p
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":57
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":57
* return self
*
* def __add__(x, y): # <<<<<<<<<<<<<<
@@ -15925,7 +16845,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_15SufficientStats_11__add__(PyObject *__p
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__add__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":58
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":58
*
* def __add__(x, y):
* cdef SufficientStats sx = as_stats(x, y) # <<<<<<<<<<<<<<
@@ -15937,7 +16857,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_15SufficientStats_11__add__(PyObject *__p
__pyx_v_sx = ((struct __pyx_obj_4cdec_5_cdec_SufficientStats *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":59
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":59
* def __add__(x, y):
* cdef SufficientStats sx = as_stats(x, y)
* cdef SufficientStats sy = as_stats(y, x) # <<<<<<<<<<<<<<
@@ -15949,7 +16869,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_15SufficientStats_11__add__(PyObject *__p
__pyx_v_sy = ((struct __pyx_obj_4cdec_5_cdec_SufficientStats *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":60
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":60
* cdef SufficientStats sx = as_stats(x, y)
* cdef SufficientStats sy = as_stats(y, x)
* cdef SufficientStats result = SufficientStats() # <<<<<<<<<<<<<<
@@ -15961,7 +16881,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_15SufficientStats_11__add__(PyObject *__p
__pyx_v_result = ((struct __pyx_obj_4cdec_5_cdec_SufficientStats *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":61
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":61
* cdef SufficientStats sy = as_stats(y, x)
* cdef SufficientStats result = SufficientStats()
* result.stats = new mteval.SufficientStats(mteval.add(sx.stats[0], sy.stats[0])) # <<<<<<<<<<<<<<
@@ -15970,7 +16890,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_15SufficientStats_11__add__(PyObject *__p
*/
__pyx_v_result->stats = new SufficientStats(operator+((__pyx_v_sx->stats[0]), (__pyx_v_sy->stats[0])));
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":62
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":62
* cdef SufficientStats result = SufficientStats()
* result.stats = new mteval.SufficientStats(mteval.add(sx.stats[0], sy.stats[0]))
* result.metric = sx.metric # <<<<<<<<<<<<<<
@@ -15980,7 +16900,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_15SufficientStats_11__add__(PyObject *__p
__pyx_t_2 = __pyx_v_sx->metric;
__pyx_v_result->metric = __pyx_t_2;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":63
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":63
* result.stats = new mteval.SufficientStats(mteval.add(sx.stats[0], sy.stats[0]))
* result.metric = sx.metric
* return result # <<<<<<<<<<<<<<
@@ -16062,7 +16982,7 @@ static int __pyx_pw_4cdec_5_cdec_12CandidateSet_1__cinit__(PyObject *__pyx_v_sel
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":70
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":70
* cdef mteval.CandidateSet* cs
*
* def __cinit__(self, SegmentEvaluator evaluator): # <<<<<<<<<<<<<<
@@ -16076,7 +16996,7 @@ static int __pyx_pf_4cdec_5_cdec_12CandidateSet___cinit__(struct __pyx_obj_4cdec
EvaluationMetric *__pyx_t_1;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":71
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":71
*
* def __cinit__(self, SegmentEvaluator evaluator):
* self.scorer = new shared_ptr[mteval.SegmentEvaluator](evaluator.scorer[0]) # <<<<<<<<<<<<<<
@@ -16085,7 +17005,7 @@ static int __pyx_pf_4cdec_5_cdec_12CandidateSet___cinit__(struct __pyx_obj_4cdec
*/
__pyx_v_self->scorer = new boost::shared_ptr<SegmentEvaluator>((__pyx_v_evaluator->scorer[0]));
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":72
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":72
* def __cinit__(self, SegmentEvaluator evaluator):
* self.scorer = new shared_ptr[mteval.SegmentEvaluator](evaluator.scorer[0])
* self.metric = evaluator.metric # <<<<<<<<<<<<<<
@@ -16095,7 +17015,7 @@ static int __pyx_pf_4cdec_5_cdec_12CandidateSet___cinit__(struct __pyx_obj_4cdec
__pyx_t_1 = __pyx_v_evaluator->metric;
__pyx_v_self->metric = __pyx_t_1;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":73
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":73
* self.scorer = new shared_ptr[mteval.SegmentEvaluator](evaluator.scorer[0])
* self.metric = evaluator.metric
* self.cs = new mteval.CandidateSet() # <<<<<<<<<<<<<<
@@ -16118,7 +17038,7 @@ static void __pyx_pw_4cdec_5_cdec_12CandidateSet_3__dealloc__(PyObject *__pyx_v_
__Pyx_RefNannyFinishContext();
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":75
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":75
* self.cs = new mteval.CandidateSet()
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -16130,7 +17050,7 @@ static void __pyx_pf_4cdec_5_cdec_12CandidateSet_2__dealloc__(CYTHON_UNUSED stru
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":76
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":76
*
* def __dealloc__(self):
* del self.scorer # <<<<<<<<<<<<<<
@@ -16139,7 +17059,7 @@ static void __pyx_pf_4cdec_5_cdec_12CandidateSet_2__dealloc__(CYTHON_UNUSED stru
*/
delete __pyx_v_self->scorer;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":77
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":77
* def __dealloc__(self):
* del self.scorer
* del self.cs # <<<<<<<<<<<<<<
@@ -16162,7 +17082,7 @@ static Py_ssize_t __pyx_pw_4cdec_5_cdec_12CandidateSet_5__len__(PyObject *__pyx_
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":79
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":79
* del self.cs
*
* def __len__(self): # <<<<<<<<<<<<<<
@@ -16175,7 +17095,7 @@ static Py_ssize_t __pyx_pf_4cdec_5_cdec_12CandidateSet_4__len__(struct __pyx_obj
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__len__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":80
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":80
*
* def __len__(self):
* return self.cs.size() # <<<<<<<<<<<<<<
@@ -16215,7 +17135,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_12CandidateSet_7__getitem__(PyObject *__p
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":82
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":82
* return self.cs.size()
*
* def __getitem__(self,int k): # <<<<<<<<<<<<<<
@@ -16235,7 +17155,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12CandidateSet_6__getitem__(struct __pyx_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__getitem__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":83
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":83
*
* def __getitem__(self,int k):
* if not 0 <= k < self.cs.size(): # <<<<<<<<<<<<<<
@@ -16249,7 +17169,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12CandidateSet_6__getitem__(struct __pyx_
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":84
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":84
* def __getitem__(self,int k):
* if not 0 <= k < self.cs.size():
* raise IndexError('candidate set index out of range') # <<<<<<<<<<<<<<
@@ -16265,7 +17185,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12CandidateSet_6__getitem__(struct __pyx_
}
__pyx_L3:;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":85
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":85
* if not 0 <= k < self.cs.size():
* raise IndexError('candidate set index out of range')
* cdef Candidate candidate = Candidate() # <<<<<<<<<<<<<<
@@ -16277,7 +17197,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12CandidateSet_6__getitem__(struct __pyx_
__pyx_v_candidate = ((struct __pyx_obj_4cdec_5_cdec_Candidate *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":86
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":86
* raise IndexError('candidate set index out of range')
* cdef Candidate candidate = Candidate()
* candidate.candidate = &self.cs[0][k] # <<<<<<<<<<<<<<
@@ -16286,7 +17206,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12CandidateSet_6__getitem__(struct __pyx_
*/
__pyx_v_candidate->candidate = (&((__pyx_v_self->cs[0])[__pyx_v_k]));
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":87
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":87
* cdef Candidate candidate = Candidate()
* candidate.candidate = &self.cs[0][k]
* candidate.score = self.metric.ComputeScore(self.cs[0][k].eval_feats) # <<<<<<<<<<<<<<
@@ -16295,7 +17215,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12CandidateSet_6__getitem__(struct __pyx_
*/
__pyx_v_candidate->score = __pyx_v_self->metric->ComputeScore(((__pyx_v_self->cs[0])[__pyx_v_k]).eval_feats);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":88
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":88
* candidate.candidate = &self.cs[0][k]
* candidate.score = self.metric.ComputeScore(self.cs[0][k].eval_feats)
* return candidate # <<<<<<<<<<<<<<
@@ -16319,7 +17239,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12CandidateSet_6__getitem__(struct __pyx_
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_5_cdec_12CandidateSet_10generator16(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4cdec_5_cdec_12CandidateSet_10generator19(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
/* Python wrapper */
static PyObject *__pyx_pw_4cdec_5_cdec_12CandidateSet_9__iter__(PyObject *__pyx_v_self); /*proto*/
@@ -16332,7 +17252,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_12CandidateSet_9__iter__(PyObject *__pyx_
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":90
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":90
* return candidate
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -16341,14 +17261,14 @@ static PyObject *__pyx_pw_4cdec_5_cdec_12CandidateSet_9__iter__(PyObject *__pyx_
*/
static PyObject *__pyx_pf_4cdec_5_cdec_12CandidateSet_8__iter__(struct __pyx_obj_4cdec_5_cdec_CandidateSet *__pyx_v_self) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22___iter__ *__pyx_cur_scope;
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25___iter__ *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__iter__", 0);
- __pyx_cur_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22___iter__ *)__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_22___iter__(__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_22___iter__, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25___iter__ *)__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_25___iter__(__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_25___iter__, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__Pyx_RefNannyFinishContext();
return NULL;
@@ -16358,7 +17278,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12CandidateSet_8__iter__(struct __pyx_obj
__Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
__Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_12CandidateSet_10generator16, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_12CandidateSet_10generator19, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -16376,9 +17296,9 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12CandidateSet_8__iter__(struct __pyx_obj
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_5_cdec_12CandidateSet_10generator16(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4cdec_5_cdec_12CandidateSet_10generator19(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22___iter__ *__pyx_cur_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22___iter__ *)__pyx_generator->closure);
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25___iter__ *__pyx_cur_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25___iter__ *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
Py_ssize_t __pyx_t_1;
unsigned int __pyx_t_2;
@@ -16398,7 +17318,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_12CandidateSet_10generator16(__pyx_Genera
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":92
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":92
* def __iter__(self):
* cdef unsigned i
* for i in range(len(self)): # <<<<<<<<<<<<<<
@@ -16409,7 +17329,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_12CandidateSet_10generator16(__pyx_Genera
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_cur_scope->__pyx_v_i = __pyx_t_2;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":93
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":93
* cdef unsigned i
* for i in range(len(self)):
* yield self[i] # <<<<<<<<<<<<<<
@@ -16510,7 +17430,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_12CandidateSet_12add_kbest(PyObject *__py
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":95
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":95
* yield self[i]
*
* def add_kbest(self, Hypergraph hypergraph, unsigned k): # <<<<<<<<<<<<<<
@@ -16523,7 +17443,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_12CandidateSet_11add_kbest(struct __pyx_o
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("add_kbest", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":98
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":98
* """cs.add_kbest(Hypergraph hypergraph, int k) -> Extract K-best hypotheses
* from the hypergraph and add them to the candidate set."""
* self.cs.AddKBestCandidates(hypergraph.hg[0], k, self.scorer.get()) # <<<<<<<<<<<<<<
@@ -16547,7 +17467,7 @@ static void __pyx_pw_4cdec_5_cdec_16SegmentEvaluator_1__dealloc__(PyObject *__py
__Pyx_RefNannyFinishContext();
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":104
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":104
* cdef mteval.EvaluationMetric* metric
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -16559,7 +17479,7 @@ static void __pyx_pf_4cdec_5_cdec_16SegmentEvaluator___dealloc__(CYTHON_UNUSED s
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":105
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":105
*
* def __dealloc__(self):
* del self.scorer # <<<<<<<<<<<<<<
@@ -16583,7 +17503,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_16SegmentEvaluator_3evaluate(PyObject *__
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":107
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":107
* del self.scorer
*
* def evaluate(self, sentence): # <<<<<<<<<<<<<<
@@ -16605,7 +17525,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_16SegmentEvaluator_2evaluate(struct __pyx
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("evaluate", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":110
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":110
* """se.evaluate(sentence) -> SufficientStats for the given hypothesis."""
* cdef vector[WordID] hyp
* cdef SufficientStats sf = SufficientStats() # <<<<<<<<<<<<<<
@@ -16617,7 +17537,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_16SegmentEvaluator_2evaluate(struct __pyx
__pyx_v_sf = ((struct __pyx_obj_4cdec_5_cdec_SufficientStats *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":111
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":111
* cdef vector[WordID] hyp
* cdef SufficientStats sf = SufficientStats()
* sf.metric = self.metric # <<<<<<<<<<<<<<
@@ -16627,7 +17547,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_16SegmentEvaluator_2evaluate(struct __pyx
__pyx_t_2 = __pyx_v_self->metric;
__pyx_v_sf->metric = __pyx_t_2;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":112
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":112
* cdef SufficientStats sf = SufficientStats()
* sf.metric = self.metric
* sf.stats = new mteval.SufficientStats() # <<<<<<<<<<<<<<
@@ -16636,7 +17556,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_16SegmentEvaluator_2evaluate(struct __pyx
*/
__pyx_v_sf->stats = new SufficientStats();
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":113
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":113
* sf.metric = self.metric
* sf.stats = new mteval.SufficientStats()
* ConvertSentence(as_str(sentence.strip()), &hyp) # <<<<<<<<<<<<<<
@@ -16655,7 +17575,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_16SegmentEvaluator_2evaluate(struct __pyx
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
TD::ConvertSentence(__pyx_t_4, (&__pyx_v_hyp));
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":114
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":114
* sf.stats = new mteval.SufficientStats()
* ConvertSentence(as_str(sentence.strip()), &hyp)
* self.scorer.get().Evaluate(hyp, sf.stats) # <<<<<<<<<<<<<<
@@ -16664,7 +17584,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_16SegmentEvaluator_2evaluate(struct __pyx
*/
__pyx_v_self->scorer->get()->Evaluate(__pyx_v_hyp, __pyx_v_sf->stats);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":115
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":115
* ConvertSentence(as_str(sentence.strip()), &hyp)
* self.scorer.get().Evaluate(hyp, sf.stats)
* return sf # <<<<<<<<<<<<<<
@@ -16702,7 +17622,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_16SegmentEvaluator_5candidate_set(PyObjec
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":117
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":117
* return sf
*
* def candidate_set(self): # <<<<<<<<<<<<<<
@@ -16720,7 +17640,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_16SegmentEvaluator_4candidate_set(struct
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("candidate_set", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":119
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":119
* def candidate_set(self):
* """se.candidate_set() -> Candidate set using this segment evaluator for scoring."""
* return CandidateSet(self) # <<<<<<<<<<<<<<
@@ -16767,7 +17687,7 @@ static int __pyx_pw_4cdec_5_cdec_6Scorer_1__cinit__(PyObject *__pyx_v_self, PyOb
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__name,0};
PyObject* values[1] = {0};
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":125
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":125
* cdef mteval.EvaluationMetric* metric
*
* def __cinit__(self, bytes name=None): # <<<<<<<<<<<<<<
@@ -16832,7 +17752,7 @@ static int __pyx_pf_4cdec_5_cdec_6Scorer___cinit__(struct __pyx_obj_4cdec_5_cdec
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":126
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":126
*
* def __cinit__(self, bytes name=None):
* if name: # <<<<<<<<<<<<<<
@@ -16842,7 +17762,7 @@ static int __pyx_pf_4cdec_5_cdec_6Scorer___cinit__(struct __pyx_obj_4cdec_5_cdec
__pyx_t_1 = (((PyObject *)__pyx_v_name) != Py_None) && (PyBytes_GET_SIZE(((PyObject *)__pyx_v_name)) != 0);
if (__pyx_t_1) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":127
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":127
* def __cinit__(self, bytes name=None):
* if name:
* self.name = new string(name) # <<<<<<<<<<<<<<
@@ -16858,7 +17778,7 @@ static int __pyx_pf_4cdec_5_cdec_6Scorer___cinit__(struct __pyx_obj_4cdec_5_cdec
}
__pyx_v_self->name = __pyx_t_3;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":128
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":128
* if name:
* self.name = new string(name)
* self.metric = mteval.MetricInstance(self.name[0]) # <<<<<<<<<<<<<<
@@ -16889,7 +17809,7 @@ static void __pyx_pw_4cdec_5_cdec_6Scorer_3__dealloc__(PyObject *__pyx_v_self) {
__Pyx_RefNannyFinishContext();
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":130
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":130
* self.metric = mteval.MetricInstance(self.name[0])
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -16901,7 +17821,7 @@ static void __pyx_pf_4cdec_5_cdec_6Scorer_2__dealloc__(CYTHON_UNUSED struct __py
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":131
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":131
*
* def __dealloc__(self):
* del self.name # <<<<<<<<<<<<<<
@@ -16963,7 +17883,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_6Scorer_5__call__(PyObject *__pyx_v_self,
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":133
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":133
* del self.name
*
* def __call__(self, refs): # <<<<<<<<<<<<<<
@@ -16995,7 +17915,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_6Scorer_4__call__(struct __pyx_obj_4cdec_
__Pyx_RefNannySetupContext("__call__", 0);
__Pyx_INCREF(__pyx_v_refs);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":134
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":134
*
* def __call__(self, refs):
* if isinstance(refs, basestring): # <<<<<<<<<<<<<<
@@ -17006,7 +17926,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_6Scorer_4__call__(struct __pyx_obj_4cdec_
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":135
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":135
* def __call__(self, refs):
* if isinstance(refs, basestring):
* refs = [refs] # <<<<<<<<<<<<<<
@@ -17025,7 +17945,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_6Scorer_4__call__(struct __pyx_obj_4cdec_
}
__pyx_L3:;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":136
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":136
* if isinstance(refs, basestring):
* refs = [refs]
* cdef vector[vector[WordID]]* refsv = new vector[vector[WordID]]() # <<<<<<<<<<<<<<
@@ -17040,7 +17960,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_6Scorer_4__call__(struct __pyx_obj_4cdec_
}
__pyx_v_refsv = __pyx_t_4;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":138
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":138
* cdef vector[vector[WordID]]* refsv = new vector[vector[WordID]]()
* cdef vector[WordID]* refv
* for ref in refs: # <<<<<<<<<<<<<<
@@ -17085,7 +18005,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_6Scorer_4__call__(struct __pyx_obj_4cdec_
__pyx_v_ref = __pyx_t_7;
__pyx_t_7 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":139
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":139
* cdef vector[WordID]* refv
* for ref in refs:
* refv = new vector[WordID]() # <<<<<<<<<<<<<<
@@ -17100,7 +18020,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_6Scorer_4__call__(struct __pyx_obj_4cdec_
}
__pyx_v_refv = __pyx_t_8;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":140
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":140
* for ref in refs:
* refv = new vector[WordID]()
* ConvertSentence(as_str(ref.strip()), refv) # <<<<<<<<<<<<<<
@@ -17119,7 +18039,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_6Scorer_4__call__(struct __pyx_obj_4cdec_
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
TD::ConvertSentence(__pyx_t_10, __pyx_v_refv);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":141
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":141
* refv = new vector[WordID]()
* ConvertSentence(as_str(ref.strip()), refv)
* refsv.push_back(refv[0]) # <<<<<<<<<<<<<<
@@ -17128,7 +18048,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_6Scorer_4__call__(struct __pyx_obj_4cdec_
*/
__pyx_v_refsv->push_back((__pyx_v_refv[0]));
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":142
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":142
* ConvertSentence(as_str(ref.strip()), refv)
* refsv.push_back(refv[0])
* del refv # <<<<<<<<<<<<<<
@@ -17139,7 +18059,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_6Scorer_4__call__(struct __pyx_obj_4cdec_
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":144
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":144
* del refv
* cdef unsigned i
* cdef SegmentEvaluator evaluator = SegmentEvaluator() # <<<<<<<<<<<<<<
@@ -17151,7 +18071,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_6Scorer_4__call__(struct __pyx_obj_4cdec_
__pyx_v_evaluator = ((struct __pyx_obj_4cdec_5_cdec_SegmentEvaluator *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":145
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":145
* cdef unsigned i
* cdef SegmentEvaluator evaluator = SegmentEvaluator()
* evaluator.metric = self.metric # <<<<<<<<<<<<<<
@@ -17161,7 +18081,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_6Scorer_4__call__(struct __pyx_obj_4cdec_
__pyx_t_11 = __pyx_v_self->metric;
__pyx_v_evaluator->metric = __pyx_t_11;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":146
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":146
* cdef SegmentEvaluator evaluator = SegmentEvaluator()
* evaluator.metric = self.metric
* evaluator.scorer = new shared_ptr[mteval.SegmentEvaluator]( # <<<<<<<<<<<<<<
@@ -17170,7 +18090,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_6Scorer_4__call__(struct __pyx_obj_4cdec_
*/
__pyx_v_evaluator->scorer = new boost::shared_ptr<SegmentEvaluator>(__pyx_v_self->metric->CreateSegmentEvaluator((__pyx_v_refsv[0])));
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":148
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":148
* evaluator.scorer = new shared_ptr[mteval.SegmentEvaluator](
* self.metric.CreateSegmentEvaluator(refsv[0]))
* del refsv # in theory should not delete but store in SegmentEvaluator # <<<<<<<<<<<<<<
@@ -17179,7 +18099,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_6Scorer_4__call__(struct __pyx_obj_4cdec_
*/
delete __pyx_v_refsv;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":149
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":149
* self.metric.CreateSegmentEvaluator(refsv[0]))
* del refsv # in theory should not delete but store in SegmentEvaluator
* return evaluator # <<<<<<<<<<<<<<
@@ -17219,7 +18139,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_6Scorer_7__str__(PyObject *__pyx_v_self)
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":151
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":151
* return evaluator
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -17237,7 +18157,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_6Scorer_6__str__(struct __pyx_obj_4cdec_5
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__str__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":152
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":152
*
* def __str__(self):
* return str(self.name.c_str()) # <<<<<<<<<<<<<<
@@ -17272,7 +18192,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_6Scorer_6__str__(struct __pyx_obj_4cdec_5
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":154
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":154
* return str(self.name.c_str())
*
* cdef float _compute_score(void* metric_, mteval.SufficientStats* stats): # <<<<<<<<<<<<<<
@@ -17298,7 +18218,7 @@ static float __pyx_f_4cdec_5_cdec__compute_score(void *__pyx_v_metric_, Sufficie
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_compute_score", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":155
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":155
*
* cdef float _compute_score(void* metric_, mteval.SufficientStats* stats):
* cdef Metric metric = <Metric> metric_ # <<<<<<<<<<<<<<
@@ -17308,7 +18228,7 @@ static float __pyx_f_4cdec_5_cdec__compute_score(void *__pyx_v_metric_, Sufficie
__Pyx_INCREF(((PyObject *)((struct __pyx_obj_4cdec_5_cdec_Metric *)__pyx_v_metric_)));
__pyx_v_metric = ((struct __pyx_obj_4cdec_5_cdec_Metric *)__pyx_v_metric_);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":156
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":156
* cdef float _compute_score(void* metric_, mteval.SufficientStats* stats):
* cdef Metric metric = <Metric> metric_
* cdef list ss = [] # <<<<<<<<<<<<<<
@@ -17320,7 +18240,7 @@ static float __pyx_f_4cdec_5_cdec__compute_score(void *__pyx_v_metric_, Sufficie
__pyx_v_ss = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":158
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":158
* cdef list ss = []
* cdef unsigned i
* for i in range(stats.size()): # <<<<<<<<<<<<<<
@@ -17331,7 +18251,7 @@ static float __pyx_f_4cdec_5_cdec__compute_score(void *__pyx_v_metric_, Sufficie
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":159
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":159
* cdef unsigned i
* for i in range(stats.size()):
* ss.append(stats[0][i]) # <<<<<<<<<<<<<<
@@ -17344,7 +18264,7 @@ static float __pyx_f_4cdec_5_cdec__compute_score(void *__pyx_v_metric_, Sufficie
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":160
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":160
* for i in range(stats.size()):
* ss.append(stats[0][i])
* return metric.score(ss) # <<<<<<<<<<<<<<
@@ -17382,7 +18302,7 @@ static float __pyx_f_4cdec_5_cdec__compute_score(void *__pyx_v_metric_, Sufficie
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":162
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":162
* return metric.score(ss)
*
* cdef void _compute_sufficient_stats(void* metric_, # <<<<<<<<<<<<<<
@@ -17409,7 +18329,7 @@ static void __pyx_f_4cdec_5_cdec__compute_sufficient_stats(void *__pyx_v_metric_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_compute_sufficient_stats", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":166
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":166
* vector[string]* refs,
* mteval.SufficientStats* out):
* cdef Metric metric = <Metric> metric_ # <<<<<<<<<<<<<<
@@ -17419,7 +18339,7 @@ static void __pyx_f_4cdec_5_cdec__compute_sufficient_stats(void *__pyx_v_metric_
__Pyx_INCREF(((PyObject *)((struct __pyx_obj_4cdec_5_cdec_Metric *)__pyx_v_metric_)));
__pyx_v_metric = ((struct __pyx_obj_4cdec_5_cdec_Metric *)__pyx_v_metric_);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":167
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":167
* mteval.SufficientStats* out):
* cdef Metric metric = <Metric> metric_
* cdef list refs_ = [] # <<<<<<<<<<<<<<
@@ -17431,7 +18351,7 @@ static void __pyx_f_4cdec_5_cdec__compute_sufficient_stats(void *__pyx_v_metric_
__pyx_v_refs_ = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":169
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":169
* cdef list refs_ = []
* cdef unsigned i
* for i in range(refs.size()): # <<<<<<<<<<<<<<
@@ -17442,7 +18362,7 @@ static void __pyx_f_4cdec_5_cdec__compute_sufficient_stats(void *__pyx_v_metric_
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":170
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":170
* cdef unsigned i
* for i in range(refs.size()):
* refs_.append(str(refs[0][i].c_str())) # <<<<<<<<<<<<<<
@@ -17463,7 +18383,7 @@ static void __pyx_f_4cdec_5_cdec__compute_sufficient_stats(void *__pyx_v_metric_
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":171
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":171
* for i in range(refs.size()):
* refs_.append(str(refs[0][i].c_str()))
* cdef list ss = metric.evaluate(str(hyp.c_str()), refs_) # <<<<<<<<<<<<<<
@@ -17498,7 +18418,7 @@ static void __pyx_f_4cdec_5_cdec__compute_sufficient_stats(void *__pyx_v_metric_
__pyx_v_ss = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":172
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":172
* refs_.append(str(refs[0][i].c_str()))
* cdef list ss = metric.evaluate(str(hyp.c_str()), refs_)
* out.fields.resize(len(ss)) # <<<<<<<<<<<<<<
@@ -17512,7 +18432,7 @@ static void __pyx_f_4cdec_5_cdec__compute_sufficient_stats(void *__pyx_v_metric_
__pyx_t_7 = PyList_GET_SIZE(((PyObject *)__pyx_v_ss)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_out->fields.resize(__pyx_t_7);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":173
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":173
* cdef list ss = metric.evaluate(str(hyp.c_str()), refs_)
* out.fields.resize(len(ss))
* for i in range(len(ss)): # <<<<<<<<<<<<<<
@@ -17527,7 +18447,7 @@ static void __pyx_f_4cdec_5_cdec__compute_sufficient_stats(void *__pyx_v_metric_
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_7; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":174
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":174
* out.fields.resize(len(ss))
* for i in range(len(ss)):
* out.fields[i] = ss[i] # <<<<<<<<<<<<<<
@@ -17572,7 +18492,7 @@ static int __pyx_pw_4cdec_5_cdec_6Metric_1__cinit__(PyObject *__pyx_v_self, PyOb
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":178
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":178
* cdef class Metric:
* cdef Scorer scorer
* def __cinit__(self): # <<<<<<<<<<<<<<
@@ -17593,7 +18513,7 @@ static int __pyx_pf_4cdec_5_cdec_6Metric___cinit__(struct __pyx_obj_4cdec_5_cdec
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":179
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":179
* cdef Scorer scorer
* def __cinit__(self):
* self.scorer = Scorer() # <<<<<<<<<<<<<<
@@ -17608,7 +18528,7 @@ static int __pyx_pf_4cdec_5_cdec_6Metric___cinit__(struct __pyx_obj_4cdec_5_cdec
__pyx_v_self->scorer = ((struct __pyx_obj_4cdec_5_cdec_Scorer *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":180
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":180
* def __cinit__(self):
* self.scorer = Scorer()
* cdef bytes class_name = self.__class__.__name__ # <<<<<<<<<<<<<<
@@ -17624,7 +18544,7 @@ static int __pyx_pf_4cdec_5_cdec_6Metric___cinit__(struct __pyx_obj_4cdec_5_cdec
__pyx_v_class_name = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":181
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":181
* self.scorer = Scorer()
* cdef bytes class_name = self.__class__.__name__
* self.scorer.name = new string(class_name) # <<<<<<<<<<<<<<
@@ -17640,7 +18560,7 @@ static int __pyx_pf_4cdec_5_cdec_6Metric___cinit__(struct __pyx_obj_4cdec_5_cdec
}
__pyx_v_self->scorer->name = __pyx_t_4;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":182
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":182
* cdef bytes class_name = self.__class__.__name__
* self.scorer.name = new string(class_name)
* self.scorer.metric = mteval.PyMetricInstance(self.scorer.name[0], # <<<<<<<<<<<<<<
@@ -17712,7 +18632,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_6Metric_3__call__(PyObject *__pyx_v_self,
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":185
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":185
* <void*> self, _compute_sufficient_stats, _compute_score)
*
* def __call__(self, refs): # <<<<<<<<<<<<<<
@@ -17730,7 +18650,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_6Metric_2__call__(struct __pyx_obj_4cdec_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__call__", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":186
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":186
*
* def __call__(self, refs):
* return self.scorer(refs) # <<<<<<<<<<<<<<
@@ -17774,7 +18694,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_6Metric_5score(PyObject *__pyx_v_stats, C
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":188
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":188
* return self.scorer(refs)
*
* def score(SufficientStats stats): # <<<<<<<<<<<<<<
@@ -17787,7 +18707,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_6Metric_4score(CYTHON_UNUSED struct __pyx
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("score", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":189
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":189
*
* def score(SufficientStats stats):
* return 0 # <<<<<<<<<<<<<<
@@ -17865,7 +18785,7 @@ static PyObject *__pyx_pw_4cdec_5_cdec_6Metric_7evaluate(PyObject *__pyx_v_self,
return __pyx_r;
}
-/* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":191
+/* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":191
* return 0
*
* def evaluate(self, hyp, refs): # <<<<<<<<<<<<<<
@@ -17882,7 +18802,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_6Metric_6evaluate(CYTHON_UNUSED struct __
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("evaluate", 0);
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":192
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":192
*
* def evaluate(self, hyp, refs):
* return [] # <<<<<<<<<<<<<<
@@ -17958,7 +18878,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_2set_silent(CYTHON_UNUSED PyObject *__pyx
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_5_cdec_6generator17(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4cdec_5_cdec_6generator20(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
/* Python wrapper */
static PyObject *__pyx_pw_4cdec_5_cdec_5_make_config(PyObject *__pyx_self, PyObject *__pyx_v_config); /*proto*/
@@ -17981,14 +18901,14 @@ static PyObject *__pyx_pw_4cdec_5_cdec_5_make_config(PyObject *__pyx_self, PyObj
*/
static PyObject *__pyx_pf_4cdec_5_cdec_4_make_config(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_config) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23__make_config *__pyx_cur_scope;
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_26__make_config *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_make_config", 0);
- __pyx_cur_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23__make_config *)__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_23__make_config(__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_23__make_config, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_26__make_config *)__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_26__make_config(__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_26__make_config, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__Pyx_RefNannyFinishContext();
return NULL;
@@ -17998,7 +18918,7 @@ static PyObject *__pyx_pf_4cdec_5_cdec_4_make_config(CYTHON_UNUSED PyObject *__p
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_config);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_config);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_6generator17, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_6generator20, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -18016,9 +18936,9 @@ static PyObject *__pyx_pf_4cdec_5_cdec_4_make_config(CYTHON_UNUSED PyObject *__p
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_5_cdec_6generator17(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4cdec_5_cdec_6generator20(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23__make_config *__pyx_cur_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23__make_config *)__pyx_generator->closure);
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_26__make_config *__pyx_cur_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_26__make_config *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
@@ -18577,7 +19497,7 @@ static int __pyx_pw_4cdec_5_cdec_7Decoder_1__init__(PyObject *__pyx_v_self, PyOb
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_5_cdec_7Decoder_8__init___2generator21(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4cdec_5_cdec_7Decoder_8__init___2generator24(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
/* "cdec/_cdec.pyx":56
* 'csplit', 'tagger', 'lexalign'):
@@ -18588,24 +19508,24 @@ static PyObject *__pyx_gb_4cdec_5_cdec_7Decoder_8__init___2generator21(__pyx_Gen
*/
static PyObject *__pyx_pf_4cdec_5_cdec_7Decoder_8__init___genexpr(PyObject *__pyx_self) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25_genexpr *__pyx_cur_scope;
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_28_genexpr *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("genexpr", 0);
- __pyx_cur_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25_genexpr *)__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_25_genexpr(__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_25_genexpr, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_28_genexpr *)__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_28_genexpr(__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_28_genexpr, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__Pyx_RefNannyFinishContext();
return NULL;
}
__Pyx_GOTREF(__pyx_cur_scope);
- __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___init__ *) __pyx_self;
+ __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_27___init__ *) __pyx_self;
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_7Decoder_8__init___2generator21, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_4cdec_5_cdec_7Decoder_8__init___2generator24, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -18623,9 +19543,9 @@ static PyObject *__pyx_pf_4cdec_5_cdec_7Decoder_8__init___genexpr(PyObject *__py
return __pyx_r;
}
-static PyObject *__pyx_gb_4cdec_5_cdec_7Decoder_8__init___2generator21(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4cdec_5_cdec_7Decoder_8__init___2generator24(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25_genexpr *)__pyx_generator->closure);
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_28_genexpr *__pyx_cur_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_28_genexpr *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
@@ -18744,7 +19664,7 @@ static PyObject *__pyx_gb_4cdec_5_cdec_7Decoder_8__init___2generator21(__pyx_Gen
*/
static int __pyx_pf_4cdec_5_cdec_7Decoder___init__(struct __pyx_obj_4cdec_5_cdec_Decoder *__pyx_v_self, PyObject *__pyx_v_config_str, PyObject *__pyx_v_config) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___init__ *__pyx_cur_scope;
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_27___init__ *__pyx_cur_scope;
PyObject *__pyx_v_formalism = NULL;
std::istringstream *__pyx_v_config_stream;
int __pyx_r;
@@ -18760,7 +19680,7 @@ static int __pyx_pf_4cdec_5_cdec_7Decoder___init__(struct __pyx_obj_4cdec_5_cdec
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- __pyx_cur_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___init__ *)__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_24___init__(__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_24___init__, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_27___init__ *)__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_27___init__(__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_27___init__, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
__Pyx_RefNannyFinishContext();
return -1;
@@ -20125,6 +21045,131 @@ static std::string __pyx_convert_string_from_py_(PyObject *__pyx_v_o) {
return __pyx_r;
}
+static struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___iter__ *__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_24___iter__[8];
+static int __pyx_freecount_4cdec_5_cdec___pyx_scope_struct_24___iter__ = 0;
+
+static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_24___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___iter__ *p;
+ PyObject *o;
+ if (likely((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_24___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___iter__)))) {
+ o = (PyObject*)__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_24___iter__[--__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_24___iter__];
+ memset(o, 0, sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___iter__));
+ PyObject_INIT(o, t);
+ PyObject_GC_Track(o);
+ } else {
+ o = (*t->tp_alloc)(t, 0);
+ if (unlikely(!o)) return 0;
+ }
+ p = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___iter__ *)o);
+ p->__pyx_v_i = 0;
+ p->__pyx_v_self = 0;
+ p->__pyx_t_1 = 0;
+ return o;
+}
+
+static void __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_24___iter__(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___iter__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___iter__ *)o;
+ PyObject_GC_UnTrack(o);
+ Py_CLEAR(p->__pyx_v_i);
+ Py_CLEAR(p->__pyx_v_self);
+ Py_CLEAR(p->__pyx_t_1);
+ if ((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_24___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___iter__))) {
+ __pyx_freelist_4cdec_5_cdec___pyx_scope_struct_24___iter__[__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_24___iter__++] = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___iter__ *)o);
+ } else {
+ (*Py_TYPE(o)->tp_free)(o);
+ }
+}
+
+static int __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_24___iter__(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___iter__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___iter__ *)o;
+ if (p->__pyx_v_i) {
+ e = (*v)(p->__pyx_v_i, a); if (e) return e;
+ }
+ if (p->__pyx_v_self) {
+ e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
+ }
+ if (p->__pyx_t_1) {
+ e = (*v)(p->__pyx_t_1, a); if (e) return e;
+ }
+ return 0;
+}
+
+static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_24___iter__(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___iter__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___iter__ *)o;
+ PyObject* tmp;
+ tmp = ((PyObject*)p->__pyx_v_i);
+ p->__pyx_v_i = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_v_self);
+ p->__pyx_v_self = ((struct __pyx_obj_4cdec_5_cdec_SufficientStats *)Py_None); Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_t_1);
+ p->__pyx_t_1 = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ return 0;
+}
+
+static PyMethodDef __pyx_methods_4cdec_5_cdec___pyx_scope_struct_24___iter__[] = {
+ {0, 0, 0, 0}
+};
+
+static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_24___iter__ = {
+ PyVarObject_HEAD_INIT(0, 0)
+ __Pyx_NAMESTR("cdec._cdec.__pyx_scope_struct_24___iter__"), /*tp_name*/
+ sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___iter__), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_24___iter__, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #else
+ 0, /*reserved*/
+ #endif
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ 0, /*tp_doc*/
+ __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_24___iter__, /*tp_traverse*/
+ __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_24___iter__, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_4cdec_5_cdec___pyx_scope_struct_24___iter__, /*tp_methods*/
+ 0, /*tp_members*/
+ 0, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ 0, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_24___iter__, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ #if PY_VERSION_HEX >= 0x02060000
+ 0, /*tp_version_tag*/
+ #endif
+};
+
static PyObject *__pyx_tp_new_4cdec_5_cdec_TRule(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
PyObject *o;
o = (*t->tp_alloc)(t, 0);
@@ -20359,115 +21404,6 @@ static PyTypeObject __pyx_type_4cdec_5_cdec_MRule = {
#endif
};
-static struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22___iter__ *__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_22___iter__[8];
-static int __pyx_freecount_4cdec_5_cdec___pyx_scope_struct_22___iter__ = 0;
-
-static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_22___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22___iter__ *p;
- PyObject *o;
- if (likely((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_22___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22___iter__)))) {
- o = (PyObject*)__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_22___iter__[--__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_22___iter__];
- memset(o, 0, sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22___iter__));
- PyObject_INIT(o, t);
- PyObject_GC_Track(o);
- } else {
- o = (*t->tp_alloc)(t, 0);
- if (unlikely(!o)) return 0;
- }
- p = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22___iter__ *)o);
- p->__pyx_v_self = 0;
- return o;
-}
-
-static void __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_22___iter__(PyObject *o) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22___iter__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22___iter__ *)o;
- PyObject_GC_UnTrack(o);
- Py_CLEAR(p->__pyx_v_self);
- if ((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_22___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22___iter__))) {
- __pyx_freelist_4cdec_5_cdec___pyx_scope_struct_22___iter__[__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_22___iter__++] = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22___iter__ *)o);
- } else {
- (*Py_TYPE(o)->tp_free)(o);
- }
-}
-
-static int __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_22___iter__(PyObject *o, visitproc v, void *a) {
- int e;
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22___iter__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22___iter__ *)o;
- if (p->__pyx_v_self) {
- e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
- }
- return 0;
-}
-
-static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_22___iter__(PyObject *o) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22___iter__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22___iter__ *)o;
- PyObject* tmp;
- tmp = ((PyObject*)p->__pyx_v_self);
- p->__pyx_v_self = ((struct __pyx_obj_4cdec_5_cdec_CandidateSet *)Py_None); Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- return 0;
-}
-
-static PyMethodDef __pyx_methods_4cdec_5_cdec___pyx_scope_struct_22___iter__[] = {
- {0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_22___iter__ = {
- PyVarObject_HEAD_INIT(0, 0)
- __Pyx_NAMESTR("cdec._cdec.__pyx_scope_struct_22___iter__"), /*tp_name*/
- sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22___iter__), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_22___iter__, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- #if PY_MAJOR_VERSION < 3
- 0, /*tp_compare*/
- #else
- 0, /*reserved*/
- #endif
- 0, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- 0, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
- 0, /*tp_doc*/
- __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_22___iter__, /*tp_traverse*/
- __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_22___iter__, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- __pyx_methods_4cdec_5_cdec___pyx_scope_struct_22___iter__, /*tp_methods*/
- 0, /*tp_members*/
- 0, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- 0, /*tp_init*/
- 0, /*tp_alloc*/
- __pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_22___iter__, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0, /*tp_del*/
- #if PY_VERSION_HEX >= 0x02060000
- 0, /*tp_version_tag*/
- #endif
-};
-
static PyObject *__pyx_tp_new_4cdec_5_cdec_DenseVector(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
PyObject *o;
o = (*t->tp_alloc)(t, 0);
@@ -20765,6 +21701,272 @@ static PyTypeObject __pyx_type_4cdec_5_cdec_SufficientStats = {
#endif
};
+static struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23_lines *__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_23_lines[8];
+static int __pyx_freecount_4cdec_5_cdec___pyx_scope_struct_23_lines = 0;
+
+static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_23_lines(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23_lines *p;
+ PyObject *o;
+ if (likely((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_23_lines > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23_lines)))) {
+ o = (PyObject*)__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_23_lines[--__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_23_lines];
+ memset(o, 0, sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23_lines));
+ PyObject_INIT(o, t);
+ PyObject_GC_Track(o);
+ } else {
+ o = (*t->tp_alloc)(t, 0);
+ if (unlikely(!o)) return 0;
+ }
+ p = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23_lines *)o);
+ p->__pyx_outer_scope = 0;
+ p->__pyx_v_delta = 0;
+ p->__pyx_v_i = 0;
+ p->__pyx_v_label = 0;
+ p->__pyx_v_weight = 0;
+ p->__pyx_t_1 = 0;
+ p->__pyx_t_3 = 0;
+ return o;
+}
+
+static void __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_23_lines(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23_lines *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23_lines *)o;
+ PyObject_GC_UnTrack(o);
+ Py_CLEAR(p->__pyx_outer_scope);
+ Py_CLEAR(p->__pyx_v_delta);
+ Py_CLEAR(p->__pyx_v_i);
+ Py_CLEAR(p->__pyx_v_label);
+ Py_CLEAR(p->__pyx_v_weight);
+ Py_CLEAR(p->__pyx_t_1);
+ Py_CLEAR(p->__pyx_t_3);
+ if ((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_23_lines < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23_lines))) {
+ __pyx_freelist_4cdec_5_cdec___pyx_scope_struct_23_lines[__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_23_lines++] = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23_lines *)o);
+ } else {
+ (*Py_TYPE(o)->tp_free)(o);
+ }
+}
+
+static int __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_23_lines(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23_lines *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23_lines *)o;
+ if (p->__pyx_outer_scope) {
+ e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
+ }
+ if (p->__pyx_v_delta) {
+ e = (*v)(p->__pyx_v_delta, a); if (e) return e;
+ }
+ if (p->__pyx_v_i) {
+ e = (*v)(p->__pyx_v_i, a); if (e) return e;
+ }
+ if (p->__pyx_v_label) {
+ e = (*v)(p->__pyx_v_label, a); if (e) return e;
+ }
+ if (p->__pyx_v_weight) {
+ e = (*v)(p->__pyx_v_weight, a); if (e) return e;
+ }
+ if (p->__pyx_t_1) {
+ e = (*v)(p->__pyx_t_1, a); if (e) return e;
+ }
+ if (p->__pyx_t_3) {
+ e = (*v)(p->__pyx_t_3, a); if (e) return e;
+ }
+ return 0;
+}
+
+static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_23_lines(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23_lines *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23_lines *)o;
+ PyObject* tmp;
+ tmp = ((PyObject*)p->__pyx_outer_scope);
+ p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22_todot *)Py_None); Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_v_delta);
+ p->__pyx_v_delta = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_v_i);
+ p->__pyx_v_i = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_v_label);
+ p->__pyx_v_label = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_v_weight);
+ p->__pyx_v_weight = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_t_1);
+ p->__pyx_t_1 = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_t_3);
+ p->__pyx_t_3 = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ return 0;
+}
+
+static PyMethodDef __pyx_methods_4cdec_5_cdec___pyx_scope_struct_23_lines[] = {
+ {0, 0, 0, 0}
+};
+
+static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_23_lines = {
+ PyVarObject_HEAD_INIT(0, 0)
+ __Pyx_NAMESTR("cdec._cdec.__pyx_scope_struct_23_lines"), /*tp_name*/
+ sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23_lines), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_23_lines, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #else
+ 0, /*reserved*/
+ #endif
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ 0, /*tp_doc*/
+ __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_23_lines, /*tp_traverse*/
+ __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_23_lines, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_4cdec_5_cdec___pyx_scope_struct_23_lines, /*tp_methods*/
+ 0, /*tp_members*/
+ 0, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ 0, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_23_lines, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ #if PY_VERSION_HEX >= 0x02060000
+ 0, /*tp_version_tag*/
+ #endif
+};
+
+static struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_27___init__ *__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_27___init__[8];
+static int __pyx_freecount_4cdec_5_cdec___pyx_scope_struct_27___init__ = 0;
+
+static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_27___init__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_27___init__ *p;
+ PyObject *o;
+ if (likely((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_27___init__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_27___init__)))) {
+ o = (PyObject*)__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_27___init__[--__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_27___init__];
+ memset(o, 0, sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_27___init__));
+ PyObject_INIT(o, t);
+ PyObject_GC_Track(o);
+ } else {
+ o = (*t->tp_alloc)(t, 0);
+ if (unlikely(!o)) return 0;
+ }
+ p = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_27___init__ *)o);
+ p->__pyx_v_config = 0;
+ return o;
+}
+
+static void __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_27___init__(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_27___init__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_27___init__ *)o;
+ PyObject_GC_UnTrack(o);
+ Py_CLEAR(p->__pyx_v_config);
+ if ((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_27___init__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_27___init__))) {
+ __pyx_freelist_4cdec_5_cdec___pyx_scope_struct_27___init__[__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_27___init__++] = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_27___init__ *)o);
+ } else {
+ (*Py_TYPE(o)->tp_free)(o);
+ }
+}
+
+static int __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_27___init__(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_27___init__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_27___init__ *)o;
+ if (p->__pyx_v_config) {
+ e = (*v)(p->__pyx_v_config, a); if (e) return e;
+ }
+ return 0;
+}
+
+static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_27___init__(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_27___init__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_27___init__ *)o;
+ PyObject* tmp;
+ tmp = ((PyObject*)p->__pyx_v_config);
+ p->__pyx_v_config = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ return 0;
+}
+
+static PyMethodDef __pyx_methods_4cdec_5_cdec___pyx_scope_struct_27___init__[] = {
+ {0, 0, 0, 0}
+};
+
+static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_27___init__ = {
+ PyVarObject_HEAD_INIT(0, 0)
+ __Pyx_NAMESTR("cdec._cdec.__pyx_scope_struct_27___init__"), /*tp_name*/
+ sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_27___init__), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_27___init__, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #else
+ 0, /*reserved*/
+ #endif
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ 0, /*tp_doc*/
+ __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_27___init__, /*tp_traverse*/
+ __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_27___init__, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_4cdec_5_cdec___pyx_scope_struct_27___init__, /*tp_methods*/
+ 0, /*tp_members*/
+ 0, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ 0, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_27___init__, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ #if PY_VERSION_HEX >= 0x02060000
+ 0, /*tp_version_tag*/
+ #endif
+};
+
static struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_21___iter__ *__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_21___iter__[8];
static int __pyx_freecount_4cdec_5_cdec___pyx_scope_struct_21___iter__ = 0;
@@ -20781,18 +21983,14 @@ static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_21___iter__(PyType
if (unlikely(!o)) return 0;
}
p = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_21___iter__ *)o);
- p->__pyx_v_i = 0;
p->__pyx_v_self = 0;
- p->__pyx_t_1 = 0;
return o;
}
static void __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_21___iter__(PyObject *o) {
struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_21___iter__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_21___iter__ *)o;
PyObject_GC_UnTrack(o);
- Py_CLEAR(p->__pyx_v_i);
Py_CLEAR(p->__pyx_v_self);
- Py_CLEAR(p->__pyx_t_1);
if ((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_21___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_21___iter__))) {
__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_21___iter__[__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_21___iter__++] = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_21___iter__ *)o);
} else {
@@ -20803,29 +22001,17 @@ static void __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_21___iter__(PyObjec
static int __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_21___iter__(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_21___iter__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_21___iter__ *)o;
- if (p->__pyx_v_i) {
- e = (*v)(p->__pyx_v_i, a); if (e) return e;
- }
if (p->__pyx_v_self) {
e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
}
- if (p->__pyx_t_1) {
- e = (*v)(p->__pyx_t_1, a); if (e) return e;
- }
return 0;
}
static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_21___iter__(PyObject *o) {
struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_21___iter__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_21___iter__ *)o;
PyObject* tmp;
- tmp = ((PyObject*)p->__pyx_v_i);
- p->__pyx_v_i = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
tmp = ((PyObject*)p->__pyx_v_self);
- p->__pyx_v_self = ((struct __pyx_obj_4cdec_5_cdec_SufficientStats *)Py_None); Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->__pyx_t_1);
- p->__pyx_t_1 = Py_None; Py_INCREF(Py_None);
+ p->__pyx_v_self = ((struct __pyx_obj_4cdec_5_cdec_Lattice *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
@@ -20990,6 +22176,123 @@ static PyTypeObject __pyx_type_4cdec_5_cdec_Metric = {
#endif
};
+static struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest *__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest[8];
+static int __pyx_freecount_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest = 0;
+
+static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest *p;
+ PyObject *o;
+ if (likely((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest)))) {
+ o = (PyObject*)__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest[--__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest];
+ memset(o, 0, sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest));
+ PyObject_INIT(o, t);
+ PyObject_GC_Track(o);
+ } else {
+ o = (*t->tp_alloc)(t, 0);
+ if (unlikely(!o)) return 0;
+ }
+ p = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest *)o);
+ p->__pyx_v_self = 0;
+ p->__pyx_v_size = 0;
+ return o;
+}
+
+static void __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest *)o;
+ PyObject_GC_UnTrack(o);
+ Py_CLEAR(p->__pyx_v_self);
+ Py_CLEAR(p->__pyx_v_size);
+ if ((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest))) {
+ __pyx_freelist_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest[__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest++] = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest *)o);
+ } else {
+ (*Py_TYPE(o)->tp_free)(o);
+ }
+}
+
+static int __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest *)o;
+ if (p->__pyx_v_self) {
+ e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
+ }
+ if (p->__pyx_v_size) {
+ e = (*v)(p->__pyx_v_size, a); if (e) return e;
+ }
+ return 0;
+}
+
+static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest *)o;
+ PyObject* tmp;
+ tmp = ((PyObject*)p->__pyx_v_self);
+ p->__pyx_v_self = ((struct __pyx_obj_4cdec_5_cdec_Hypergraph *)Py_None); Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_v_size);
+ p->__pyx_v_size = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ return 0;
+}
+
+static PyMethodDef __pyx_methods_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest[] = {
+ {0, 0, 0, 0}
+};
+
+static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest = {
+ PyVarObject_HEAD_INIT(0, 0)
+ __Pyx_NAMESTR("cdec._cdec.__pyx_scope_struct_11_unique_kbest"), /*tp_name*/
+ sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #else
+ 0, /*reserved*/
+ #endif
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ 0, /*tp_doc*/
+ __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest, /*tp_traverse*/
+ __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest, /*tp_methods*/
+ 0, /*tp_members*/
+ 0, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ 0, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ #if PY_VERSION_HEX >= 0x02060000
+ 0, /*tp_version_tag*/
+ #endif
+};
+
static PyObject *__pyx_tp_new_4cdec_5_cdec_Candidate(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
PyObject *o;
o = (*t->tp_alloc)(t, 0);
@@ -21267,65 +22570,113 @@ static PyTypeObject __pyx_type_4cdec_5_cdec_SparseVector = {
#endif
};
-static struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15___get__ *__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_15___get__[8];
-static int __pyx_freecount_4cdec_5_cdec___pyx_scope_struct_15___get__ = 0;
+static struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_26__make_config *__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_26__make_config[8];
+static int __pyx_freecount_4cdec_5_cdec___pyx_scope_struct_26__make_config = 0;
-static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_15___get__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15___get__ *p;
+static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_26__make_config(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_26__make_config *p;
PyObject *o;
- if (likely((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_15___get__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15___get__)))) {
- o = (PyObject*)__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_15___get__[--__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_15___get__];
- memset(o, 0, sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15___get__));
+ if (likely((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_26__make_config > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_26__make_config)))) {
+ o = (PyObject*)__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_26__make_config[--__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_26__make_config];
+ memset(o, 0, sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_26__make_config));
PyObject_INIT(o, t);
PyObject_GC_Track(o);
} else {
o = (*t->tp_alloc)(t, 0);
if (unlikely(!o)) return 0;
}
- p = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15___get__ *)o);
- p->__pyx_v_self = 0;
+ p = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_26__make_config *)o);
+ p->__pyx_v_config = 0;
+ p->__pyx_v_info = 0;
+ p->__pyx_v_key = 0;
+ p->__pyx_v_name = 0;
+ p->__pyx_v_value = 0;
+ p->__pyx_t_0 = 0;
+ p->__pyx_t_1 = 0;
return o;
}
-static void __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_15___get__(PyObject *o) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15___get__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15___get__ *)o;
+static void __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_26__make_config(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_26__make_config *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_26__make_config *)o;
PyObject_GC_UnTrack(o);
- Py_CLEAR(p->__pyx_v_self);
- if ((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_15___get__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15___get__))) {
- __pyx_freelist_4cdec_5_cdec___pyx_scope_struct_15___get__[__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_15___get__++] = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15___get__ *)o);
+ Py_CLEAR(p->__pyx_v_config);
+ Py_CLEAR(p->__pyx_v_info);
+ Py_CLEAR(p->__pyx_v_key);
+ Py_CLEAR(p->__pyx_v_name);
+ Py_CLEAR(p->__pyx_v_value);
+ Py_CLEAR(p->__pyx_t_0);
+ Py_CLEAR(p->__pyx_t_1);
+ if ((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_26__make_config < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_26__make_config))) {
+ __pyx_freelist_4cdec_5_cdec___pyx_scope_struct_26__make_config[__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_26__make_config++] = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_26__make_config *)o);
} else {
(*Py_TYPE(o)->tp_free)(o);
}
}
-static int __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_15___get__(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_26__make_config(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15___get__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15___get__ *)o;
- if (p->__pyx_v_self) {
- e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_26__make_config *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_26__make_config *)o;
+ if (p->__pyx_v_config) {
+ e = (*v)(p->__pyx_v_config, a); if (e) return e;
+ }
+ if (p->__pyx_v_info) {
+ e = (*v)(p->__pyx_v_info, a); if (e) return e;
+ }
+ if (p->__pyx_v_key) {
+ e = (*v)(p->__pyx_v_key, a); if (e) return e;
+ }
+ if (p->__pyx_v_name) {
+ e = (*v)(p->__pyx_v_name, a); if (e) return e;
+ }
+ if (p->__pyx_v_value) {
+ e = (*v)(p->__pyx_v_value, a); if (e) return e;
+ }
+ if (p->__pyx_t_0) {
+ e = (*v)(p->__pyx_t_0, a); if (e) return e;
+ }
+ if (p->__pyx_t_1) {
+ e = (*v)(p->__pyx_t_1, a); if (e) return e;
}
return 0;
}
-static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_15___get__(PyObject *o) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15___get__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15___get__ *)o;
+static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_26__make_config(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_26__make_config *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_26__make_config *)o;
PyObject* tmp;
- tmp = ((PyObject*)p->__pyx_v_self);
- p->__pyx_v_self = ((struct __pyx_obj_4cdec_5_cdec_HypergraphEdge *)Py_None); Py_INCREF(Py_None);
+ tmp = ((PyObject*)p->__pyx_v_config);
+ p->__pyx_v_config = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_v_info);
+ p->__pyx_v_info = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_v_key);
+ p->__pyx_v_key = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_v_name);
+ p->__pyx_v_name = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_v_value);
+ p->__pyx_v_value = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_t_0);
+ p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_t_1);
+ p->__pyx_t_1 = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
-static PyMethodDef __pyx_methods_4cdec_5_cdec___pyx_scope_struct_15___get__[] = {
+static PyMethodDef __pyx_methods_4cdec_5_cdec___pyx_scope_struct_26__make_config[] = {
{0, 0, 0, 0}
};
-static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_15___get__ = {
+static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_26__make_config = {
PyVarObject_HEAD_INIT(0, 0)
- __Pyx_NAMESTR("cdec._cdec.__pyx_scope_struct_15___get__"), /*tp_name*/
- sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15___get__), /*tp_basicsize*/
+ __Pyx_NAMESTR("cdec._cdec.__pyx_scope_struct_26__make_config"), /*tp_name*/
+ sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_26__make_config), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_15___get__, /*tp_dealloc*/
+ __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_26__make_config, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
@@ -21346,13 +22697,13 @@ static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_15___get__ = {
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_15___get__, /*tp_traverse*/
- __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_15___get__, /*tp_clear*/
+ __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_26__make_config, /*tp_traverse*/
+ __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_26__make_config, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
- __pyx_methods_4cdec_5_cdec___pyx_scope_struct_15___get__, /*tp_methods*/
+ __pyx_methods_4cdec_5_cdec___pyx_scope_struct_26__make_config, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
@@ -21362,7 +22713,7 @@ static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_15___get__ = {
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_15___get__, /*tp_new*/
+ __pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_26__make_config, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -21627,113 +22978,65 @@ static PyTypeObject __pyx_type_4cdec_5_cdec_Lattice = {
#endif
};
-static struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23__make_config *__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_23__make_config[8];
-static int __pyx_freecount_4cdec_5_cdec___pyx_scope_struct_23__make_config = 0;
+static struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15_sample_trees *__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_15_sample_trees[8];
+static int __pyx_freecount_4cdec_5_cdec___pyx_scope_struct_15_sample_trees = 0;
-static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_23__make_config(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23__make_config *p;
+static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_15_sample_trees(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15_sample_trees *p;
PyObject *o;
- if (likely((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_23__make_config > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23__make_config)))) {
- o = (PyObject*)__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_23__make_config[--__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_23__make_config];
- memset(o, 0, sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23__make_config));
+ if (likely((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_15_sample_trees > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15_sample_trees)))) {
+ o = (PyObject*)__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_15_sample_trees[--__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_15_sample_trees];
+ memset(o, 0, sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15_sample_trees));
PyObject_INIT(o, t);
PyObject_GC_Track(o);
} else {
o = (*t->tp_alloc)(t, 0);
if (unlikely(!o)) return 0;
}
- p = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23__make_config *)o);
- p->__pyx_v_config = 0;
- p->__pyx_v_info = 0;
- p->__pyx_v_key = 0;
- p->__pyx_v_name = 0;
- p->__pyx_v_value = 0;
- p->__pyx_t_0 = 0;
- p->__pyx_t_1 = 0;
+ p = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15_sample_trees *)o);
+ p->__pyx_v_self = 0;
return o;
}
-static void __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_23__make_config(PyObject *o) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23__make_config *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23__make_config *)o;
+static void __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_15_sample_trees(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15_sample_trees *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15_sample_trees *)o;
PyObject_GC_UnTrack(o);
- Py_CLEAR(p->__pyx_v_config);
- Py_CLEAR(p->__pyx_v_info);
- Py_CLEAR(p->__pyx_v_key);
- Py_CLEAR(p->__pyx_v_name);
- Py_CLEAR(p->__pyx_v_value);
- Py_CLEAR(p->__pyx_t_0);
- Py_CLEAR(p->__pyx_t_1);
- if ((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_23__make_config < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23__make_config))) {
- __pyx_freelist_4cdec_5_cdec___pyx_scope_struct_23__make_config[__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_23__make_config++] = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23__make_config *)o);
+ Py_CLEAR(p->__pyx_v_self);
+ if ((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_15_sample_trees < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15_sample_trees))) {
+ __pyx_freelist_4cdec_5_cdec___pyx_scope_struct_15_sample_trees[__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_15_sample_trees++] = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15_sample_trees *)o);
} else {
(*Py_TYPE(o)->tp_free)(o);
}
}
-static int __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_23__make_config(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_15_sample_trees(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23__make_config *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23__make_config *)o;
- if (p->__pyx_v_config) {
- e = (*v)(p->__pyx_v_config, a); if (e) return e;
- }
- if (p->__pyx_v_info) {
- e = (*v)(p->__pyx_v_info, a); if (e) return e;
- }
- if (p->__pyx_v_key) {
- e = (*v)(p->__pyx_v_key, a); if (e) return e;
- }
- if (p->__pyx_v_name) {
- e = (*v)(p->__pyx_v_name, a); if (e) return e;
- }
- if (p->__pyx_v_value) {
- e = (*v)(p->__pyx_v_value, a); if (e) return e;
- }
- if (p->__pyx_t_0) {
- e = (*v)(p->__pyx_t_0, a); if (e) return e;
- }
- if (p->__pyx_t_1) {
- e = (*v)(p->__pyx_t_1, a); if (e) return e;
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15_sample_trees *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15_sample_trees *)o;
+ if (p->__pyx_v_self) {
+ e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
}
return 0;
}
-static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_23__make_config(PyObject *o) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23__make_config *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23__make_config *)o;
+static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_15_sample_trees(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15_sample_trees *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15_sample_trees *)o;
PyObject* tmp;
- tmp = ((PyObject*)p->__pyx_v_config);
- p->__pyx_v_config = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->__pyx_v_info);
- p->__pyx_v_info = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->__pyx_v_key);
- p->__pyx_v_key = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->__pyx_v_name);
- p->__pyx_v_name = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->__pyx_v_value);
- p->__pyx_v_value = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->__pyx_t_0);
- p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->__pyx_t_1);
- p->__pyx_t_1 = Py_None; Py_INCREF(Py_None);
+ tmp = ((PyObject*)p->__pyx_v_self);
+ p->__pyx_v_self = ((struct __pyx_obj_4cdec_5_cdec_Hypergraph *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
-static PyMethodDef __pyx_methods_4cdec_5_cdec___pyx_scope_struct_23__make_config[] = {
+static PyMethodDef __pyx_methods_4cdec_5_cdec___pyx_scope_struct_15_sample_trees[] = {
{0, 0, 0, 0}
};
-static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_23__make_config = {
+static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_15_sample_trees = {
PyVarObject_HEAD_INIT(0, 0)
- __Pyx_NAMESTR("cdec._cdec.__pyx_scope_struct_23__make_config"), /*tp_name*/
- sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_23__make_config), /*tp_basicsize*/
+ __Pyx_NAMESTR("cdec._cdec.__pyx_scope_struct_15_sample_trees"), /*tp_name*/
+ sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_15_sample_trees), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_23__make_config, /*tp_dealloc*/
+ __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_15_sample_trees, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
@@ -21754,13 +23057,13 @@ static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_23__make_config =
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_23__make_config, /*tp_traverse*/
- __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_23__make_config, /*tp_clear*/
+ __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_15_sample_trees, /*tp_traverse*/
+ __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_15_sample_trees, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
- __pyx_methods_4cdec_5_cdec___pyx_scope_struct_23__make_config, /*tp_methods*/
+ __pyx_methods_4cdec_5_cdec___pyx_scope_struct_15_sample_trees, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
@@ -21770,7 +23073,7 @@ static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_23__make_config =
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_23__make_config, /*tp_new*/
+ __pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_15_sample_trees, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -22057,272 +23360,6 @@ static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_2__phrase = {
#endif
};
-static struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13___get__ *__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_13___get__[8];
-static int __pyx_freecount_4cdec_5_cdec___pyx_scope_struct_13___get__ = 0;
-
-static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_13___get__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13___get__ *p;
- PyObject *o;
- if (likely((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_13___get__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13___get__)))) {
- o = (PyObject*)__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_13___get__[--__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_13___get__];
- memset(o, 0, sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13___get__));
- PyObject_INIT(o, t);
- PyObject_GC_Track(o);
- } else {
- o = (*t->tp_alloc)(t, 0);
- if (unlikely(!o)) return 0;
- }
- p = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13___get__ *)o);
- p->__pyx_v_self = 0;
- return o;
-}
-
-static void __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_13___get__(PyObject *o) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13___get__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13___get__ *)o;
- PyObject_GC_UnTrack(o);
- Py_CLEAR(p->__pyx_v_self);
- if ((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_13___get__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13___get__))) {
- __pyx_freelist_4cdec_5_cdec___pyx_scope_struct_13___get__[__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_13___get__++] = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13___get__ *)o);
- } else {
- (*Py_TYPE(o)->tp_free)(o);
- }
-}
-
-static int __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_13___get__(PyObject *o, visitproc v, void *a) {
- int e;
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13___get__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13___get__ *)o;
- if (p->__pyx_v_self) {
- e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
- }
- return 0;
-}
-
-static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_13___get__(PyObject *o) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13___get__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13___get__ *)o;
- PyObject* tmp;
- tmp = ((PyObject*)p->__pyx_v_self);
- p->__pyx_v_self = ((struct __pyx_obj_4cdec_5_cdec_Hypergraph *)Py_None); Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- return 0;
-}
-
-static PyMethodDef __pyx_methods_4cdec_5_cdec___pyx_scope_struct_13___get__[] = {
- {0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_13___get__ = {
- PyVarObject_HEAD_INIT(0, 0)
- __Pyx_NAMESTR("cdec._cdec.__pyx_scope_struct_13___get__"), /*tp_name*/
- sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13___get__), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_13___get__, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- #if PY_MAJOR_VERSION < 3
- 0, /*tp_compare*/
- #else
- 0, /*reserved*/
- #endif
- 0, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- 0, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
- 0, /*tp_doc*/
- __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_13___get__, /*tp_traverse*/
- __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_13___get__, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- __pyx_methods_4cdec_5_cdec___pyx_scope_struct_13___get__, /*tp_methods*/
- 0, /*tp_members*/
- 0, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- 0, /*tp_init*/
- 0, /*tp_alloc*/
- __pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_13___get__, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0, /*tp_del*/
- #if PY_VERSION_HEX >= 0x02060000
- 0, /*tp_version_tag*/
- #endif
-};
-
-static struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20_lines *__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_20_lines[8];
-static int __pyx_freecount_4cdec_5_cdec___pyx_scope_struct_20_lines = 0;
-
-static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_20_lines(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20_lines *p;
- PyObject *o;
- if (likely((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_20_lines > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20_lines)))) {
- o = (PyObject*)__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_20_lines[--__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_20_lines];
- memset(o, 0, sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20_lines));
- PyObject_INIT(o, t);
- PyObject_GC_Track(o);
- } else {
- o = (*t->tp_alloc)(t, 0);
- if (unlikely(!o)) return 0;
- }
- p = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20_lines *)o);
- p->__pyx_outer_scope = 0;
- p->__pyx_v_delta = 0;
- p->__pyx_v_i = 0;
- p->__pyx_v_label = 0;
- p->__pyx_v_weight = 0;
- p->__pyx_t_1 = 0;
- p->__pyx_t_3 = 0;
- return o;
-}
-
-static void __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_20_lines(PyObject *o) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20_lines *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20_lines *)o;
- PyObject_GC_UnTrack(o);
- Py_CLEAR(p->__pyx_outer_scope);
- Py_CLEAR(p->__pyx_v_delta);
- Py_CLEAR(p->__pyx_v_i);
- Py_CLEAR(p->__pyx_v_label);
- Py_CLEAR(p->__pyx_v_weight);
- Py_CLEAR(p->__pyx_t_1);
- Py_CLEAR(p->__pyx_t_3);
- if ((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_20_lines < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20_lines))) {
- __pyx_freelist_4cdec_5_cdec___pyx_scope_struct_20_lines[__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_20_lines++] = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20_lines *)o);
- } else {
- (*Py_TYPE(o)->tp_free)(o);
- }
-}
-
-static int __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_20_lines(PyObject *o, visitproc v, void *a) {
- int e;
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20_lines *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20_lines *)o;
- if (p->__pyx_outer_scope) {
- e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
- }
- if (p->__pyx_v_delta) {
- e = (*v)(p->__pyx_v_delta, a); if (e) return e;
- }
- if (p->__pyx_v_i) {
- e = (*v)(p->__pyx_v_i, a); if (e) return e;
- }
- if (p->__pyx_v_label) {
- e = (*v)(p->__pyx_v_label, a); if (e) return e;
- }
- if (p->__pyx_v_weight) {
- e = (*v)(p->__pyx_v_weight, a); if (e) return e;
- }
- if (p->__pyx_t_1) {
- e = (*v)(p->__pyx_t_1, a); if (e) return e;
- }
- if (p->__pyx_t_3) {
- e = (*v)(p->__pyx_t_3, a); if (e) return e;
- }
- return 0;
-}
-
-static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_20_lines(PyObject *o) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20_lines *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20_lines *)o;
- PyObject* tmp;
- tmp = ((PyObject*)p->__pyx_outer_scope);
- p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19_todot *)Py_None); Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->__pyx_v_delta);
- p->__pyx_v_delta = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->__pyx_v_i);
- p->__pyx_v_i = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->__pyx_v_label);
- p->__pyx_v_label = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->__pyx_v_weight);
- p->__pyx_v_weight = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->__pyx_t_1);
- p->__pyx_t_1 = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->__pyx_t_3);
- p->__pyx_t_3 = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- return 0;
-}
-
-static PyMethodDef __pyx_methods_4cdec_5_cdec___pyx_scope_struct_20_lines[] = {
- {0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_20_lines = {
- PyVarObject_HEAD_INIT(0, 0)
- __Pyx_NAMESTR("cdec._cdec.__pyx_scope_struct_20_lines"), /*tp_name*/
- sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20_lines), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_20_lines, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- #if PY_MAJOR_VERSION < 3
- 0, /*tp_compare*/
- #else
- 0, /*reserved*/
- #endif
- 0, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- 0, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
- 0, /*tp_doc*/
- __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_20_lines, /*tp_traverse*/
- __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_20_lines, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- __pyx_methods_4cdec_5_cdec___pyx_scope_struct_20_lines, /*tp_methods*/
- 0, /*tp_members*/
- 0, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- 0, /*tp_init*/
- 0, /*tp_alloc*/
- __pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_20_lines, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0, /*tp_del*/
- #if PY_VERSION_HEX >= 0x02060000
- 0, /*tp_version_tag*/
- #endif
-};
-
static PyObject *__pyx_tp_new_4cdec_5_cdec_Scorer(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o;
o = (*t->tp_alloc)(t, 0);
@@ -22873,14 +23910,17 @@ static PyMethodDef __pyx_methods_4cdec_5_cdec_Hypergraph[] = {
{__Pyx_NAMESTR("kbest"), (PyCFunction)__pyx_pw_4cdec_5_cdec_10Hypergraph_13kbest, METH_O, __Pyx_DOCSTR(__pyx_doc_4cdec_5_cdec_10Hypergraph_12kbest)},
{__Pyx_NAMESTR("kbest_trees"), (PyCFunction)__pyx_pw_4cdec_5_cdec_10Hypergraph_16kbest_trees, METH_O, __Pyx_DOCSTR(__pyx_doc_4cdec_5_cdec_10Hypergraph_15kbest_trees)},
{__Pyx_NAMESTR("kbest_features"), (PyCFunction)__pyx_pw_4cdec_5_cdec_10Hypergraph_19kbest_features, METH_O, __Pyx_DOCSTR(__pyx_doc_4cdec_5_cdec_10Hypergraph_18kbest_features)},
- {__Pyx_NAMESTR("sample"), (PyCFunction)__pyx_pw_4cdec_5_cdec_10Hypergraph_22sample, METH_O, __Pyx_DOCSTR(__pyx_doc_4cdec_5_cdec_10Hypergraph_21sample)},
- {__Pyx_NAMESTR("sample_trees"), (PyCFunction)__pyx_pw_4cdec_5_cdec_10Hypergraph_25sample_trees, METH_O, __Pyx_DOCSTR(__pyx_doc_4cdec_5_cdec_10Hypergraph_24sample_trees)},
- {__Pyx_NAMESTR("intersect"), (PyCFunction)__pyx_pw_4cdec_5_cdec_10Hypergraph_28intersect, METH_O, __Pyx_DOCSTR(__pyx_doc_4cdec_5_cdec_10Hypergraph_27intersect)},
- {__Pyx_NAMESTR("prune"), (PyCFunction)__pyx_pw_4cdec_5_cdec_10Hypergraph_30prune, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cdec_5_cdec_10Hypergraph_29prune)},
- {__Pyx_NAMESTR("lattice"), (PyCFunction)__pyx_pw_4cdec_5_cdec_10Hypergraph_32lattice, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4cdec_5_cdec_10Hypergraph_31lattice)},
- {__Pyx_NAMESTR("plf"), (PyCFunction)__pyx_pw_4cdec_5_cdec_10Hypergraph_34plf, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4cdec_5_cdec_10Hypergraph_33plf)},
- {__Pyx_NAMESTR("reweight"), (PyCFunction)__pyx_pw_4cdec_5_cdec_10Hypergraph_36reweight, METH_O, __Pyx_DOCSTR(__pyx_doc_4cdec_5_cdec_10Hypergraph_35reweight)},
- {__Pyx_NAMESTR("inside_outside"), (PyCFunction)__pyx_pw_4cdec_5_cdec_10Hypergraph_38inside_outside, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4cdec_5_cdec_10Hypergraph_37inside_outside)},
+ {__Pyx_NAMESTR("unique_kbest"), (PyCFunction)__pyx_pw_4cdec_5_cdec_10Hypergraph_22unique_kbest, METH_O, __Pyx_DOCSTR(__pyx_doc_4cdec_5_cdec_10Hypergraph_21unique_kbest)},
+ {__Pyx_NAMESTR("unique_kbest_trees"), (PyCFunction)__pyx_pw_4cdec_5_cdec_10Hypergraph_25unique_kbest_trees, METH_O, __Pyx_DOCSTR(__pyx_doc_4cdec_5_cdec_10Hypergraph_24unique_kbest_trees)},
+ {__Pyx_NAMESTR("unique_kbest_features"), (PyCFunction)__pyx_pw_4cdec_5_cdec_10Hypergraph_28unique_kbest_features, METH_O, __Pyx_DOCSTR(__pyx_doc_4cdec_5_cdec_10Hypergraph_27unique_kbest_features)},
+ {__Pyx_NAMESTR("sample"), (PyCFunction)__pyx_pw_4cdec_5_cdec_10Hypergraph_31sample, METH_O, __Pyx_DOCSTR(__pyx_doc_4cdec_5_cdec_10Hypergraph_30sample)},
+ {__Pyx_NAMESTR("sample_trees"), (PyCFunction)__pyx_pw_4cdec_5_cdec_10Hypergraph_34sample_trees, METH_O, __Pyx_DOCSTR(__pyx_doc_4cdec_5_cdec_10Hypergraph_33sample_trees)},
+ {__Pyx_NAMESTR("intersect"), (PyCFunction)__pyx_pw_4cdec_5_cdec_10Hypergraph_37intersect, METH_O, __Pyx_DOCSTR(__pyx_doc_4cdec_5_cdec_10Hypergraph_36intersect)},
+ {__Pyx_NAMESTR("prune"), (PyCFunction)__pyx_pw_4cdec_5_cdec_10Hypergraph_39prune, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4cdec_5_cdec_10Hypergraph_38prune)},
+ {__Pyx_NAMESTR("lattice"), (PyCFunction)__pyx_pw_4cdec_5_cdec_10Hypergraph_41lattice, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4cdec_5_cdec_10Hypergraph_40lattice)},
+ {__Pyx_NAMESTR("plf"), (PyCFunction)__pyx_pw_4cdec_5_cdec_10Hypergraph_43plf, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4cdec_5_cdec_10Hypergraph_42plf)},
+ {__Pyx_NAMESTR("reweight"), (PyCFunction)__pyx_pw_4cdec_5_cdec_10Hypergraph_45reweight, METH_O, __Pyx_DOCSTR(__pyx_doc_4cdec_5_cdec_10Hypergraph_44reweight)},
+ {__Pyx_NAMESTR("inside_outside"), (PyCFunction)__pyx_pw_4cdec_5_cdec_10Hypergraph_47inside_outside, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4cdec_5_cdec_10Hypergraph_46inside_outside)},
{0, 0, 0, 0}
};
@@ -22948,115 +23988,6 @@ static PyTypeObject __pyx_type_4cdec_5_cdec_Hypergraph = {
#endif
};
-static struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___init__ *__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_24___init__[8];
-static int __pyx_freecount_4cdec_5_cdec___pyx_scope_struct_24___init__ = 0;
-
-static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_24___init__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___init__ *p;
- PyObject *o;
- if (likely((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_24___init__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___init__)))) {
- o = (PyObject*)__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_24___init__[--__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_24___init__];
- memset(o, 0, sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___init__));
- PyObject_INIT(o, t);
- PyObject_GC_Track(o);
- } else {
- o = (*t->tp_alloc)(t, 0);
- if (unlikely(!o)) return 0;
- }
- p = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___init__ *)o);
- p->__pyx_v_config = 0;
- return o;
-}
-
-static void __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_24___init__(PyObject *o) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___init__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___init__ *)o;
- PyObject_GC_UnTrack(o);
- Py_CLEAR(p->__pyx_v_config);
- if ((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_24___init__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___init__))) {
- __pyx_freelist_4cdec_5_cdec___pyx_scope_struct_24___init__[__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_24___init__++] = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___init__ *)o);
- } else {
- (*Py_TYPE(o)->tp_free)(o);
- }
-}
-
-static int __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_24___init__(PyObject *o, visitproc v, void *a) {
- int e;
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___init__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___init__ *)o;
- if (p->__pyx_v_config) {
- e = (*v)(p->__pyx_v_config, a); if (e) return e;
- }
- return 0;
-}
-
-static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_24___init__(PyObject *o) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___init__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___init__ *)o;
- PyObject* tmp;
- tmp = ((PyObject*)p->__pyx_v_config);
- p->__pyx_v_config = ((PyObject*)Py_None); Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- return 0;
-}
-
-static PyMethodDef __pyx_methods_4cdec_5_cdec___pyx_scope_struct_24___init__[] = {
- {0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_24___init__ = {
- PyVarObject_HEAD_INIT(0, 0)
- __Pyx_NAMESTR("cdec._cdec.__pyx_scope_struct_24___init__"), /*tp_name*/
- sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___init__), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_24___init__, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- #if PY_MAJOR_VERSION < 3
- 0, /*tp_compare*/
- #else
- 0, /*reserved*/
- #endif
- 0, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- 0, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
- 0, /*tp_doc*/
- __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_24___init__, /*tp_traverse*/
- __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_24___init__, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- __pyx_methods_4cdec_5_cdec___pyx_scope_struct_24___init__, /*tp_methods*/
- 0, /*tp_members*/
- 0, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- 0, /*tp_init*/
- 0, /*tp_alloc*/
- __pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_24___init__, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0, /*tp_del*/
- #if PY_VERSION_HEX >= 0x02060000
- 0, /*tp_version_tag*/
- #endif
-};
-
static PyObject *__pyx_tp_new_4cdec_5_cdec_CandidateSet(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o;
o = (*t->tp_alloc)(t, 0);
@@ -23167,89 +24098,65 @@ static PyTypeObject __pyx_type_4cdec_5_cdec_CandidateSet = {
#endif
};
-static struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees *__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees[8];
-static int __pyx_freecount_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees = 0;
+static struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22_todot *__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_22_todot[8];
+static int __pyx_freecount_4cdec_5_cdec___pyx_scope_struct_22_todot = 0;
-static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees *p;
+static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_22_todot(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22_todot *p;
PyObject *o;
- if (likely((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees)))) {
- o = (PyObject*)__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees[--__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees];
- memset(o, 0, sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees));
+ if (likely((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_22_todot > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22_todot)))) {
+ o = (PyObject*)__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_22_todot[--__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_22_todot];
+ memset(o, 0, sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22_todot));
PyObject_INIT(o, t);
PyObject_GC_Track(o);
} else {
o = (*t->tp_alloc)(t, 0);
if (unlikely(!o)) return 0;
}
- p = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees *)o);
- p->__pyx_v_e_tree = 0;
- p->__pyx_v_f_tree = 0;
+ p = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22_todot *)o);
p->__pyx_v_self = 0;
- p->__pyx_v_size = 0;
return o;
}
-static void __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees(PyObject *o) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees *)o;
+static void __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_22_todot(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22_todot *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22_todot *)o;
PyObject_GC_UnTrack(o);
- Py_CLEAR(p->__pyx_v_e_tree);
- Py_CLEAR(p->__pyx_v_f_tree);
Py_CLEAR(p->__pyx_v_self);
- Py_CLEAR(p->__pyx_v_size);
- if ((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees))) {
- __pyx_freelist_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees[__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees++] = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees *)o);
+ if ((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_22_todot < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22_todot))) {
+ __pyx_freelist_4cdec_5_cdec___pyx_scope_struct_22_todot[__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_22_todot++] = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22_todot *)o);
} else {
(*Py_TYPE(o)->tp_free)(o);
}
}
-static int __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_22_todot(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees *)o;
- if (p->__pyx_v_e_tree) {
- e = (*v)(p->__pyx_v_e_tree, a); if (e) return e;
- }
- if (p->__pyx_v_f_tree) {
- e = (*v)(p->__pyx_v_f_tree, a); if (e) return e;
- }
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22_todot *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22_todot *)o;
if (p->__pyx_v_self) {
e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
}
- if (p->__pyx_v_size) {
- e = (*v)(p->__pyx_v_size, a); if (e) return e;
- }
return 0;
}
-static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees(PyObject *o) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees *)o;
+static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_22_todot(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22_todot *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22_todot *)o;
PyObject* tmp;
- tmp = ((PyObject*)p->__pyx_v_e_tree);
- p->__pyx_v_e_tree = ((PyObject*)Py_None); Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->__pyx_v_f_tree);
- p->__pyx_v_f_tree = ((PyObject*)Py_None); Py_INCREF(Py_None);
- Py_XDECREF(tmp);
tmp = ((PyObject*)p->__pyx_v_self);
- p->__pyx_v_self = ((struct __pyx_obj_4cdec_5_cdec_Hypergraph *)Py_None); Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->__pyx_v_size);
- p->__pyx_v_size = Py_None; Py_INCREF(Py_None);
+ p->__pyx_v_self = ((struct __pyx_obj_4cdec_5_cdec_Lattice *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
-static PyMethodDef __pyx_methods_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees[] = {
+static PyMethodDef __pyx_methods_4cdec_5_cdec___pyx_scope_struct_22_todot[] = {
{0, 0, 0, 0}
};
-static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees = {
+static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_22_todot = {
PyVarObject_HEAD_INIT(0, 0)
- __Pyx_NAMESTR("cdec._cdec.__pyx_scope_struct_9_kbest_trees"), /*tp_name*/
- sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees), /*tp_basicsize*/
+ __Pyx_NAMESTR("cdec._cdec.__pyx_scope_struct_22_todot"), /*tp_name*/
+ sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_22_todot), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees, /*tp_dealloc*/
+ __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_22_todot, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
@@ -23270,13 +24177,13 @@ static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees = {
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees, /*tp_traverse*/
- __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees, /*tp_clear*/
+ __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_22_todot, /*tp_traverse*/
+ __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_22_todot, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
- __pyx_methods_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees, /*tp_methods*/
+ __pyx_methods_4cdec_5_cdec___pyx_scope_struct_22_todot, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
@@ -23286,7 +24193,7 @@ static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees = {
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees, /*tp_new*/
+ __pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_22_todot, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -23300,65 +24207,89 @@ static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees = {
#endif
};
-static struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19_todot *__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_19_todot[8];
-static int __pyx_freecount_4cdec_5_cdec___pyx_scope_struct_19_todot = 0;
+static struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees *__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees[8];
+static int __pyx_freecount_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees = 0;
-static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_19_todot(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19_todot *p;
+static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees *p;
PyObject *o;
- if (likely((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_19_todot > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19_todot)))) {
- o = (PyObject*)__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_19_todot[--__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_19_todot];
- memset(o, 0, sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19_todot));
+ if (likely((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees)))) {
+ o = (PyObject*)__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees[--__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees];
+ memset(o, 0, sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees));
PyObject_INIT(o, t);
PyObject_GC_Track(o);
} else {
o = (*t->tp_alloc)(t, 0);
if (unlikely(!o)) return 0;
}
- p = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19_todot *)o);
+ p = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees *)o);
+ p->__pyx_v_e_tree = 0;
+ p->__pyx_v_f_tree = 0;
p->__pyx_v_self = 0;
+ p->__pyx_v_size = 0;
return o;
}
-static void __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_19_todot(PyObject *o) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19_todot *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19_todot *)o;
+static void __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees *)o;
PyObject_GC_UnTrack(o);
+ Py_CLEAR(p->__pyx_v_e_tree);
+ Py_CLEAR(p->__pyx_v_f_tree);
Py_CLEAR(p->__pyx_v_self);
- if ((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_19_todot < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19_todot))) {
- __pyx_freelist_4cdec_5_cdec___pyx_scope_struct_19_todot[__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_19_todot++] = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19_todot *)o);
+ Py_CLEAR(p->__pyx_v_size);
+ if ((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees))) {
+ __pyx_freelist_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees[__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees++] = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees *)o);
} else {
(*Py_TYPE(o)->tp_free)(o);
}
}
-static int __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_19_todot(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19_todot *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19_todot *)o;
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees *)o;
+ if (p->__pyx_v_e_tree) {
+ e = (*v)(p->__pyx_v_e_tree, a); if (e) return e;
+ }
+ if (p->__pyx_v_f_tree) {
+ e = (*v)(p->__pyx_v_f_tree, a); if (e) return e;
+ }
if (p->__pyx_v_self) {
e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
}
+ if (p->__pyx_v_size) {
+ e = (*v)(p->__pyx_v_size, a); if (e) return e;
+ }
return 0;
}
-static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_19_todot(PyObject *o) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19_todot *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19_todot *)o;
+static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees *)o;
PyObject* tmp;
+ tmp = ((PyObject*)p->__pyx_v_e_tree);
+ p->__pyx_v_e_tree = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_v_f_tree);
+ p->__pyx_v_f_tree = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
tmp = ((PyObject*)p->__pyx_v_self);
- p->__pyx_v_self = ((struct __pyx_obj_4cdec_5_cdec_Lattice *)Py_None); Py_INCREF(Py_None);
+ p->__pyx_v_self = ((struct __pyx_obj_4cdec_5_cdec_Hypergraph *)Py_None); Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_v_size);
+ p->__pyx_v_size = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
-static PyMethodDef __pyx_methods_4cdec_5_cdec___pyx_scope_struct_19_todot[] = {
+static PyMethodDef __pyx_methods_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees[] = {
{0, 0, 0, 0}
};
-static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_19_todot = {
+static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees = {
PyVarObject_HEAD_INIT(0, 0)
- __Pyx_NAMESTR("cdec._cdec.__pyx_scope_struct_19_todot"), /*tp_name*/
- sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19_todot), /*tp_basicsize*/
+ __Pyx_NAMESTR("cdec._cdec.__pyx_scope_struct_9_kbest_trees"), /*tp_name*/
+ sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_19_todot, /*tp_dealloc*/
+ __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
@@ -23379,13 +24310,13 @@ static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_19_todot = {
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_19_todot, /*tp_traverse*/
- __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_19_todot, /*tp_clear*/
+ __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees, /*tp_traverse*/
+ __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
- __pyx_methods_4cdec_5_cdec___pyx_scope_struct_19_todot, /*tp_methods*/
+ __pyx_methods_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
@@ -23395,7 +24326,7 @@ static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_19_todot = {
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_19_todot, /*tp_new*/
+ __pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -23644,7 +24575,7 @@ static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_16___get__(PyObject *o
struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_16___get__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_16___get__ *)o;
PyObject* tmp;
tmp = ((PyObject*)p->__pyx_v_self);
- p->__pyx_v_self = ((struct __pyx_obj_4cdec_5_cdec_HypergraphNode *)Py_None); Py_INCREF(Py_None);
+ p->__pyx_v_self = ((struct __pyx_obj_4cdec_5_cdec_Hypergraph *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
@@ -23709,81 +24640,190 @@ static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_16___get__ = {
#endif
};
-static struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25_genexpr *__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_25_genexpr[8];
-static int __pyx_freecount_4cdec_5_cdec___pyx_scope_struct_25_genexpr = 0;
+static struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20___get__ *__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_20___get__[8];
+static int __pyx_freecount_4cdec_5_cdec___pyx_scope_struct_20___get__ = 0;
-static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_25_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25_genexpr *p;
+static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_20___get__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20___get__ *p;
PyObject *o;
- if (likely((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_25_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25_genexpr)))) {
- o = (PyObject*)__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_25_genexpr[--__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_25_genexpr];
- memset(o, 0, sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25_genexpr));
+ if (likely((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_20___get__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20___get__)))) {
+ o = (PyObject*)__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_20___get__[--__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_20___get__];
+ memset(o, 0, sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20___get__));
PyObject_INIT(o, t);
PyObject_GC_Track(o);
} else {
o = (*t->tp_alloc)(t, 0);
if (unlikely(!o)) return 0;
}
- p = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25_genexpr *)o);
- p->__pyx_outer_scope = 0;
- p->__pyx_v_kv = 0;
- p->__pyx_t_0 = 0;
+ p = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20___get__ *)o);
+ p->__pyx_v_self = 0;
return o;
}
-static void __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_25_genexpr(PyObject *o) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25_genexpr *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25_genexpr *)o;
+static void __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_20___get__(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20___get__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20___get__ *)o;
PyObject_GC_UnTrack(o);
- Py_CLEAR(p->__pyx_outer_scope);
- Py_CLEAR(p->__pyx_v_kv);
- Py_CLEAR(p->__pyx_t_0);
- if ((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_25_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25_genexpr))) {
- __pyx_freelist_4cdec_5_cdec___pyx_scope_struct_25_genexpr[__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_25_genexpr++] = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25_genexpr *)o);
+ Py_CLEAR(p->__pyx_v_self);
+ if ((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_20___get__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20___get__))) {
+ __pyx_freelist_4cdec_5_cdec___pyx_scope_struct_20___get__[__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_20___get__++] = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20___get__ *)o);
} else {
(*Py_TYPE(o)->tp_free)(o);
}
}
-static int __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_25_genexpr(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_20___get__(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25_genexpr *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25_genexpr *)o;
- if (p->__pyx_outer_scope) {
- e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20___get__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20___get__ *)o;
+ if (p->__pyx_v_self) {
+ e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
}
- if (p->__pyx_v_kv) {
- e = (*v)(p->__pyx_v_kv, a); if (e) return e;
+ return 0;
+}
+
+static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_20___get__(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20___get__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20___get__ *)o;
+ PyObject* tmp;
+ tmp = ((PyObject*)p->__pyx_v_self);
+ p->__pyx_v_self = ((struct __pyx_obj_4cdec_5_cdec_HypergraphNode *)Py_None); Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ return 0;
+}
+
+static PyMethodDef __pyx_methods_4cdec_5_cdec___pyx_scope_struct_20___get__[] = {
+ {0, 0, 0, 0}
+};
+
+static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_20___get__ = {
+ PyVarObject_HEAD_INIT(0, 0)
+ __Pyx_NAMESTR("cdec._cdec.__pyx_scope_struct_20___get__"), /*tp_name*/
+ sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_20___get__), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_20___get__, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #else
+ 0, /*reserved*/
+ #endif
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ 0, /*tp_doc*/
+ __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_20___get__, /*tp_traverse*/
+ __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_20___get__, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_4cdec_5_cdec___pyx_scope_struct_20___get__, /*tp_methods*/
+ 0, /*tp_members*/
+ 0, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ 0, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_20___get__, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ #if PY_VERSION_HEX >= 0x02060000
+ 0, /*tp_version_tag*/
+ #endif
+};
+
+static struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features *__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features[8];
+static int __pyx_freecount_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features = 0;
+
+static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features *p;
+ PyObject *o;
+ if (likely((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features)))) {
+ o = (PyObject*)__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features[--__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features];
+ memset(o, 0, sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features));
+ PyObject_INIT(o, t);
+ PyObject_GC_Track(o);
+ } else {
+ o = (*t->tp_alloc)(t, 0);
+ if (unlikely(!o)) return 0;
}
- if (p->__pyx_t_0) {
- e = (*v)(p->__pyx_t_0, a); if (e) return e;
+ p = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features *)o);
+ p->__pyx_v_fmap = 0;
+ p->__pyx_v_self = 0;
+ p->__pyx_v_size = 0;
+ return o;
+}
+
+static void __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features *)o;
+ PyObject_GC_UnTrack(o);
+ Py_CLEAR(p->__pyx_v_fmap);
+ Py_CLEAR(p->__pyx_v_self);
+ Py_CLEAR(p->__pyx_v_size);
+ if ((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features))) {
+ __pyx_freelist_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features[__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features++] = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features *)o);
+ } else {
+ (*Py_TYPE(o)->tp_free)(o);
+ }
+}
+
+static int __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features *)o;
+ if (p->__pyx_v_fmap) {
+ e = (*v)(((PyObject*)p->__pyx_v_fmap), a); if (e) return e;
+ }
+ if (p->__pyx_v_self) {
+ e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
+ }
+ if (p->__pyx_v_size) {
+ e = (*v)(p->__pyx_v_size, a); if (e) return e;
}
return 0;
}
-static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_25_genexpr(PyObject *o) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25_genexpr *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25_genexpr *)o;
+static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features *)o;
PyObject* tmp;
- tmp = ((PyObject*)p->__pyx_outer_scope);
- p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_24___init__ *)Py_None); Py_INCREF(Py_None);
+ tmp = ((PyObject*)p->__pyx_v_fmap);
+ p->__pyx_v_fmap = ((struct __pyx_obj_4cdec_5_cdec_SparseVector *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
- tmp = ((PyObject*)p->__pyx_v_kv);
- p->__pyx_v_kv = Py_None; Py_INCREF(Py_None);
+ tmp = ((PyObject*)p->__pyx_v_self);
+ p->__pyx_v_self = ((struct __pyx_obj_4cdec_5_cdec_Hypergraph *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
- tmp = ((PyObject*)p->__pyx_t_0);
- p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
+ tmp = ((PyObject*)p->__pyx_v_size);
+ p->__pyx_v_size = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
-static PyMethodDef __pyx_methods_4cdec_5_cdec___pyx_scope_struct_25_genexpr[] = {
+static PyMethodDef __pyx_methods_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features[] = {
{0, 0, 0, 0}
};
-static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_25_genexpr = {
+static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features = {
PyVarObject_HEAD_INIT(0, 0)
- __Pyx_NAMESTR("cdec._cdec.__pyx_scope_struct_25_genexpr"), /*tp_name*/
- sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25_genexpr), /*tp_basicsize*/
+ __Pyx_NAMESTR("cdec._cdec.__pyx_scope_struct_13_unique_kbest_features"), /*tp_name*/
+ sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_25_genexpr, /*tp_dealloc*/
+ __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
@@ -23804,13 +24844,13 @@ static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_25_genexpr = {
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_25_genexpr, /*tp_traverse*/
- __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_25_genexpr, /*tp_clear*/
+ __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features, /*tp_traverse*/
+ __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
- __pyx_methods_4cdec_5_cdec___pyx_scope_struct_25_genexpr, /*tp_methods*/
+ __pyx_methods_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
@@ -23820,7 +24860,7 @@ static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_25_genexpr = {
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_25_genexpr, /*tp_new*/
+ __pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -23834,49 +24874,49 @@ static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_25_genexpr = {
#endif
};
-static struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_3_genexpr *__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_3_genexpr[8];
-static int __pyx_freecount_4cdec_5_cdec___pyx_scope_struct_3_genexpr = 0;
+static struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_28_genexpr *__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_28_genexpr[8];
+static int __pyx_freecount_4cdec_5_cdec___pyx_scope_struct_28_genexpr = 0;
-static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_3_genexpr *p;
+static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_28_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_28_genexpr *p;
PyObject *o;
- if (likely((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_3_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_3_genexpr)))) {
- o = (PyObject*)__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_3_genexpr[--__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_3_genexpr];
- memset(o, 0, sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_3_genexpr));
+ if (likely((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_28_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_28_genexpr)))) {
+ o = (PyObject*)__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_28_genexpr[--__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_28_genexpr];
+ memset(o, 0, sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_28_genexpr));
PyObject_INIT(o, t);
PyObject_GC_Track(o);
} else {
o = (*t->tp_alloc)(t, 0);
if (unlikely(!o)) return 0;
}
- p = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_3_genexpr *)o);
+ p = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_28_genexpr *)o);
p->__pyx_outer_scope = 0;
- p->__pyx_v_w = 0;
+ p->__pyx_v_kv = 0;
p->__pyx_t_0 = 0;
return o;
}
-static void __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_3_genexpr(PyObject *o) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_3_genexpr *)o;
+static void __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_28_genexpr(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_28_genexpr *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_28_genexpr *)o;
PyObject_GC_UnTrack(o);
Py_CLEAR(p->__pyx_outer_scope);
- Py_CLEAR(p->__pyx_v_w);
+ Py_CLEAR(p->__pyx_v_kv);
Py_CLEAR(p->__pyx_t_0);
- if ((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_3_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_3_genexpr))) {
- __pyx_freelist_4cdec_5_cdec___pyx_scope_struct_3_genexpr[__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_3_genexpr *)o);
+ if ((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_28_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_28_genexpr))) {
+ __pyx_freelist_4cdec_5_cdec___pyx_scope_struct_28_genexpr[__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_28_genexpr++] = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_28_genexpr *)o);
} else {
(*Py_TYPE(o)->tp_free)(o);
}
}
-static int __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_28_genexpr(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_3_genexpr *)o;
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_28_genexpr *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_28_genexpr *)o;
if (p->__pyx_outer_scope) {
e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
}
- if (p->__pyx_v_w) {
- e = (*v)(p->__pyx_v_w, a); if (e) return e;
+ if (p->__pyx_v_kv) {
+ e = (*v)(p->__pyx_v_kv, a); if (e) return e;
}
if (p->__pyx_t_0) {
e = (*v)(p->__pyx_t_0, a); if (e) return e;
@@ -23884,14 +24924,14 @@ static int __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_3_genexpr(PyObject
return 0;
}
-static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_3_genexpr(PyObject *o) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_3_genexpr *)o;
+static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_28_genexpr(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_28_genexpr *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_28_genexpr *)o;
PyObject* tmp;
tmp = ((PyObject*)p->__pyx_outer_scope);
- p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_2__phrase *)Py_None); Py_INCREF(Py_None);
+ p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_27___init__ *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
- tmp = ((PyObject*)p->__pyx_v_w);
- p->__pyx_v_w = Py_None; Py_INCREF(Py_None);
+ tmp = ((PyObject*)p->__pyx_v_kv);
+ p->__pyx_v_kv = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
tmp = ((PyObject*)p->__pyx_t_0);
p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
@@ -23899,16 +24939,16 @@ static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_3_genexpr(PyObject *o)
return 0;
}
-static PyMethodDef __pyx_methods_4cdec_5_cdec___pyx_scope_struct_3_genexpr[] = {
+static PyMethodDef __pyx_methods_4cdec_5_cdec___pyx_scope_struct_28_genexpr[] = {
{0, 0, 0, 0}
};
-static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_3_genexpr = {
+static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_28_genexpr = {
PyVarObject_HEAD_INIT(0, 0)
- __Pyx_NAMESTR("cdec._cdec.__pyx_scope_struct_3_genexpr"), /*tp_name*/
- sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_3_genexpr), /*tp_basicsize*/
+ __Pyx_NAMESTR("cdec._cdec.__pyx_scope_struct_28_genexpr"), /*tp_name*/
+ sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_28_genexpr), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_3_genexpr, /*tp_dealloc*/
+ __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_28_genexpr, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
@@ -23929,13 +24969,13 @@ static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_3_genexpr = {
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_3_genexpr, /*tp_traverse*/
- __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_3_genexpr, /*tp_clear*/
+ __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_28_genexpr, /*tp_traverse*/
+ __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_28_genexpr, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
- __pyx_methods_4cdec_5_cdec___pyx_scope_struct_3_genexpr, /*tp_methods*/
+ __pyx_methods_4cdec_5_cdec___pyx_scope_struct_28_genexpr, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
@@ -23945,7 +24985,7 @@ static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_3_genexpr = {
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_3_genexpr, /*tp_new*/
+ __pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_28_genexpr, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -23959,65 +24999,81 @@ static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_3_genexpr = {
#endif
};
-static struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_sample *__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_11_sample[8];
-static int __pyx_freecount_4cdec_5_cdec___pyx_scope_struct_11_sample = 0;
+static struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_3_genexpr *__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_3_genexpr[8];
+static int __pyx_freecount_4cdec_5_cdec___pyx_scope_struct_3_genexpr = 0;
-static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_11_sample(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_sample *p;
+static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_3_genexpr *p;
PyObject *o;
- if (likely((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_11_sample > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_sample)))) {
- o = (PyObject*)__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_11_sample[--__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_11_sample];
- memset(o, 0, sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_sample));
+ if (likely((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_3_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_3_genexpr)))) {
+ o = (PyObject*)__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_3_genexpr[--__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_3_genexpr];
+ memset(o, 0, sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_3_genexpr));
PyObject_INIT(o, t);
PyObject_GC_Track(o);
} else {
o = (*t->tp_alloc)(t, 0);
if (unlikely(!o)) return 0;
}
- p = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_sample *)o);
- p->__pyx_v_self = 0;
+ p = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_3_genexpr *)o);
+ p->__pyx_outer_scope = 0;
+ p->__pyx_v_w = 0;
+ p->__pyx_t_0 = 0;
return o;
}
-static void __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_11_sample(PyObject *o) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_sample *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_sample *)o;
+static void __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_3_genexpr(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_3_genexpr *)o;
PyObject_GC_UnTrack(o);
- Py_CLEAR(p->__pyx_v_self);
- if ((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_11_sample < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_sample))) {
- __pyx_freelist_4cdec_5_cdec___pyx_scope_struct_11_sample[__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_11_sample++] = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_sample *)o);
+ Py_CLEAR(p->__pyx_outer_scope);
+ Py_CLEAR(p->__pyx_v_w);
+ Py_CLEAR(p->__pyx_t_0);
+ if ((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_3_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_3_genexpr))) {
+ __pyx_freelist_4cdec_5_cdec___pyx_scope_struct_3_genexpr[__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_3_genexpr *)o);
} else {
(*Py_TYPE(o)->tp_free)(o);
}
}
-static int __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_11_sample(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_sample *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_sample *)o;
- if (p->__pyx_v_self) {
- e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_3_genexpr *)o;
+ if (p->__pyx_outer_scope) {
+ e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
+ }
+ if (p->__pyx_v_w) {
+ e = (*v)(p->__pyx_v_w, a); if (e) return e;
+ }
+ if (p->__pyx_t_0) {
+ e = (*v)(p->__pyx_t_0, a); if (e) return e;
}
return 0;
}
-static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_11_sample(PyObject *o) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_sample *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_sample *)o;
+static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_3_genexpr(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_3_genexpr *)o;
PyObject* tmp;
- tmp = ((PyObject*)p->__pyx_v_self);
- p->__pyx_v_self = ((struct __pyx_obj_4cdec_5_cdec_Hypergraph *)Py_None); Py_INCREF(Py_None);
+ tmp = ((PyObject*)p->__pyx_outer_scope);
+ p->__pyx_outer_scope = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_2__phrase *)Py_None); Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_v_w);
+ p->__pyx_v_w = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_t_0);
+ p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
-static PyMethodDef __pyx_methods_4cdec_5_cdec___pyx_scope_struct_11_sample[] = {
+static PyMethodDef __pyx_methods_4cdec_5_cdec___pyx_scope_struct_3_genexpr[] = {
{0, 0, 0, 0}
};
-static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_11_sample = {
+static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_3_genexpr = {
PyVarObject_HEAD_INIT(0, 0)
- __Pyx_NAMESTR("cdec._cdec.__pyx_scope_struct_11_sample"), /*tp_name*/
- sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_11_sample), /*tp_basicsize*/
+ __Pyx_NAMESTR("cdec._cdec.__pyx_scope_struct_3_genexpr"), /*tp_name*/
+ sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_3_genexpr), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_11_sample, /*tp_dealloc*/
+ __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_3_genexpr, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
@@ -24038,13 +25094,13 @@ static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_11_sample = {
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_11_sample, /*tp_traverse*/
- __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_11_sample, /*tp_clear*/
+ __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_3_genexpr, /*tp_traverse*/
+ __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_3_genexpr, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
- __pyx_methods_4cdec_5_cdec___pyx_scope_struct_11_sample, /*tp_methods*/
+ __pyx_methods_4cdec_5_cdec___pyx_scope_struct_3_genexpr, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
@@ -24054,7 +25110,7 @@ static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_11_sample = {
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_11_sample, /*tp_new*/
+ __pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_3_genexpr, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -24185,65 +25241,65 @@ static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_8_kbest = {
#endif
};
-static struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14___get__ *__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_14___get__[8];
-static int __pyx_freecount_4cdec_5_cdec___pyx_scope_struct_14___get__ = 0;
+static struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___get__ *__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_18___get__[8];
+static int __pyx_freecount_4cdec_5_cdec___pyx_scope_struct_18___get__ = 0;
-static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_14___get__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14___get__ *p;
+static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_18___get__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___get__ *p;
PyObject *o;
- if (likely((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_14___get__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14___get__)))) {
- o = (PyObject*)__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_14___get__[--__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_14___get__];
- memset(o, 0, sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14___get__));
+ if (likely((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_18___get__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___get__)))) {
+ o = (PyObject*)__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_18___get__[--__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_18___get__];
+ memset(o, 0, sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___get__));
PyObject_INIT(o, t);
PyObject_GC_Track(o);
} else {
o = (*t->tp_alloc)(t, 0);
if (unlikely(!o)) return 0;
}
- p = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14___get__ *)o);
+ p = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___get__ *)o);
p->__pyx_v_self = 0;
return o;
}
-static void __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_14___get__(PyObject *o) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14___get__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14___get__ *)o;
+static void __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_18___get__(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___get__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___get__ *)o;
PyObject_GC_UnTrack(o);
Py_CLEAR(p->__pyx_v_self);
- if ((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_14___get__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14___get__))) {
- __pyx_freelist_4cdec_5_cdec___pyx_scope_struct_14___get__[__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_14___get__++] = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14___get__ *)o);
+ if ((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_18___get__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___get__))) {
+ __pyx_freelist_4cdec_5_cdec___pyx_scope_struct_18___get__[__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_18___get__++] = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___get__ *)o);
} else {
(*Py_TYPE(o)->tp_free)(o);
}
}
-static int __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_14___get__(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_18___get__(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14___get__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14___get__ *)o;
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___get__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___get__ *)o;
if (p->__pyx_v_self) {
e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
}
return 0;
}
-static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_14___get__(PyObject *o) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14___get__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14___get__ *)o;
+static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_18___get__(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___get__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___get__ *)o;
PyObject* tmp;
tmp = ((PyObject*)p->__pyx_v_self);
- p->__pyx_v_self = ((struct __pyx_obj_4cdec_5_cdec_Hypergraph *)Py_None); Py_INCREF(Py_None);
+ p->__pyx_v_self = ((struct __pyx_obj_4cdec_5_cdec_HypergraphEdge *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
-static PyMethodDef __pyx_methods_4cdec_5_cdec___pyx_scope_struct_14___get__[] = {
+static PyMethodDef __pyx_methods_4cdec_5_cdec___pyx_scope_struct_18___get__[] = {
{0, 0, 0, 0}
};
-static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_14___get__ = {
+static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_18___get__ = {
PyVarObject_HEAD_INIT(0, 0)
- __Pyx_NAMESTR("cdec._cdec.__pyx_scope_struct_14___get__"), /*tp_name*/
- sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14___get__), /*tp_basicsize*/
+ __Pyx_NAMESTR("cdec._cdec.__pyx_scope_struct_18___get__"), /*tp_name*/
+ sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___get__), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_14___get__, /*tp_dealloc*/
+ __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_18___get__, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
@@ -24264,13 +25320,13 @@ static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_14___get__ = {
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_14___get__, /*tp_traverse*/
- __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_14___get__, /*tp_clear*/
+ __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_18___get__, /*tp_traverse*/
+ __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_18___get__, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
- __pyx_methods_4cdec_5_cdec___pyx_scope_struct_14___get__, /*tp_methods*/
+ __pyx_methods_4cdec_5_cdec___pyx_scope_struct_18___get__, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
@@ -24280,7 +25336,7 @@ static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_14___get__ = {
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_14___get__, /*tp_new*/
+ __pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_18___get__, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -24411,6 +25467,115 @@ static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_7___iter__ = {
#endif
};
+static struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19___get__ *__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_19___get__[8];
+static int __pyx_freecount_4cdec_5_cdec___pyx_scope_struct_19___get__ = 0;
+
+static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_19___get__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19___get__ *p;
+ PyObject *o;
+ if (likely((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_19___get__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19___get__)))) {
+ o = (PyObject*)__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_19___get__[--__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_19___get__];
+ memset(o, 0, sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19___get__));
+ PyObject_INIT(o, t);
+ PyObject_GC_Track(o);
+ } else {
+ o = (*t->tp_alloc)(t, 0);
+ if (unlikely(!o)) return 0;
+ }
+ p = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19___get__ *)o);
+ p->__pyx_v_self = 0;
+ return o;
+}
+
+static void __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_19___get__(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19___get__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19___get__ *)o;
+ PyObject_GC_UnTrack(o);
+ Py_CLEAR(p->__pyx_v_self);
+ if ((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_19___get__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19___get__))) {
+ __pyx_freelist_4cdec_5_cdec___pyx_scope_struct_19___get__[__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_19___get__++] = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19___get__ *)o);
+ } else {
+ (*Py_TYPE(o)->tp_free)(o);
+ }
+}
+
+static int __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_19___get__(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19___get__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19___get__ *)o;
+ if (p->__pyx_v_self) {
+ e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
+ }
+ return 0;
+}
+
+static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_19___get__(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19___get__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19___get__ *)o;
+ PyObject* tmp;
+ tmp = ((PyObject*)p->__pyx_v_self);
+ p->__pyx_v_self = ((struct __pyx_obj_4cdec_5_cdec_HypergraphNode *)Py_None); Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ return 0;
+}
+
+static PyMethodDef __pyx_methods_4cdec_5_cdec___pyx_scope_struct_19___get__[] = {
+ {0, 0, 0, 0}
+};
+
+static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_19___get__ = {
+ PyVarObject_HEAD_INIT(0, 0)
+ __Pyx_NAMESTR("cdec._cdec.__pyx_scope_struct_19___get__"), /*tp_name*/
+ sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_19___get__), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_19___get__, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #else
+ 0, /*reserved*/
+ #endif
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ 0, /*tp_doc*/
+ __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_19___get__, /*tp_traverse*/
+ __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_19___get__, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_4cdec_5_cdec___pyx_scope_struct_19___get__, /*tp_methods*/
+ 0, /*tp_members*/
+ 0, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ 0, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_19___get__, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ #if PY_VERSION_HEX >= 0x02060000
+ 0, /*tp_version_tag*/
+ #endif
+};
+
static PyObject *__pyx_tp_new_4cdec_5_cdec_TextGrammar(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_tp_new_4cdec_5_cdec_Grammar(t, a, k);
if (unlikely(!o)) return 0;
@@ -24481,6 +25646,115 @@ static PyTypeObject __pyx_type_4cdec_5_cdec_TextGrammar = {
#endif
};
+static struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25___iter__ *__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_25___iter__[8];
+static int __pyx_freecount_4cdec_5_cdec___pyx_scope_struct_25___iter__ = 0;
+
+static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_25___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25___iter__ *p;
+ PyObject *o;
+ if (likely((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_25___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25___iter__)))) {
+ o = (PyObject*)__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_25___iter__[--__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_25___iter__];
+ memset(o, 0, sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25___iter__));
+ PyObject_INIT(o, t);
+ PyObject_GC_Track(o);
+ } else {
+ o = (*t->tp_alloc)(t, 0);
+ if (unlikely(!o)) return 0;
+ }
+ p = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25___iter__ *)o);
+ p->__pyx_v_self = 0;
+ return o;
+}
+
+static void __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_25___iter__(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25___iter__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25___iter__ *)o;
+ PyObject_GC_UnTrack(o);
+ Py_CLEAR(p->__pyx_v_self);
+ if ((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_25___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25___iter__))) {
+ __pyx_freelist_4cdec_5_cdec___pyx_scope_struct_25___iter__[__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_25___iter__++] = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25___iter__ *)o);
+ } else {
+ (*Py_TYPE(o)->tp_free)(o);
+ }
+}
+
+static int __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_25___iter__(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25___iter__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25___iter__ *)o;
+ if (p->__pyx_v_self) {
+ e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
+ }
+ return 0;
+}
+
+static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_25___iter__(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25___iter__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25___iter__ *)o;
+ PyObject* tmp;
+ tmp = ((PyObject*)p->__pyx_v_self);
+ p->__pyx_v_self = ((struct __pyx_obj_4cdec_5_cdec_CandidateSet *)Py_None); Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ return 0;
+}
+
+static PyMethodDef __pyx_methods_4cdec_5_cdec___pyx_scope_struct_25___iter__[] = {
+ {0, 0, 0, 0}
+};
+
+static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_25___iter__ = {
+ PyVarObject_HEAD_INIT(0, 0)
+ __Pyx_NAMESTR("cdec._cdec.__pyx_scope_struct_25___iter__"), /*tp_name*/
+ sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_25___iter__), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_25___iter__, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #else
+ 0, /*reserved*/
+ #endif
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ 0, /*tp_doc*/
+ __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_25___iter__, /*tp_traverse*/
+ __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_25___iter__, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_4cdec_5_cdec___pyx_scope_struct_25___iter__, /*tp_methods*/
+ 0, /*tp_members*/
+ 0, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ 0, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_25___iter__, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ #if PY_VERSION_HEX >= 0x02060000
+ 0, /*tp_version_tag*/
+ #endif
+};
+
static PyObject *__pyx_tp_new_4cdec_5_cdec_Decoder(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
struct __pyx_obj_4cdec_5_cdec_Decoder *p;
PyObject *o;
@@ -24720,65 +25994,65 @@ static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct____iter__ = {
#endif
};
-static struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__ *__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_17___get__[8];
-static int __pyx_freecount_4cdec_5_cdec___pyx_scope_struct_17___get__ = 0;
+static struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14_sample *__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_14_sample[8];
+static int __pyx_freecount_4cdec_5_cdec___pyx_scope_struct_14_sample = 0;
-static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_17___get__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__ *p;
+static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_14_sample(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14_sample *p;
PyObject *o;
- if (likely((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_17___get__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__)))) {
- o = (PyObject*)__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_17___get__[--__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_17___get__];
- memset(o, 0, sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__));
+ if (likely((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_14_sample > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14_sample)))) {
+ o = (PyObject*)__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_14_sample[--__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_14_sample];
+ memset(o, 0, sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14_sample));
PyObject_INIT(o, t);
PyObject_GC_Track(o);
} else {
o = (*t->tp_alloc)(t, 0);
if (unlikely(!o)) return 0;
}
- p = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__ *)o);
+ p = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14_sample *)o);
p->__pyx_v_self = 0;
return o;
}
-static void __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_17___get__(PyObject *o) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__ *)o;
+static void __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_14_sample(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14_sample *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14_sample *)o;
PyObject_GC_UnTrack(o);
Py_CLEAR(p->__pyx_v_self);
- if ((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_17___get__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__))) {
- __pyx_freelist_4cdec_5_cdec___pyx_scope_struct_17___get__[__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_17___get__++] = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__ *)o);
+ if ((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_14_sample < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14_sample))) {
+ __pyx_freelist_4cdec_5_cdec___pyx_scope_struct_14_sample[__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_14_sample++] = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14_sample *)o);
} else {
(*Py_TYPE(o)->tp_free)(o);
}
}
-static int __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_17___get__(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_14_sample(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__ *)o;
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14_sample *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14_sample *)o;
if (p->__pyx_v_self) {
e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
}
return 0;
}
-static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_17___get__(PyObject *o) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__ *)o;
+static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_14_sample(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14_sample *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14_sample *)o;
PyObject* tmp;
tmp = ((PyObject*)p->__pyx_v_self);
- p->__pyx_v_self = ((struct __pyx_obj_4cdec_5_cdec_HypergraphNode *)Py_None); Py_INCREF(Py_None);
+ p->__pyx_v_self = ((struct __pyx_obj_4cdec_5_cdec_Hypergraph *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
-static PyMethodDef __pyx_methods_4cdec_5_cdec___pyx_scope_struct_17___get__[] = {
+static PyMethodDef __pyx_methods_4cdec_5_cdec___pyx_scope_struct_14_sample[] = {
{0, 0, 0, 0}
};
-static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_17___get__ = {
+static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_14_sample = {
PyVarObject_HEAD_INIT(0, 0)
- __Pyx_NAMESTR("cdec._cdec.__pyx_scope_struct_17___get__"), /*tp_name*/
- sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__), /*tp_basicsize*/
+ __Pyx_NAMESTR("cdec._cdec.__pyx_scope_struct_14_sample"), /*tp_name*/
+ sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_14_sample), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_17___get__, /*tp_dealloc*/
+ __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_14_sample, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
@@ -24799,13 +26073,13 @@ static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_17___get__ = {
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_17___get__, /*tp_traverse*/
- __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_17___get__, /*tp_clear*/
+ __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_14_sample, /*tp_traverse*/
+ __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_14_sample, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
- __pyx_methods_4cdec_5_cdec___pyx_scope_struct_17___get__, /*tp_methods*/
+ __pyx_methods_4cdec_5_cdec___pyx_scope_struct_14_sample, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
@@ -24815,7 +26089,7 @@ static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_17___get__ = {
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_17___get__, /*tp_new*/
+ __pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_14_sample, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -24829,65 +26103,65 @@ static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_17___get__ = {
#endif
};
-static struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___iter__ *__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_18___iter__[8];
-static int __pyx_freecount_4cdec_5_cdec___pyx_scope_struct_18___iter__ = 0;
+static struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__ *__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_17___get__[8];
+static int __pyx_freecount_4cdec_5_cdec___pyx_scope_struct_17___get__ = 0;
-static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_18___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___iter__ *p;
+static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_17___get__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__ *p;
PyObject *o;
- if (likely((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_18___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___iter__)))) {
- o = (PyObject*)__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_18___iter__[--__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_18___iter__];
- memset(o, 0, sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___iter__));
+ if (likely((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_17___get__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__)))) {
+ o = (PyObject*)__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_17___get__[--__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_17___get__];
+ memset(o, 0, sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__));
PyObject_INIT(o, t);
PyObject_GC_Track(o);
} else {
o = (*t->tp_alloc)(t, 0);
if (unlikely(!o)) return 0;
}
- p = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___iter__ *)o);
+ p = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__ *)o);
p->__pyx_v_self = 0;
return o;
}
-static void __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_18___iter__(PyObject *o) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___iter__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___iter__ *)o;
+static void __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_17___get__(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__ *)o;
PyObject_GC_UnTrack(o);
Py_CLEAR(p->__pyx_v_self);
- if ((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_18___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___iter__))) {
- __pyx_freelist_4cdec_5_cdec___pyx_scope_struct_18___iter__[__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_18___iter__++] = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___iter__ *)o);
+ if ((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_17___get__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__))) {
+ __pyx_freelist_4cdec_5_cdec___pyx_scope_struct_17___get__[__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_17___get__++] = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__ *)o);
} else {
(*Py_TYPE(o)->tp_free)(o);
}
}
-static int __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_18___iter__(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_17___get__(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___iter__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___iter__ *)o;
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__ *)o;
if (p->__pyx_v_self) {
e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
}
return 0;
}
-static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_18___iter__(PyObject *o) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___iter__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___iter__ *)o;
+static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_17___get__(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__ *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__ *)o;
PyObject* tmp;
tmp = ((PyObject*)p->__pyx_v_self);
- p->__pyx_v_self = ((struct __pyx_obj_4cdec_5_cdec_Lattice *)Py_None); Py_INCREF(Py_None);
+ p->__pyx_v_self = ((struct __pyx_obj_4cdec_5_cdec_Hypergraph *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
-static PyMethodDef __pyx_methods_4cdec_5_cdec___pyx_scope_struct_18___iter__[] = {
+static PyMethodDef __pyx_methods_4cdec_5_cdec___pyx_scope_struct_17___get__[] = {
{0, 0, 0, 0}
};
-static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_18___iter__ = {
+static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_17___get__ = {
PyVarObject_HEAD_INIT(0, 0)
- __Pyx_NAMESTR("cdec._cdec.__pyx_scope_struct_18___iter__"), /*tp_name*/
- sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_18___iter__), /*tp_basicsize*/
+ __Pyx_NAMESTR("cdec._cdec.__pyx_scope_struct_17___get__"), /*tp_name*/
+ sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_17___get__), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_18___iter__, /*tp_dealloc*/
+ __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_17___get__, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
@@ -24908,13 +26182,13 @@ static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_18___iter__ = {
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_18___iter__, /*tp_traverse*/
- __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_18___iter__, /*tp_clear*/
+ __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_17___get__, /*tp_traverse*/
+ __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_17___get__, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
- __pyx_methods_4cdec_5_cdec___pyx_scope_struct_18___iter__, /*tp_methods*/
+ __pyx_methods_4cdec_5_cdec___pyx_scope_struct_17___get__, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
@@ -24924,7 +26198,7 @@ static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_18___iter__ = {
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_18___iter__, /*tp_new*/
+ __pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_17___get__, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -25063,65 +26337,89 @@ static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_6_genexpr = {
#endif
};
-static struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_sample_trees *__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_12_sample_trees[8];
-static int __pyx_freecount_4cdec_5_cdec___pyx_scope_struct_12_sample_trees = 0;
+static struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees *__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees[8];
+static int __pyx_freecount_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees = 0;
-static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_12_sample_trees(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_sample_trees *p;
+static PyObject *__pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees *p;
PyObject *o;
- if (likely((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_12_sample_trees > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_sample_trees)))) {
- o = (PyObject*)__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_12_sample_trees[--__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_12_sample_trees];
- memset(o, 0, sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_sample_trees));
+ if (likely((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees)))) {
+ o = (PyObject*)__pyx_freelist_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees[--__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees];
+ memset(o, 0, sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees));
PyObject_INIT(o, t);
PyObject_GC_Track(o);
} else {
o = (*t->tp_alloc)(t, 0);
if (unlikely(!o)) return 0;
}
- p = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_sample_trees *)o);
+ p = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees *)o);
+ p->__pyx_v_e_tree = 0;
+ p->__pyx_v_f_tree = 0;
p->__pyx_v_self = 0;
+ p->__pyx_v_size = 0;
return o;
}
-static void __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_12_sample_trees(PyObject *o) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_sample_trees *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_sample_trees *)o;
+static void __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees *)o;
PyObject_GC_UnTrack(o);
+ Py_CLEAR(p->__pyx_v_e_tree);
+ Py_CLEAR(p->__pyx_v_f_tree);
Py_CLEAR(p->__pyx_v_self);
- if ((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_12_sample_trees < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_sample_trees))) {
- __pyx_freelist_4cdec_5_cdec___pyx_scope_struct_12_sample_trees[__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_12_sample_trees++] = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_sample_trees *)o);
+ Py_CLEAR(p->__pyx_v_size);
+ if ((__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees))) {
+ __pyx_freelist_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees[__pyx_freecount_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees++] = ((struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees *)o);
} else {
(*Py_TYPE(o)->tp_free)(o);
}
}
-static int __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_12_sample_trees(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_sample_trees *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_sample_trees *)o;
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees *)o;
+ if (p->__pyx_v_e_tree) {
+ e = (*v)(p->__pyx_v_e_tree, a); if (e) return e;
+ }
+ if (p->__pyx_v_f_tree) {
+ e = (*v)(p->__pyx_v_f_tree, a); if (e) return e;
+ }
if (p->__pyx_v_self) {
e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
}
+ if (p->__pyx_v_size) {
+ e = (*v)(p->__pyx_v_size, a); if (e) return e;
+ }
return 0;
}
-static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_12_sample_trees(PyObject *o) {
- struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_sample_trees *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_sample_trees *)o;
+static int __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees(PyObject *o) {
+ struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees *p = (struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees *)o;
PyObject* tmp;
+ tmp = ((PyObject*)p->__pyx_v_e_tree);
+ p->__pyx_v_e_tree = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_v_f_tree);
+ p->__pyx_v_f_tree = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
tmp = ((PyObject*)p->__pyx_v_self);
p->__pyx_v_self = ((struct __pyx_obj_4cdec_5_cdec_Hypergraph *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_v_size);
+ p->__pyx_v_size = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
return 0;
}
-static PyMethodDef __pyx_methods_4cdec_5_cdec___pyx_scope_struct_12_sample_trees[] = {
+static PyMethodDef __pyx_methods_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees[] = {
{0, 0, 0, 0}
};
-static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_12_sample_trees = {
+static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees = {
PyVarObject_HEAD_INIT(0, 0)
- __Pyx_NAMESTR("cdec._cdec.__pyx_scope_struct_12_sample_trees"), /*tp_name*/
- sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_sample_trees), /*tp_basicsize*/
+ __Pyx_NAMESTR("cdec._cdec.__pyx_scope_struct_12_unique_kbest_trees"), /*tp_name*/
+ sizeof(struct __pyx_obj_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_12_sample_trees, /*tp_dealloc*/
+ __pyx_tp_dealloc_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
@@ -25142,13 +26440,13 @@ static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_12_sample_trees =
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_12_sample_trees, /*tp_traverse*/
- __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_12_sample_trees, /*tp_clear*/
+ __pyx_tp_traverse_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees, /*tp_traverse*/
+ __pyx_tp_clear_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
- __pyx_methods_4cdec_5_cdec___pyx_scope_struct_12_sample_trees, /*tp_methods*/
+ __pyx_methods_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
@@ -25158,7 +26456,7 @@ static PyTypeObject __pyx_type_4cdec_5_cdec___pyx_scope_struct_12_sample_trees =
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_12_sample_trees, /*tp_new*/
+ __pyx_tp_new_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -25550,6 +26848,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s__strip, __pyx_k__strip, sizeof(__pyx_k__strip), 0, 0, 1, 1},
{&__pyx_n_s__super, __pyx_k__super, sizeof(__pyx_k__super), 0, 0, 1, 1},
{&__pyx_n_s__tagger, __pyx_k__tagger, sizeof(__pyx_k__tagger), 0, 0, 1, 1},
+ {&__pyx_n_s__text, __pyx_k__text, sizeof(__pyx_k__text), 0, 0, 1, 1},
{&__pyx_n_s__throw, __pyx_k__throw, sizeof(__pyx_k__throw), 0, 0, 1, 1},
{&__pyx_n_s__utf8, __pyx_k__utf8, sizeof(__pyx_k__utf8), 0, 0, 1, 1},
{&__pyx_n_s__value, __pyx_k__value, sizeof(__pyx_k__value), 0, 0, 1, 1},
@@ -25563,9 +26862,9 @@ static int __Pyx_InitCachedBuiltins(void) {
__pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s__KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s__NotImplemented); if (!__pyx_builtin_NotImplemented) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s__super); if (!__pyx_builtin_super) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_eval = __Pyx_GetBuiltinName(__pyx_n_s__eval); if (!__pyx_builtin_eval) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s__super); if (!__pyx_builtin_super) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_eval = __Pyx_GetBuiltinName(__pyx_n_s__eval); if (!__pyx_builtin_eval) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s__enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s__IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s__open); if (!__pyx_builtin_open) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
@@ -25589,7 +26888,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_k_tuple_2);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_2));
- /* "/home/pks/src/cdec-dtrain/python/cdec/vectors.pxi":95
+ /* "/usr0/home/austinma/git/cdec/python/cdec/vectors.pxi":95
* elif op == 3: # !=
* return not (x == y)
* raise NotImplemented('comparison not implemented for SparseVector') # <<<<<<<<<<<<<<
@@ -25600,7 +26899,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_k_tuple_5);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_5));
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":6
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":6
*
* def _phrase(phrase):
* return ' '.join(w.encode('utf8') if isinstance(w, unicode) else str(w) for w in phrase) # <<<<<<<<<<<<<<
@@ -25611,37 +26910,37 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_k_tuple_6);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_6));
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":226
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":232
* trule = convert_rule(trule)
* elif not isinstance(trule, TRule):
* raise ValueError('the grammar should contain TRule objects') # <<<<<<<<<<<<<<
* _g.AddRule((<TRule> trule).rule[0])
*/
- __pyx_k_tuple_14 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_13)); if (unlikely(!__pyx_k_tuple_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_14 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_13)); if (unlikely(!__pyx_k_tuple_14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_14);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_14));
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":244
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":292
* elif op == 3: # !=
* return not (x == y)
* raise NotImplemented('comparison not implemented for HypergraphEdge') # <<<<<<<<<<<<<<
*
* cdef class HypergraphNode:
*/
- __pyx_k_tuple_19 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_18)); if (unlikely(!__pyx_k_tuple_19)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_19 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_18)); if (unlikely(!__pyx_k_tuple_19)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_19);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_19));
- /* "/home/pks/src/cdec-dtrain/python/cdec/hypergraph.pxi":285
+ /* "/usr0/home/austinma/git/cdec/python/cdec/hypergraph.pxi":333
* elif op == 3: # !=
* return not (x == y)
* raise NotImplemented('comparison not implemented for HypergraphNode') # <<<<<<<<<<<<<<
*/
- __pyx_k_tuple_21 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_20)); if (unlikely(!__pyx_k_tuple_21)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_21 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_20)); if (unlikely(!__pyx_k_tuple_21)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_21);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_21));
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":26
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":26
* def __getitem__(self, int index):
* if not 0 <= index < len(self):
* raise IndexError('lattice index out of range') # <<<<<<<<<<<<<<
@@ -25652,7 +26951,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_k_tuple_24);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_24));
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":39
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":39
* def __setitem__(self, int index, tuple arcs):
* if not 0 <= index < len(self):
* raise IndexError('lattice index out of range') # <<<<<<<<<<<<<<
@@ -25663,7 +26962,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_k_tuple_25);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_25));
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":69
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":69
* for i in range(len(self)):
* for label, weight, delta in self[i]:
* yield '%d -> %d [label="%s"];' % (i, i+delta, label.replace('"', '\\"')) # <<<<<<<<<<<<<<
@@ -25674,7 +26973,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_k_tuple_32);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_32));
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":63
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":63
* def todot(self):
* """lattice.todot() -> Representation of the lattice in GraphViz dot format."""
* def lines(): # <<<<<<<<<<<<<<
@@ -25686,7 +26985,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_35));
__pyx_k_codeobj_36 = (PyObject*)__Pyx_PyCode_New(0, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_37, __pyx_n_s__lines, 63, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_36)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/pks/src/cdec-dtrain/python/cdec/lattice.pxi":72
+ /* "/usr0/home/austinma/git/cdec/python/cdec/lattice.pxi":72
* yield '%d [shape=doublecircle]' % len(self)
* yield '}'
* return '\n'.join(lines()).encode('utf8') # <<<<<<<<<<<<<<
@@ -25697,7 +26996,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_k_tuple_41);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_41));
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":50
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":50
* def __getitem__(self, int index):
* if not 0 <= index < len(self):
* raise IndexError('sufficient stats vector index out of range') # <<<<<<<<<<<<<<
@@ -25708,7 +27007,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_k_tuple_43);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_43));
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":84
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":84
* def __getitem__(self,int k):
* if not 0 <= k < self.cs.size():
* raise IndexError('candidate set index out of range') # <<<<<<<<<<<<<<
@@ -25741,7 +27040,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_k_tuple_52);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_52));
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":5
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":5
* import cdec.sa._sa as _sa
*
* def _phrase(phrase): # <<<<<<<<<<<<<<
@@ -25753,7 +27052,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_56));
__pyx_k_codeobj_57 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_58, __pyx_n_s___phrase, 5, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_57)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":194
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":194
* return []
*
* BLEU = Scorer('IBM_BLEU') # <<<<<<<<<<<<<<
@@ -25764,7 +27063,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_k_tuple_59);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_59));
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":195
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":195
*
* BLEU = Scorer('IBM_BLEU')
* QCRI = Scorer('QCRI_BLEU') # <<<<<<<<<<<<<<
@@ -25775,7 +27074,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_k_tuple_60);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_60));
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":196
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":196
* BLEU = Scorer('IBM_BLEU')
* QCRI = Scorer('QCRI_BLEU')
* TER = Scorer('TER') # <<<<<<<<<<<<<<
@@ -25786,7 +27085,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_k_tuple_61);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_61));
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":197
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":197
* QCRI = Scorer('QCRI_BLEU')
* TER = Scorer('TER')
* CER = Scorer('CER') # <<<<<<<<<<<<<<
@@ -25796,7 +27095,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GOTREF(__pyx_k_tuple_62);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_62));
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":198
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":198
* TER = Scorer('TER')
* CER = Scorer('CER')
* SSK = Scorer('SSK') # <<<<<<<<<<<<<<
@@ -25927,6 +27226,8 @@ PyMODINIT_FUNC PyInit__cdec(void)
/*--- Variable export code ---*/
/*--- Function export code ---*/
/*--- Type init code ---*/
+ if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_24___iter__) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_4cdec_5_cdec___pyx_scope_struct_24___iter__ = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_24___iter__;
if (PyType_Ready(&__pyx_type_4cdec_5_cdec_TRule) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#if CYTHON_COMPILING_IN_CPYTHON
{
@@ -25941,10 +27242,10 @@ PyMODINIT_FUNC PyInit__cdec(void)
if (__Pyx_SetAttrString(__pyx_m, "TRule", (PyObject *)&__pyx_type_4cdec_5_cdec_TRule) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_5_cdec_TRule = &__pyx_type_4cdec_5_cdec_TRule;
__pyx_type_4cdec_5_cdec_MRule.tp_base = __pyx_ptype_4cdec_5_cdec_TRule;
- if (PyType_Ready(&__pyx_type_4cdec_5_cdec_MRule) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_4cdec_5_cdec_MRule) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#if CYTHON_COMPILING_IN_CPYTHON
{
- PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_4cdec_5_cdec_MRule, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_4cdec_5_cdec_MRule, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_4cdec_5_cdec_5MRule___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_4cdec_5_cdec_5MRule___init__.doc = __pyx_doc_4cdec_5_cdec_5MRule___init__;
@@ -25952,10 +27253,8 @@ PyMODINIT_FUNC PyInit__cdec(void)
}
}
#endif
- if (__Pyx_SetAttrString(__pyx_m, "MRule", (PyObject *)&__pyx_type_4cdec_5_cdec_MRule) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetAttrString(__pyx_m, "MRule", (PyObject *)&__pyx_type_4cdec_5_cdec_MRule) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_5_cdec_MRule = &__pyx_type_4cdec_5_cdec_MRule;
- if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_22___iter__) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_4cdec_5_cdec___pyx_scope_struct_22___iter__ = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_22___iter__;
if (PyType_Ready(&__pyx_type_4cdec_5_cdec_DenseVector) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#if CYTHON_COMPILING_IN_CPYTHON
{
@@ -25972,11 +27271,17 @@ PyMODINIT_FUNC PyInit__cdec(void)
if (PyType_Ready(&__pyx_type_4cdec_5_cdec_SufficientStats) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__Pyx_SetAttrString(__pyx_m, "SufficientStats", (PyObject *)&__pyx_type_4cdec_5_cdec_SufficientStats) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_5_cdec_SufficientStats = &__pyx_type_4cdec_5_cdec_SufficientStats;
- if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_21___iter__) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_23_lines) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_4cdec_5_cdec___pyx_scope_struct_23_lines = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_23_lines;
+ if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_27___init__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_4cdec_5_cdec___pyx_scope_struct_27___init__ = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_27___init__;
+ if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_21___iter__) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_21___iter__ = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_21___iter__;
if (PyType_Ready(&__pyx_type_4cdec_5_cdec_Metric) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__Pyx_SetAttrString(__pyx_m, "Metric", (PyObject *)&__pyx_type_4cdec_5_cdec_Metric) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_5_cdec_Metric = &__pyx_type_4cdec_5_cdec_Metric;
+ if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_11_unique_kbest;
if (PyType_Ready(&__pyx_type_4cdec_5_cdec_Candidate) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__Pyx_SetAttrString(__pyx_m, "Candidate", (PyObject *)&__pyx_type_4cdec_5_cdec_Candidate) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_5_cdec_Candidate = &__pyx_type_4cdec_5_cdec_Candidate;
@@ -25993,8 +27298,8 @@ PyMODINIT_FUNC PyInit__cdec(void)
#endif
if (__Pyx_SetAttrString(__pyx_m, "SparseVector", (PyObject *)&__pyx_type_4cdec_5_cdec_SparseVector) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_5_cdec_SparseVector = &__pyx_type_4cdec_5_cdec_SparseVector;
- if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_15___get__) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_4cdec_5_cdec___pyx_scope_struct_15___get__ = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_15___get__;
+ if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_26__make_config) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_4cdec_5_cdec___pyx_scope_struct_26__make_config = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_26__make_config;
if (PyType_Ready(&__pyx_type_4cdec_5_cdec_NT) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#if CYTHON_COMPILING_IN_CPYTHON
{
@@ -26021,28 +27326,24 @@ PyMODINIT_FUNC PyInit__cdec(void)
#endif
if (__Pyx_SetAttrString(__pyx_m, "Lattice", (PyObject *)&__pyx_type_4cdec_5_cdec_Lattice) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_5_cdec_Lattice = &__pyx_type_4cdec_5_cdec_Lattice;
- if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_23__make_config) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_4cdec_5_cdec___pyx_scope_struct_23__make_config = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_23__make_config;
+ if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_15_sample_trees) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_4cdec_5_cdec___pyx_scope_struct_15_sample_trees = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_15_sample_trees;
__pyx_vtabptr_4cdec_5_cdec_HypergraphEdge = &__pyx_vtable_4cdec_5_cdec_HypergraphEdge;
__pyx_vtable_4cdec_5_cdec_HypergraphEdge.init = (PyObject *(*)(struct __pyx_obj_4cdec_5_cdec_HypergraphEdge *, Hypergraph *, unsigned int))__pyx_f_4cdec_5_cdec_14HypergraphEdge_init;
- if (PyType_Ready(&__pyx_type_4cdec_5_cdec_HypergraphEdge) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__Pyx_SetVtable(__pyx_type_4cdec_5_cdec_HypergraphEdge.tp_dict, __pyx_vtabptr_4cdec_5_cdec_HypergraphEdge) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__Pyx_SetAttrString(__pyx_m, "HypergraphEdge", (PyObject *)&__pyx_type_4cdec_5_cdec_HypergraphEdge) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_4cdec_5_cdec_HypergraphEdge) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetVtable(__pyx_type_4cdec_5_cdec_HypergraphEdge.tp_dict, __pyx_vtabptr_4cdec_5_cdec_HypergraphEdge) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetAttrString(__pyx_m, "HypergraphEdge", (PyObject *)&__pyx_type_4cdec_5_cdec_HypergraphEdge) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_5_cdec_HypergraphEdge = &__pyx_type_4cdec_5_cdec_HypergraphEdge;
if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_2__phrase) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_2__phrase = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_2__phrase;
- if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_13___get__) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_4cdec_5_cdec___pyx_scope_struct_13___get__ = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_13___get__;
- if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_20_lines) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_4cdec_5_cdec___pyx_scope_struct_20_lines = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_20_lines;
if (PyType_Ready(&__pyx_type_4cdec_5_cdec_Scorer) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__Pyx_SetAttrString(__pyx_m, "Scorer", (PyObject *)&__pyx_type_4cdec_5_cdec_Scorer) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_5_cdec_Scorer = &__pyx_type_4cdec_5_cdec_Scorer;
__pyx_vtabptr_4cdec_5_cdec_HypergraphNode = &__pyx_vtable_4cdec_5_cdec_HypergraphNode;
__pyx_vtable_4cdec_5_cdec_HypergraphNode.init = (PyObject *(*)(struct __pyx_obj_4cdec_5_cdec_HypergraphNode *, Hypergraph *, unsigned int))__pyx_f_4cdec_5_cdec_14HypergraphNode_init;
- if (PyType_Ready(&__pyx_type_4cdec_5_cdec_HypergraphNode) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__Pyx_SetVtable(__pyx_type_4cdec_5_cdec_HypergraphNode.tp_dict, __pyx_vtabptr_4cdec_5_cdec_HypergraphNode) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__Pyx_SetAttrString(__pyx_m, "HypergraphNode", (PyObject *)&__pyx_type_4cdec_5_cdec_HypergraphNode) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_4cdec_5_cdec_HypergraphNode) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetVtable(__pyx_type_4cdec_5_cdec_HypergraphNode.tp_dict, __pyx_vtabptr_4cdec_5_cdec_HypergraphNode) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetAttrString(__pyx_m, "HypergraphNode", (PyObject *)&__pyx_type_4cdec_5_cdec_HypergraphNode) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_5_cdec_HypergraphNode = &__pyx_type_4cdec_5_cdec_HypergraphNode;
if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_10_kbest_features) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_10_kbest_features = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_10_kbest_features;
@@ -26059,8 +27360,8 @@ PyMODINIT_FUNC PyInit__cdec(void)
#endif
if (__Pyx_SetAttrString(__pyx_m, "NTRef", (PyObject *)&__pyx_type_4cdec_5_cdec_NTRef) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_5_cdec_NTRef = &__pyx_type_4cdec_5_cdec_NTRef;
- if (PyType_Ready(&__pyx_type_4cdec_5_cdec_Grammar) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__Pyx_SetAttrString(__pyx_m, "Grammar", (PyObject *)&__pyx_type_4cdec_5_cdec_Grammar) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_4cdec_5_cdec_Grammar) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetAttrString(__pyx_m, "Grammar", (PyObject *)&__pyx_type_4cdec_5_cdec_Grammar) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_5_cdec_Grammar = &__pyx_type_4cdec_5_cdec_Grammar;
__pyx_vtabptr_4cdec_5_cdec_Hypergraph = &__pyx_vtable_4cdec_5_cdec_Hypergraph;
__pyx_vtable_4cdec_5_cdec_Hypergraph._rng = (MT19937 *(*)(struct __pyx_obj_4cdec_5_cdec_Hypergraph *))__pyx_f_4cdec_5_cdec_10Hypergraph__rng;
@@ -26068,39 +27369,41 @@ PyMODINIT_FUNC PyInit__cdec(void)
if (__Pyx_SetVtable(__pyx_type_4cdec_5_cdec_Hypergraph.tp_dict, __pyx_vtabptr_4cdec_5_cdec_Hypergraph) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__Pyx_SetAttrString(__pyx_m, "Hypergraph", (PyObject *)&__pyx_type_4cdec_5_cdec_Hypergraph) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_5_cdec_Hypergraph = &__pyx_type_4cdec_5_cdec_Hypergraph;
- if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_24___init__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_4cdec_5_cdec___pyx_scope_struct_24___init__ = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_24___init__;
if (PyType_Ready(&__pyx_type_4cdec_5_cdec_CandidateSet) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__Pyx_SetAttrString(__pyx_m, "CandidateSet", (PyObject *)&__pyx_type_4cdec_5_cdec_CandidateSet) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_5_cdec_CandidateSet = &__pyx_type_4cdec_5_cdec_CandidateSet;
+ if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_22_todot) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_4cdec_5_cdec___pyx_scope_struct_22_todot = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_22_todot;
if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_9_kbest_trees;
- if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_19_todot) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_4cdec_5_cdec___pyx_scope_struct_19_todot = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_19_todot;
- if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_5___str__) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_5___str__) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_5___str__ = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_5___str__;
if (PyType_Ready(&__pyx_type_4cdec_5_cdec_SegmentEvaluator) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__Pyx_SetAttrString(__pyx_m, "SegmentEvaluator", (PyObject *)&__pyx_type_4cdec_5_cdec_SegmentEvaluator) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_5_cdec_SegmentEvaluator = &__pyx_type_4cdec_5_cdec_SegmentEvaluator;
- if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_16___get__) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_16___get__) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_16___get__ = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_16___get__;
- if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_25_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_4cdec_5_cdec___pyx_scope_struct_25_genexpr = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_25_genexpr;
+ if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_20___get__) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_4cdec_5_cdec___pyx_scope_struct_20___get__ = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_20___get__;
+ if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_13_unique_kbest_features;
+ if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_28_genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_4cdec_5_cdec___pyx_scope_struct_28_genexpr = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_28_genexpr;
if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_3_genexpr) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_3_genexpr = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_3_genexpr;
- if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_11_sample) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_4cdec_5_cdec___pyx_scope_struct_11_sample = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_11_sample;
if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_8_kbest) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_8_kbest = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_8_kbest;
- if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_14___get__) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_4cdec_5_cdec___pyx_scope_struct_14___get__ = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_14___get__;
- if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_7___iter__) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_18___get__) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_4cdec_5_cdec___pyx_scope_struct_18___get__ = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_18___get__;
+ if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_7___iter__) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_7___iter__ = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_7___iter__;
+ if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_19___get__) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_4cdec_5_cdec___pyx_scope_struct_19___get__ = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_19___get__;
__pyx_type_4cdec_5_cdec_TextGrammar.tp_base = __pyx_ptype_4cdec_5_cdec_Grammar;
- if (PyType_Ready(&__pyx_type_4cdec_5_cdec_TextGrammar) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_4cdec_5_cdec_TextGrammar) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#if CYTHON_COMPILING_IN_CPYTHON
{
- PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_4cdec_5_cdec_TextGrammar, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_4cdec_5_cdec_TextGrammar, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_4cdec_5_cdec_11TextGrammar___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_4cdec_5_cdec_11TextGrammar___init__.doc = __pyx_doc_4cdec_5_cdec_11TextGrammar___init__;
@@ -26108,8 +27411,10 @@ PyMODINIT_FUNC PyInit__cdec(void)
}
}
#endif
- if (__Pyx_SetAttrString(__pyx_m, "TextGrammar", (PyObject *)&__pyx_type_4cdec_5_cdec_TextGrammar) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetAttrString(__pyx_m, "TextGrammar", (PyObject *)&__pyx_type_4cdec_5_cdec_TextGrammar) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_5_cdec_TextGrammar = &__pyx_type_4cdec_5_cdec_TextGrammar;
+ if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_25___iter__) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_4cdec_5_cdec___pyx_scope_struct_25___iter__ = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_25___iter__;
if (PyType_Ready(&__pyx_type_4cdec_5_cdec_Decoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#if CYTHON_COMPILING_IN_CPYTHON
{
@@ -26125,15 +27430,15 @@ PyMODINIT_FUNC PyInit__cdec(void)
__pyx_ptype_4cdec_5_cdec_Decoder = &__pyx_type_4cdec_5_cdec_Decoder;
if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct____iter__) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_5_cdec___pyx_scope_struct____iter__ = &__pyx_type_4cdec_5_cdec___pyx_scope_struct____iter__;
- if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_17___get__) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_14_sample) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_4cdec_5_cdec___pyx_scope_struct_14_sample = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_14_sample;
+ if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_17___get__) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_17___get__ = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_17___get__;
- if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_18___iter__) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_4cdec_5_cdec___pyx_scope_struct_18___iter__ = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_18___iter__;
- if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_6_genexpr) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_6_genexpr) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_6_genexpr = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_6_genexpr;
- if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_12_sample_trees) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_4cdec_5_cdec___pyx_scope_struct_12_sample_trees = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_12_sample_trees;
- if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_4___get__) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_ptype_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_12_unique_kbest_trees;
+ if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_4___get__) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_4___get__ = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_4___get__;
if (PyType_Ready(&__pyx_type_4cdec_5_cdec___pyx_scope_struct_1___iter__) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_4cdec_5_cdec___pyx_scope_struct_1___iter__ = &__pyx_type_4cdec_5_cdec___pyx_scope_struct_1___iter__;
@@ -26156,7 +27461,7 @@ PyMODINIT_FUNC PyInit__cdec(void)
Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/*--- Execution code ---*/
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":3
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":3
* cimport grammar
* cimport cdec.sa._sa as _sa
* import cdec.sa._sa as _sa # <<<<<<<<<<<<<<
@@ -26174,7 +27479,7 @@ PyMODINIT_FUNC PyInit__cdec(void)
if (PyDict_SetItem(__pyx_d, __pyx_n_s___sa, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/grammar.pxi":5
+ /* "/usr0/home/austinma/git/cdec/python/cdec/grammar.pxi":5
* import cdec.sa._sa as _sa
*
* def _phrase(phrase): # <<<<<<<<<<<<<<
@@ -26186,7 +27491,7 @@ PyMODINIT_FUNC PyInit__cdec(void)
if (PyDict_SetItem(__pyx_d, __pyx_n_s___phrase, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":194
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":194
* return []
*
* BLEU = Scorer('IBM_BLEU') # <<<<<<<<<<<<<<
@@ -26198,7 +27503,7 @@ PyMODINIT_FUNC PyInit__cdec(void)
if (PyDict_SetItem(__pyx_d, __pyx_n_s__BLEU, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":195
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":195
*
* BLEU = Scorer('IBM_BLEU')
* QCRI = Scorer('QCRI_BLEU') # <<<<<<<<<<<<<<
@@ -26210,7 +27515,7 @@ PyMODINIT_FUNC PyInit__cdec(void)
if (PyDict_SetItem(__pyx_d, __pyx_n_s__QCRI, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":196
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":196
* BLEU = Scorer('IBM_BLEU')
* QCRI = Scorer('QCRI_BLEU')
* TER = Scorer('TER') # <<<<<<<<<<<<<<
@@ -26222,7 +27527,7 @@ PyMODINIT_FUNC PyInit__cdec(void)
if (PyDict_SetItem(__pyx_d, __pyx_n_s__TER, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":197
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":197
* QCRI = Scorer('QCRI_BLEU')
* TER = Scorer('TER')
* CER = Scorer('CER') # <<<<<<<<<<<<<<
@@ -26233,7 +27538,7 @@ PyMODINIT_FUNC PyInit__cdec(void)
if (PyDict_SetItem(__pyx_d, __pyx_n_s__CER, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/pks/src/cdec-dtrain/python/cdec/mteval.pxi":198
+ /* "/usr0/home/austinma/git/cdec/python/cdec/mteval.pxi":198
* TER = Scorer('TER')
* CER = Scorer('CER')
* SSK = Scorer('SSK') # <<<<<<<<<<<<<<