diff options
Diffstat (limited to 'python/src/_cdec.cpp')
-rw-r--r-- | python/src/_cdec.cpp | 1480 |
1 files changed, 758 insertions, 722 deletions
diff --git a/python/src/_cdec.cpp b/python/src/_cdec.cpp index 00cb0641..86a41763 100644 --- a/python/src/_cdec.cpp +++ b/python/src/_cdec.cpp @@ -1,4 +1,4 @@ -/* Generated by Cython 0.17.1 on Sun Nov 18 15:08:18 2012 */ +/* Generated by Cython 0.17.1 on Sun Dec 23 21:56:58 2012 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -283,6 +283,7 @@ #include "decoder/decoder.h" #include "observer.h" #include "stdio.h" +#include "unistd.h" #include "decoder/kbest.h" #include "mteval/ns.h" #include "py_scorer.h" @@ -403,6 +404,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_Rule; struct __pyx_obj_5_cdec_MRule; struct __pyx_obj_5_cdec_SegmentEvaluator; struct __pyx_obj_5_cdec___pyx_scope_struct_25_genexpr; +struct __pyx_obj_4cdec_2sa_3_sa_MemoryMap; struct __pyx_obj_5_cdec___pyx_scope_struct_19_todot; struct __pyx_obj_5_cdec_Candidate; struct __pyx_obj_5_cdec___pyx_scope_struct_6_genexpr; @@ -448,8 +450,8 @@ struct __pyx_opt_args_5_cdec_as_str { char *error_msg; }; -/* "/home/vchahune/tools/cdec/python/src/cdec.sa._sa.pxd":25 - * cdef void read_handle(self, FILE* f) +/* "/Users/vchahun/Sandbox/cdec/python/src/cdec.sa._sa.pxd":39 + * cdef void read_mmaped(self, MemoryMap buf) * * cdef class FeatureVector: # <<<<<<<<<<<<<< * cdef IntList names @@ -475,7 +477,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_24___init__ { }; -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":21 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":21 * return '[%s]' % self.cat * * cdef class NTRef: # <<<<<<<<<<<<<< @@ -488,7 +490,7 @@ struct __pyx_obj_5_cdec_NTRef { }; -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":121 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":121 * return CandidateSet(self) * * cdef class Scorer: # <<<<<<<<<<<<<< @@ -502,8 +504,8 @@ struct __pyx_obj_5_cdec_Scorer { }; -/* "/home/vchahune/tools/cdec/python/src/cdec.sa._sa.pxd":12 - * cdef void read_handle(self, FILE* f) +/* "/Users/vchahun/Sandbox/cdec/python/src/cdec.sa._sa.pxd":25 + * cdef void read_mmaped(self, MemoryMap buf) * * cdef class IntList: # <<<<<<<<<<<<<< * cdef int size @@ -516,10 +518,11 @@ struct __pyx_obj_4cdec_2sa_3_sa_IntList { int increment; int len; int *arr; + PyObject *memory; }; -/* "/home/vchahune/tools/cdec/python/src/cdec.sa._sa.pxd":29 +/* "/Users/vchahun/Sandbox/cdec/python/src/cdec.sa._sa.pxd":43 * cdef FloatList values * * cdef class Phrase: # <<<<<<<<<<<<<< @@ -536,7 +539,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_Phrase { }; -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":90 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":90 * return candidate * * def __iter__(self): # <<<<<<<<<<<<<< @@ -552,7 +555,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_22___iter__ { }; -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":193 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":193 * super(MRule, self).__init__(lhs, rhs, e, scores, None) * * cdef class Grammar: # <<<<<<<<<<<<<< @@ -565,7 +568,7 @@ struct __pyx_obj_5_cdec_Grammar { }; -/* "/home/vchahune/tools/cdec/python/src/lattice.pxi":63 +/* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":63 * def todot(self): * """lattice.todot() -> Representation of the lattice in GraphViz dot format.""" * def lines(): # <<<<<<<<<<<<<< @@ -588,7 +591,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_20_lines { }; -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":108 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":108 * del hypos * * def sample_trees(self, unsigned n): # <<<<<<<<<<<<<< @@ -606,7 +609,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_12_sample_trees { }; -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":161 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":161 * * property edges: * def __get__(self): # <<<<<<<<<<<<<< @@ -622,7 +625,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_13___get__ { }; -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":5 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":5 * import cdec.sa._sa as _sa * * def _phrase(phrase): # <<<<<<<<<<<<<< @@ -635,7 +638,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_2__phrase { }; -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":65 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":65 * return result * * cdef class CandidateSet: # <<<<<<<<<<<<<< @@ -650,7 +653,7 @@ struct __pyx_obj_5_cdec_CandidateSet { }; -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":167 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":167 * * property nodes: * def __get__(self): # <<<<<<<<<<<<<< @@ -666,7 +669,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_14___get__ { }; -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":49 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":49 * return TRule(lhs, f, e, scores, a) * * cdef class TRule: # <<<<<<<<<<<<<< @@ -678,14 +681,6 @@ struct __pyx_obj_5_cdec_TRule { boost::shared_ptr<TRule> *rule; }; - -/* "/home/vchahune/tools/cdec/python/src/cdec.sa._sa.pxd":35 - * cdef public int chunklen(self, int k) - * - * cdef class Rule: # <<<<<<<<<<<<<< - * cdef int lhs - * cdef readonly Phrase f, e - */ struct __pyx_obj_4cdec_2sa_3_sa_Rule { PyObject_HEAD int lhs; @@ -697,7 +692,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_Rule { }; -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":177 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":177 * _phrase(self.f), _phrase(self.e), scores) * * cdef class MRule(TRule): # <<<<<<<<<<<<<< @@ -709,7 +704,7 @@ struct __pyx_obj_5_cdec_MRule { }; -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":100 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":100 * self.cs.AddKBestCandidates(hypergraph.hg[0], k, self.scorer.get()) * * cdef class SegmentEvaluator: # <<<<<<<<<<<<<< @@ -740,7 +735,24 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_25_genexpr { }; -/* "/home/vchahune/tools/cdec/python/src/lattice.pxi":61 +/* "/Users/vchahun/Sandbox/cdec/python/src/cdec.sa._sa.pxd":4 + * from posix.unistd cimport off_t + * + * cdef class MemoryMap: # <<<<<<<<<<<<<< + * cdef int fd + * cdef off_t fs + */ +struct __pyx_obj_4cdec_2sa_3_sa_MemoryMap { + PyObject_HEAD + struct __pyx_vtabstruct_4cdec_2sa_3_sa_MemoryMap *__pyx_vtab; + int fd; + off_t fs; + void *map_start; + void *map_ptr; +}; + + +/* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":61 * yield self[i] * * def todot(self): # <<<<<<<<<<<<<< @@ -753,7 +765,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_19_todot { }; -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":12 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":12 * return stats * * cdef class Candidate: # <<<<<<<<<<<<<< @@ -767,7 +779,7 @@ struct __pyx_obj_5_cdec_Candidate { }; -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":173 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":173 * * def __str__(self): * scores = ' '.join('%s=%s' % feat for feat in self.scores) # <<<<<<<<<<<<<< @@ -784,7 +796,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_6_genexpr { }; -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":8 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":8 * return ' '.join(w.encode('utf8') if isinstance(w, unicode) else str(w) for w in phrase) * * cdef class NT: # <<<<<<<<<<<<<< @@ -798,8 +810,8 @@ struct __pyx_obj_5_cdec_NT { }; -/* "/home/vchahune/tools/cdec/python/src/cdec.sa._sa.pxd":3 - * from libc.stdio cimport FILE +/* "/Users/vchahun/Sandbox/cdec/python/src/cdec.sa._sa.pxd":14 + * cdef float* read_float_array(self, int size) * * cdef class FloatList: # <<<<<<<<<<<<<< * cdef int size @@ -812,10 +824,11 @@ struct __pyx_obj_4cdec_2sa_3_sa_FloatList { int increment; int len; float *arr; + PyObject *memory; }; -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":196 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":196 * return vector * * cdef class HypergraphEdge: # <<<<<<<<<<<<<< @@ -831,7 +844,7 @@ struct __pyx_obj_5_cdec_HypergraphEdge { }; -/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":72 +/* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":72 * self.vector.set_value(fid, value) * * def __iter__(self): # <<<<<<<<<<<<<< @@ -848,7 +861,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_1___iter__ { }; -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":256 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":256 * * property in_edges: * def __get__(self): # <<<<<<<<<<<<<< @@ -864,7 +877,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_16___get__ { }; -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":131 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":131 * * property a: * def __get__(self): # <<<<<<<<<<<<<< @@ -881,7 +894,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_4___get__ { }; -/* "/home/vchahune/tools/cdec/python/src/lattice.pxi":56 +/* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":56 * return unicode(str(self), 'utf8') * * def __iter__(self): # <<<<<<<<<<<<<< @@ -911,7 +924,7 @@ struct __pyx_obj_5_cdec_Decoder { }; -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":246 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":246 * raise NotImplemented('comparison not implemented for HypergraphEdge') * * cdef class HypergraphNode: # <<<<<<<<<<<<<< @@ -926,7 +939,7 @@ struct __pyx_obj_5_cdec_HypergraphNode { }; -/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":48 +/* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":48 * return sparse * * cdef class SparseVector: # <<<<<<<<<<<<<< @@ -939,7 +952,7 @@ struct __pyx_obj_5_cdec_SparseVector { }; -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":262 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":262 * * property out_edges: * def __get__(self): # <<<<<<<<<<<<<< @@ -955,7 +968,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_17___get__ { }; -/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":32 +/* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":32 * self.vector[0][fid] = value * * def __iter__(self): # <<<<<<<<<<<<<< @@ -971,7 +984,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct____iter__ { }; -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":44 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":44 * return self.stats.size() * * def __iter__(self): # <<<<<<<<<<<<<< @@ -988,7 +1001,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_21___iter__ { }; -/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":3 +/* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":3 * from cython.operator cimport preincrement as pinc * * cdef class DenseVector: # <<<<<<<<<<<<<< @@ -1002,7 +1015,7 @@ struct __pyx_obj_5_cdec_DenseVector { }; -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":199 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":199 * del self.grammar * * def __iter__(self): # <<<<<<<<<<<<<< @@ -1021,7 +1034,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_7___iter__ { }; -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":176 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":176 * out.fields[i] = ss[i] * * cdef class Metric: # <<<<<<<<<<<<<< @@ -1034,7 +1047,7 @@ struct __pyx_obj_5_cdec_Metric { }; -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":26 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":26 * return fmap * * cdef class SufficientStats: # <<<<<<<<<<<<<< @@ -1048,7 +1061,7 @@ struct __pyx_obj_5_cdec_SufficientStats { }; -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":49 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":49 * return unicode(hypergraph.JoshuaVisualizationString(self.hg[0]).c_str(), 'utf8') * * def kbest(self, size): # <<<<<<<<<<<<<< @@ -1067,7 +1080,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_8_kbest { }; -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":81 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":81 * del e_derivations * * def kbest_features(self, size): # <<<<<<<<<<<<<< @@ -1087,7 +1100,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_10_kbest_features { }; -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":216 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":216 * * property tail_nodes: * def __get__(self): # <<<<<<<<<<<<<< @@ -1103,7 +1116,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_15___get__ { }; -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":172 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":172 * self.rule.get().lhs_ = -TDConvert((<NT> lhs).cat) * * def __str__(self): # <<<<<<<<<<<<<< @@ -1116,7 +1129,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_5___str__ { }; -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":6 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":6 * * def _phrase(phrase): * return ' '.join(w.encode('utf8') if isinstance(w, unicode) else str(w) for w in phrase) # <<<<<<<<<<<<<< @@ -1133,7 +1146,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_3_genexpr { }; -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":62 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":62 * del derivations * * def kbest_trees(self, size): # <<<<<<<<<<<<<< @@ -1156,7 +1169,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_9_kbest_trees { }; -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":4 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":4 * cimport kbest * * cdef class Hypergraph: # <<<<<<<<<<<<<< @@ -1171,7 +1184,7 @@ struct __pyx_obj_5_cdec_Hypergraph { }; -/* "/home/vchahune/tools/cdec/python/src/lattice.pxi":3 +/* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":3 * cimport lattice * * cdef class Lattice: # <<<<<<<<<<<<<< @@ -1184,7 +1197,7 @@ struct __pyx_obj_5_cdec_Lattice { }; -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":97 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":97 * del derivations * * def sample(self, unsigned n): # <<<<<<<<<<<<<< @@ -1225,7 +1238,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_23__make_config { }; -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":217 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":217 * self.grammar.get().SetGrammarName(name) * * cdef class TextGrammar(Grammar): # <<<<<<<<<<<<<< @@ -1238,7 +1251,7 @@ struct __pyx_obj_5_cdec_TextGrammar { -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":4 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":4 * cimport kbest * * cdef class Hypergraph: # <<<<<<<<<<<<<< @@ -1252,22 +1265,39 @@ struct __pyx_vtabstruct_5_cdec_Hypergraph { static struct __pyx_vtabstruct_5_cdec_Hypergraph *__pyx_vtabptr_5_cdec_Hypergraph; -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":196 - * return vector +/* "/Users/vchahun/Sandbox/cdec/python/src/cdec.sa._sa.pxd":14 + * cdef float* read_float_array(self, int size) * - * cdef class HypergraphEdge: # <<<<<<<<<<<<<< + * cdef class FloatList: # <<<<<<<<<<<<<< + * cdef int size + * cdef int increment + */ + +struct __pyx_vtabstruct_4cdec_2sa_3_sa_FloatList { + void (*set)(struct __pyx_obj_4cdec_2sa_3_sa_FloatList *, int, float); + void (*write_handle)(struct __pyx_obj_4cdec_2sa_3_sa_FloatList *, FILE *); + void (*read_handle)(struct __pyx_obj_4cdec_2sa_3_sa_FloatList *, FILE *); + void (*read_mmaped)(struct __pyx_obj_4cdec_2sa_3_sa_FloatList *, struct __pyx_obj_4cdec_2sa_3_sa_MemoryMap *); +}; +static struct __pyx_vtabstruct_4cdec_2sa_3_sa_FloatList *__pyx_vtabptr_4cdec_2sa_3_sa_FloatList; + + +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":246 + * raise NotImplemented('comparison not implemented for HypergraphEdge') + * + * cdef class HypergraphNode: # <<<<<<<<<<<<<< * cdef hypergraph.Hypergraph* hg - * cdef hypergraph.HypergraphEdge* edge + * cdef hypergraph.HypergraphNode* node */ -struct __pyx_vtabstruct_5_cdec_HypergraphEdge { - PyObject *(*init)(struct __pyx_obj_5_cdec_HypergraphEdge *, Hypergraph *, unsigned int); +struct __pyx_vtabstruct_5_cdec_HypergraphNode { + PyObject *(*init)(struct __pyx_obj_5_cdec_HypergraphNode *, Hypergraph *, unsigned int); }; -static struct __pyx_vtabstruct_5_cdec_HypergraphEdge *__pyx_vtabptr_5_cdec_HypergraphEdge; +static struct __pyx_vtabstruct_5_cdec_HypergraphNode *__pyx_vtabptr_5_cdec_HypergraphNode; -/* "/home/vchahune/tools/cdec/python/src/cdec.sa._sa.pxd":12 - * cdef void read_handle(self, FILE* f) +/* "/Users/vchahun/Sandbox/cdec/python/src/cdec.sa._sa.pxd":25 + * cdef void read_mmaped(self, MemoryMap buf) * * cdef class IntList: # <<<<<<<<<<<<<< * cdef int size @@ -1277,32 +1307,30 @@ static struct __pyx_vtabstruct_5_cdec_HypergraphEdge *__pyx_vtabptr_5_cdec_Hyper struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList { void (*set)(struct __pyx_obj_4cdec_2sa_3_sa_IntList *, int, int); void (*_append)(struct __pyx_obj_4cdec_2sa_3_sa_IntList *, int); - void (*_extend)(struct __pyx_obj_4cdec_2sa_3_sa_IntList *, struct __pyx_obj_4cdec_2sa_3_sa_IntList *); void (*_extend_arr)(struct __pyx_obj_4cdec_2sa_3_sa_IntList *, int *, int); void (*_clear)(struct __pyx_obj_4cdec_2sa_3_sa_IntList *); void (*write_handle)(struct __pyx_obj_4cdec_2sa_3_sa_IntList *, FILE *); void (*read_handle)(struct __pyx_obj_4cdec_2sa_3_sa_IntList *, FILE *); + void (*read_mmaped)(struct __pyx_obj_4cdec_2sa_3_sa_IntList *, struct __pyx_obj_4cdec_2sa_3_sa_MemoryMap *); }; static struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *__pyx_vtabptr_4cdec_2sa_3_sa_IntList; -/* "/home/vchahune/tools/cdec/python/src/cdec.sa._sa.pxd":3 - * from libc.stdio cimport FILE +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":196 + * return vector * - * cdef class FloatList: # <<<<<<<<<<<<<< - * cdef int size - * cdef int increment + * cdef class HypergraphEdge: # <<<<<<<<<<<<<< + * cdef hypergraph.Hypergraph* hg + * cdef hypergraph.HypergraphEdge* edge */ -struct __pyx_vtabstruct_4cdec_2sa_3_sa_FloatList { - void (*set)(struct __pyx_obj_4cdec_2sa_3_sa_FloatList *, int, float); - void (*write_handle)(struct __pyx_obj_4cdec_2sa_3_sa_FloatList *, FILE *); - void (*read_handle)(struct __pyx_obj_4cdec_2sa_3_sa_FloatList *, FILE *); +struct __pyx_vtabstruct_5_cdec_HypergraphEdge { + PyObject *(*init)(struct __pyx_obj_5_cdec_HypergraphEdge *, Hypergraph *, unsigned int); }; -static struct __pyx_vtabstruct_4cdec_2sa_3_sa_FloatList *__pyx_vtabptr_4cdec_2sa_3_sa_FloatList; +static struct __pyx_vtabstruct_5_cdec_HypergraphEdge *__pyx_vtabptr_5_cdec_HypergraphEdge; -/* "/home/vchahune/tools/cdec/python/src/cdec.sa._sa.pxd":29 +/* "/Users/vchahun/Sandbox/cdec/python/src/cdec.sa._sa.pxd":43 * cdef FloatList values * * cdef class Phrase: # <<<<<<<<<<<<<< @@ -1317,18 +1345,21 @@ 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/vchahune/tools/cdec/python/src/hypergraph.pxi":246 - * raise NotImplemented('comparison not implemented for HypergraphEdge') +/* "/Users/vchahun/Sandbox/cdec/python/src/cdec.sa._sa.pxd":4 + * from posix.unistd cimport off_t * - * cdef class HypergraphNode: # <<<<<<<<<<<<<< - * cdef hypergraph.Hypergraph* hg - * cdef hypergraph.HypergraphNode* node + * cdef class MemoryMap: # <<<<<<<<<<<<<< + * cdef int fd + * cdef off_t fs */ -struct __pyx_vtabstruct_5_cdec_HypergraphNode { - PyObject *(*init)(struct __pyx_obj_5_cdec_HypergraphNode *, Hypergraph *, unsigned int); +struct __pyx_vtabstruct_4cdec_2sa_3_sa_MemoryMap { + int (*read_int)(struct __pyx_obj_4cdec_2sa_3_sa_MemoryMap *); + int *(*read_int_array)(struct __pyx_obj_4cdec_2sa_3_sa_MemoryMap *, int); + char *(*read_char_array)(struct __pyx_obj_4cdec_2sa_3_sa_MemoryMap *, int); + float *(*read_float_array)(struct __pyx_obj_4cdec_2sa_3_sa_MemoryMap *, int); }; -static struct __pyx_vtabstruct_5_cdec_HypergraphNode *__pyx_vtabptr_5_cdec_HypergraphNode; +static struct __pyx_vtabstruct_4cdec_2sa_3_sa_MemoryMap *__pyx_vtabptr_4cdec_2sa_3_sa_MemoryMap; #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif @@ -1765,7 +1796,10 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ /* Module declarations from 'libc.stdio' */ +/* Module declarations from 'posix.unistd' */ + /* Module declarations from 'cdec.sa._sa' */ +static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_MemoryMap = 0; static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_FloatList = 0; static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_IntList = 0; static PyTypeObject *__pyx_ptype_4cdec_2sa_3_sa_FeatureVector = 0; @@ -2026,7 +2060,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/vchahune/tools/cdec/python/src/lattice.pxi"; +static char __pyx_k_37[] = "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi"; static char __pyx_k_38[] = "\n"; static char __pyx_k_40[] = "sufficient stats vector index out of range"; static char __pyx_k_42[] = "candidate set index out of range"; @@ -2038,8 +2072,8 @@ static char __pyx_k_49[] = "#"; static char __pyx_k_52[] = "Cannot translate input type %s"; static char __pyx_k_53[] = "cdec.sa._sa"; static char __pyx_k_54[] = "*"; -static char __pyx_k_57[] = "/home/vchahune/tools/cdec/python/src/grammar.pxi"; -static char __pyx_k_63[] = "/home/vchahune/tools/cdec/python/src/_cdec.pyx"; +static char __pyx_k_57[] = "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi"; +static char __pyx_k_63[] = "/Users/vchahun/Sandbox/cdec/python/src/_cdec.pyx"; static char __pyx_k__a[] = "a"; static char __pyx_k__e[] = "e"; static char __pyx_k__f[] = "f"; @@ -2452,7 +2486,7 @@ static int __pyx_pw_5_cdec_11DenseVector_1__init__(PyObject *__pyx_v_self, PyObj return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":7 +/* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":7 * cdef bint owned # if True, do not manage memory * * def __init__(self): # <<<<<<<<<<<<<< @@ -2469,7 +2503,7 @@ static int __pyx_pf_5_cdec_11DenseVector___init__(struct __pyx_obj_5_cdec_DenseV int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":9 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":9 * def __init__(self): * """DenseVector() -> Dense weight/feature vector.""" * self.vector = new vector[weight_t]() # <<<<<<<<<<<<<< @@ -2479,7 +2513,7 @@ static int __pyx_pf_5_cdec_11DenseVector___init__(struct __pyx_obj_5_cdec_DenseV try {__pyx_t_1 = new std::vector<weight_t>();} catch(...) {__Pyx_CppExn2PyErr(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}} __pyx_v_self->vector = __pyx_t_1; - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":10 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":10 * """DenseVector() -> Dense weight/feature vector.""" * self.vector = new vector[weight_t]() * self.owned = False # <<<<<<<<<<<<<< @@ -2507,7 +2541,7 @@ static void __pyx_pw_5_cdec_11DenseVector_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyFinishContext(); } -/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":12 +/* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":12 * self.owned = False * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -2520,7 +2554,7 @@ static void __pyx_pf_5_cdec_11DenseVector_2__dealloc__(struct __pyx_obj_5_cdec_D int __pyx_t_1; __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":13 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":13 * * def __dealloc__(self): * if not self.owned: # <<<<<<<<<<<<<< @@ -2530,7 +2564,7 @@ static void __pyx_pf_5_cdec_11DenseVector_2__dealloc__(struct __pyx_obj_5_cdec_D __pyx_t_1 = (!__pyx_v_self->owned); if (__pyx_t_1) { - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":14 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":14 * def __dealloc__(self): * if not self.owned: * del self.vector # <<<<<<<<<<<<<< @@ -2556,7 +2590,7 @@ static Py_ssize_t __pyx_pw_5_cdec_11DenseVector_5__len__(PyObject *__pyx_v_self) return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":16 +/* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":16 * del self.vector * * def __len__(self): # <<<<<<<<<<<<<< @@ -2569,7 +2603,7 @@ static Py_ssize_t __pyx_pf_5_cdec_11DenseVector_4__len__(struct __pyx_obj_5_cdec __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__", 0); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":17 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":17 * * def __len__(self): * return self.vector.size() # <<<<<<<<<<<<<< @@ -2606,7 +2640,7 @@ static PyObject *__pyx_pw_5_cdec_11DenseVector_7__getitem__(PyObject *__pyx_v_se return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":19 +/* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":19 * return self.vector.size() * * def __getitem__(self, char* fname): # <<<<<<<<<<<<<< @@ -2626,7 +2660,7 @@ static PyObject *__pyx_pf_5_cdec_11DenseVector_6__getitem__(struct __pyx_obj_5_c int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":20 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":20 * * def __getitem__(self, char* fname): * cdef int fid = FDConvert(fname) # <<<<<<<<<<<<<< @@ -2635,7 +2669,7 @@ static PyObject *__pyx_pf_5_cdec_11DenseVector_6__getitem__(struct __pyx_obj_5_c */ __pyx_v_fid = FD::Convert(__pyx_v_fname); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":21 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":21 * def __getitem__(self, char* fname): * cdef int fid = FDConvert(fname) * if 0 <= fid < self.vector.size(): # <<<<<<<<<<<<<< @@ -2648,7 +2682,7 @@ static PyObject *__pyx_pf_5_cdec_11DenseVector_6__getitem__(struct __pyx_obj_5_c } if (__pyx_t_1) { - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":22 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":22 * cdef int fid = FDConvert(fname) * if 0 <= fid < self.vector.size(): * return self.vector[0][fid] # <<<<<<<<<<<<<< @@ -2665,7 +2699,7 @@ static PyObject *__pyx_pf_5_cdec_11DenseVector_6__getitem__(struct __pyx_obj_5_c } __pyx_L3:; - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":23 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":23 * if 0 <= fid < self.vector.size(): * return self.vector[0][fid] * raise KeyError(fname) # <<<<<<<<<<<<<< @@ -2724,7 +2758,7 @@ static int __pyx_pw_5_cdec_11DenseVector_9__setitem__(PyObject *__pyx_v_self, Py return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":25 +/* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":25 * raise KeyError(fname) * * def __setitem__(self, char* fname, float value): # <<<<<<<<<<<<<< @@ -2744,7 +2778,7 @@ static int __pyx_pf_5_cdec_11DenseVector_8__setitem__(struct __pyx_obj_5_cdec_De int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 0); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":26 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":26 * * def __setitem__(self, char* fname, float value): * cdef int fid = FDConvert(fname) # <<<<<<<<<<<<<< @@ -2753,7 +2787,7 @@ static int __pyx_pf_5_cdec_11DenseVector_8__setitem__(struct __pyx_obj_5_cdec_De */ __pyx_v_fid = FD::Convert(__pyx_v_fname); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":27 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":27 * def __setitem__(self, char* fname, float value): * cdef int fid = FDConvert(fname) * if fid < 0: raise KeyError(fname) # <<<<<<<<<<<<<< @@ -2779,7 +2813,7 @@ static int __pyx_pf_5_cdec_11DenseVector_8__setitem__(struct __pyx_obj_5_cdec_De } __pyx_L3:; - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":28 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":28 * cdef int fid = FDConvert(fname) * if fid < 0: raise KeyError(fname) * if self.vector.size() <= fid: # <<<<<<<<<<<<<< @@ -2789,7 +2823,7 @@ static int __pyx_pf_5_cdec_11DenseVector_8__setitem__(struct __pyx_obj_5_cdec_De __pyx_t_1 = (__pyx_v_self->vector->size() <= __pyx_v_fid); if (__pyx_t_1) { - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":29 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":29 * if fid < 0: raise KeyError(fname) * if self.vector.size() <= fid: * self.vector.resize(fid + 1) # <<<<<<<<<<<<<< @@ -2801,7 +2835,7 @@ static int __pyx_pf_5_cdec_11DenseVector_8__setitem__(struct __pyx_obj_5_cdec_De } __pyx_L4:; - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":30 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":30 * if self.vector.size() <= fid: * self.vector.resize(fid + 1) * self.vector[0][fid] = value # <<<<<<<<<<<<<< @@ -2834,7 +2868,7 @@ static PyObject *__pyx_pw_5_cdec_11DenseVector_11__iter__(PyObject *__pyx_v_self return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":32 +/* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":32 * self.vector[0][fid] = value * * def __iter__(self): # <<<<<<<<<<<<<< @@ -2899,7 +2933,7 @@ static PyObject *__pyx_gb_5_cdec_11DenseVector_12generator(__pyx_GeneratorObject __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/vchahune/tools/cdec/python/src/vectors.pxi":34 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":34 * def __iter__(self): * cdef unsigned fid * for fid in range(1, self.vector.size()): # <<<<<<<<<<<<<< @@ -2910,7 +2944,7 @@ static PyObject *__pyx_gb_5_cdec_11DenseVector_12generator(__pyx_GeneratorObject 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/vchahune/tools/cdec/python/src/vectors.pxi":35 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":35 * cdef unsigned fid * for fid in range(1, self.vector.size()): * yield str(FDConvert(fid).c_str()), self.vector[0][fid] # <<<<<<<<<<<<<< @@ -2983,7 +3017,7 @@ static PyObject *__pyx_pw_5_cdec_11DenseVector_14dot(PyObject *__pyx_v_self, PyO return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":37 +/* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":37 * yield str(FDConvert(fid).c_str()), self.vector[0][fid] * * def dot(self, SparseVector other): # <<<<<<<<<<<<<< @@ -3002,7 +3036,7 @@ static PyObject *__pyx_pf_5_cdec_11DenseVector_13dot(struct __pyx_obj_5_cdec_Den int __pyx_clineno = 0; __Pyx_RefNannySetupContext("dot", 0); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":39 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":39 * def dot(self, SparseVector other): * """vector.dot(SparseVector other) -> Dot product of the two vectors.""" * return other.dot(self) # <<<<<<<<<<<<<< @@ -3051,7 +3085,7 @@ static PyObject *__pyx_pw_5_cdec_11DenseVector_16tosparse(PyObject *__pyx_v_self return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":41 +/* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":41 * return other.dot(self) * * def tosparse(self): # <<<<<<<<<<<<<< @@ -3069,7 +3103,7 @@ static PyObject *__pyx_pf_5_cdec_11DenseVector_15tosparse(struct __pyx_obj_5_cde int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tosparse", 0); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":43 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":43 * def tosparse(self): * """vector.tosparse() -> Equivalent SparseVector.""" * cdef SparseVector sparse = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<< @@ -3082,7 +3116,7 @@ static PyObject *__pyx_pf_5_cdec_11DenseVector_15tosparse(struct __pyx_obj_5_cde __pyx_v_sparse = ((struct __pyx_obj_5_cdec_SparseVector *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":44 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":44 * """vector.tosparse() -> Equivalent SparseVector.""" * cdef SparseVector sparse = SparseVector.__new__(SparseVector) * sparse.vector = new FastSparseVector[weight_t]() # <<<<<<<<<<<<<< @@ -3091,7 +3125,7 @@ static PyObject *__pyx_pf_5_cdec_11DenseVector_15tosparse(struct __pyx_obj_5_cde */ __pyx_v_sparse->vector = new FastSparseVector<weight_t>(); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":45 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":45 * cdef SparseVector sparse = SparseVector.__new__(SparseVector) * sparse.vector = new FastSparseVector[weight_t]() * InitSparseVector(self.vector[0], sparse.vector) # <<<<<<<<<<<<<< @@ -3100,7 +3134,7 @@ static PyObject *__pyx_pf_5_cdec_11DenseVector_15tosparse(struct __pyx_obj_5_cde */ Weights::InitSparseVector((__pyx_v_self->vector[0]), __pyx_v_sparse->vector); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":46 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":46 * sparse.vector = new FastSparseVector[weight_t]() * InitSparseVector(self.vector[0], sparse.vector) * return sparse # <<<<<<<<<<<<<< @@ -3143,7 +3177,7 @@ static int __pyx_pw_5_cdec_12SparseVector_1__init__(PyObject *__pyx_v_self, PyOb return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":51 +/* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":51 * cdef FastSparseVector[weight_t]* vector * * def __init__(self): # <<<<<<<<<<<<<< @@ -3156,7 +3190,7 @@ static int __pyx_pf_5_cdec_12SparseVector___init__(struct __pyx_obj_5_cdec_Spars __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":53 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":53 * def __init__(self): * """SparseVector() -> Sparse feature/weight vector.""" * self.vector = new FastSparseVector[weight_t]() # <<<<<<<<<<<<<< @@ -3179,7 +3213,7 @@ static void __pyx_pw_5_cdec_12SparseVector_3__dealloc__(PyObject *__pyx_v_self) __Pyx_RefNannyFinishContext(); } -/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":55 +/* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":55 * self.vector = new FastSparseVector[weight_t]() * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -3191,7 +3225,7 @@ static void __pyx_pf_5_cdec_12SparseVector_2__dealloc__(CYTHON_UNUSED struct __p __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":56 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":56 * * def __dealloc__(self): * del self.vector # <<<<<<<<<<<<<< @@ -3215,7 +3249,7 @@ static PyObject *__pyx_pw_5_cdec_12SparseVector_5copy(PyObject *__pyx_v_self, CY return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":58 +/* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":58 * del self.vector * * def copy(self): # <<<<<<<<<<<<<< @@ -3232,7 +3266,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_4copy(struct __pyx_obj_5_cdec_Sp int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 0); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":60 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":60 * def copy(self): * """vector.copy() -> SparseVector copy.""" * return self * 1 # <<<<<<<<<<<<<< @@ -3279,7 +3313,7 @@ static PyObject *__pyx_pw_5_cdec_12SparseVector_7__getitem__(PyObject *__pyx_v_s return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":62 +/* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":62 * return self * 1 * * def __getitem__(self, char* fname): # <<<<<<<<<<<<<< @@ -3299,7 +3333,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_6__getitem__(struct __pyx_obj_5_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":63 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":63 * * def __getitem__(self, char* fname): * cdef int fid = FDConvert(fname) # <<<<<<<<<<<<<< @@ -3308,7 +3342,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_6__getitem__(struct __pyx_obj_5_ */ __pyx_v_fid = FD::Convert(__pyx_v_fname); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":64 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":64 * def __getitem__(self, char* fname): * cdef int fid = FDConvert(fname) * if fid < 0: raise KeyError(fname) # <<<<<<<<<<<<<< @@ -3334,7 +3368,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_6__getitem__(struct __pyx_obj_5_ } __pyx_L3:; - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":65 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":65 * cdef int fid = FDConvert(fname) * if fid < 0: raise KeyError(fname) * return self.vector.value(fid) # <<<<<<<<<<<<<< @@ -3386,7 +3420,7 @@ static int __pyx_pw_5_cdec_12SparseVector_9__setitem__(PyObject *__pyx_v_self, P return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":67 +/* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":67 * return self.vector.value(fid) * * def __setitem__(self, char* fname, float value): # <<<<<<<<<<<<<< @@ -3406,7 +3440,7 @@ static int __pyx_pf_5_cdec_12SparseVector_8__setitem__(struct __pyx_obj_5_cdec_S int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 0); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":68 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":68 * * def __setitem__(self, char* fname, float value): * cdef int fid = FDConvert(fname) # <<<<<<<<<<<<<< @@ -3415,7 +3449,7 @@ static int __pyx_pf_5_cdec_12SparseVector_8__setitem__(struct __pyx_obj_5_cdec_S */ __pyx_v_fid = FD::Convert(__pyx_v_fname); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":69 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":69 * def __setitem__(self, char* fname, float value): * cdef int fid = FDConvert(fname) * if fid < 0: raise KeyError(fname) # <<<<<<<<<<<<<< @@ -3441,7 +3475,7 @@ static int __pyx_pf_5_cdec_12SparseVector_8__setitem__(struct __pyx_obj_5_cdec_S } __pyx_L3:; - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":70 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":70 * cdef int fid = FDConvert(fname) * if fid < 0: raise KeyError(fname) * self.vector.set_value(fid, value) # <<<<<<<<<<<<<< @@ -3474,7 +3508,7 @@ static PyObject *__pyx_pw_5_cdec_12SparseVector_11__iter__(PyObject *__pyx_v_sel return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":72 +/* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":72 * self.vector.set_value(fid, value) * * def __iter__(self): # <<<<<<<<<<<<<< @@ -3539,7 +3573,7 @@ static PyObject *__pyx_gb_5_cdec_12SparseVector_12generator1(__pyx_GeneratorObje __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/vchahune/tools/cdec/python/src/vectors.pxi":73 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":73 * * def __iter__(self): * cdef FastSparseVector[weight_t].const_iterator* it = new FastSparseVector[weight_t].const_iterator(self.vector[0], False) # <<<<<<<<<<<<<< @@ -3548,7 +3582,7 @@ static PyObject *__pyx_gb_5_cdec_12SparseVector_12generator1(__pyx_GeneratorObje */ __pyx_cur_scope->__pyx_v_it = new FastSparseVector<weight_t>::const_iterator((__pyx_cur_scope->__pyx_v_self->vector[0]), 0); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":75 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":75 * cdef FastSparseVector[weight_t].const_iterator* it = new FastSparseVector[weight_t].const_iterator(self.vector[0], False) * cdef unsigned i * try: # <<<<<<<<<<<<<< @@ -3557,7 +3591,7 @@ static PyObject *__pyx_gb_5_cdec_12SparseVector_12generator1(__pyx_GeneratorObje */ /*try:*/ { - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":76 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":76 * cdef unsigned i * try: * for i in range(self.vector.size()): # <<<<<<<<<<<<<< @@ -3568,7 +3602,7 @@ static PyObject *__pyx_gb_5_cdec_12SparseVector_12generator1(__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/vchahune/tools/cdec/python/src/vectors.pxi":77 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":77 * try: * for i in range(self.vector.size()): * yield (str(FDConvert(it[0].ptr().first).c_str()), it[0].ptr().second) # <<<<<<<<<<<<<< @@ -3609,7 +3643,7 @@ static PyObject *__pyx_gb_5_cdec_12SparseVector_12generator1(__pyx_GeneratorObje __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/vchahune/tools/cdec/python/src/vectors.pxi":78 + /* "/Users/vchahun/Sandbox/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -3620,7 +3654,7 @@ static PyObject *__pyx_gb_5_cdec_12SparseVector_12generator1(__pyx_GeneratorObje } } - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":80 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":80 * pinc(it[0]) # ++it * finally: * del it # <<<<<<<<<<<<<< @@ -3682,7 +3716,7 @@ static PyObject *__pyx_pw_5_cdec_12SparseVector_14dot(PyObject *__pyx_v_self, Py return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":82 +/* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":82 * del it * * def dot(self, other): # <<<<<<<<<<<<<< @@ -3701,7 +3735,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_13dot(struct __pyx_obj_5_cdec_Sp int __pyx_clineno = 0; __Pyx_RefNannySetupContext("dot", 0); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":84 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":84 * def dot(self, other): * """vector.dot(SparseVector/DenseVector other) -> Dot product of the two vectors.""" * if isinstance(other, DenseVector): # <<<<<<<<<<<<<< @@ -3714,7 +3748,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_13dot(struct __pyx_obj_5_cdec_Sp __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":85 + /* "/Users/vchahun/Sandbox/cdec/python/src/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]) # <<<<<<<<<<<<<< @@ -3730,7 +3764,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_13dot(struct __pyx_obj_5_cdec_Sp goto __pyx_L3; } - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":86 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":86 * if isinstance(other, DenseVector): * return self.vector.dot((<DenseVector> other).vector[0]) * elif isinstance(other, SparseVector): # <<<<<<<<<<<<<< @@ -3743,7 +3777,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_13dot(struct __pyx_obj_5_cdec_Sp __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":87 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":87 * return self.vector.dot((<DenseVector> other).vector[0]) * elif isinstance(other, SparseVector): * return self.vector.dot((<SparseVector> other).vector[0]) # <<<<<<<<<<<<<< @@ -3760,7 +3794,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_13dot(struct __pyx_obj_5_cdec_Sp } __pyx_L3:; - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":88 + /* "/Users/vchahun/Sandbox/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -3811,7 +3845,7 @@ static PyObject *__pyx_pw_5_cdec_12SparseVector_16__richcmp__(PyObject *__pyx_v_ return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":90 +/* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":90 * raise TypeError('cannot take the dot product of %s and SparseVector' % type(other)) * * def __richcmp__(SparseVector x, SparseVector y, int op): # <<<<<<<<<<<<<< @@ -3829,7 +3863,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_15__richcmp__(struct __pyx_obj_5 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__richcmp__", 0); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":93 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":93 * if op == 2: # == * return x.vector[0] == y.vector[0] * elif op == 3: # != # <<<<<<<<<<<<<< @@ -3838,7 +3872,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_15__richcmp__(struct __pyx_obj_5 */ switch (__pyx_v_op) { - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":91 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":91 * * def __richcmp__(SparseVector x, SparseVector y, int op): * if op == 2: # == # <<<<<<<<<<<<<< @@ -3847,7 +3881,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_15__richcmp__(struct __pyx_obj_5 */ case 2: - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":92 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":92 * def __richcmp__(SparseVector x, SparseVector y, int op): * if op == 2: # == * return x.vector[0] == y.vector[0] # <<<<<<<<<<<<<< @@ -3862,7 +3896,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_15__richcmp__(struct __pyx_obj_5 goto __pyx_L0; break; - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":93 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":93 * if op == 2: # == * return x.vector[0] == y.vector[0] * elif op == 3: # != # <<<<<<<<<<<<<< @@ -3871,7 +3905,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_15__richcmp__(struct __pyx_obj_5 */ case 3: - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":94 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":94 * return x.vector[0] == y.vector[0] * elif op == 3: # != * return not (x == y) # <<<<<<<<<<<<<< @@ -3890,7 +3924,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_15__richcmp__(struct __pyx_obj_5 break; } - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":95 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":95 * elif op == 3: # != * return not (x == y) * raise NotImplemented('comparison not implemented for SparseVector') # <<<<<<<<<<<<<< @@ -3926,7 +3960,7 @@ static Py_ssize_t __pyx_pw_5_cdec_12SparseVector_18__len__(PyObject *__pyx_v_sel return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":97 +/* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":97 * raise NotImplemented('comparison not implemented for SparseVector') * * def __len__(self): # <<<<<<<<<<<<<< @@ -3939,7 +3973,7 @@ static Py_ssize_t __pyx_pf_5_cdec_12SparseVector_17__len__(struct __pyx_obj_5_cd __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__", 0); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":98 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":98 * * def __len__(self): * return self.vector.size() # <<<<<<<<<<<<<< @@ -3976,7 +4010,7 @@ static int __pyx_pw_5_cdec_12SparseVector_20__contains__(PyObject *__pyx_v_self, return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":100 +/* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":100 * return self.vector.size() * * def __contains__(self, char* fname): # <<<<<<<<<<<<<< @@ -3989,7 +4023,7 @@ static int __pyx_pf_5_cdec_12SparseVector_19__contains__(struct __pyx_obj_5_cdec __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__contains__", 0); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":101 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":101 * * def __contains__(self, char* fname): * return self.vector.nonzero(FDConvert(fname)) # <<<<<<<<<<<<<< @@ -4016,7 +4050,7 @@ static PyObject *__pyx_pw_5_cdec_12SparseVector_22__neg__(PyObject *__pyx_v_self return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":103 +/* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":103 * return self.vector.nonzero(FDConvert(fname)) * * def __neg__(self): # <<<<<<<<<<<<<< @@ -4034,7 +4068,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_21__neg__(struct __pyx_obj_5_cde int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__neg__", 0); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":104 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":104 * * def __neg__(self): * cdef SparseVector result = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<< @@ -4047,7 +4081,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_21__neg__(struct __pyx_obj_5_cde __pyx_v_result = ((struct __pyx_obj_5_cdec_SparseVector *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":105 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":105 * def __neg__(self): * cdef SparseVector result = SparseVector.__new__(SparseVector) * result.vector = new FastSparseVector[weight_t](self.vector[0]) # <<<<<<<<<<<<<< @@ -4056,7 +4090,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_21__neg__(struct __pyx_obj_5_cde */ __pyx_v_result->vector = new FastSparseVector<weight_t>((__pyx_v_self->vector[0])); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":106 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":106 * cdef SparseVector result = SparseVector.__new__(SparseVector) * result.vector = new FastSparseVector[weight_t](self.vector[0]) * result.vector[0] *= -1.0 # <<<<<<<<<<<<<< @@ -4065,7 +4099,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_21__neg__(struct __pyx_obj_5_cde */ (__pyx_v_result->vector[0]) *= -1.0; - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":107 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":107 * result.vector = new FastSparseVector[weight_t](self.vector[0]) * result.vector[0] *= -1.0 * return result # <<<<<<<<<<<<<< @@ -4106,7 +4140,7 @@ static PyObject *__pyx_pw_5_cdec_12SparseVector_24__iadd__(PyObject *__pyx_v_sel return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":109 +/* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":109 * return result * * def __iadd__(SparseVector self, SparseVector other): # <<<<<<<<<<<<<< @@ -4119,7 +4153,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_23__iadd__(struct __pyx_obj_5_cd __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iadd__", 0); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":110 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":110 * * def __iadd__(SparseVector self, SparseVector other): * self.vector[0] += other.vector[0] # <<<<<<<<<<<<<< @@ -4128,7 +4162,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_23__iadd__(struct __pyx_obj_5_cd */ (__pyx_v_self->vector[0]) += (__pyx_v_other->vector[0]); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":111 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":111 * def __iadd__(SparseVector self, SparseVector other): * self.vector[0] += other.vector[0] * return self # <<<<<<<<<<<<<< @@ -4163,7 +4197,7 @@ static PyObject *__pyx_pw_5_cdec_12SparseVector_26__isub__(PyObject *__pyx_v_sel return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":113 +/* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":113 * return self * * def __isub__(SparseVector self, SparseVector other): # <<<<<<<<<<<<<< @@ -4176,7 +4210,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_25__isub__(struct __pyx_obj_5_cd __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__isub__", 0); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":114 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":114 * * def __isub__(SparseVector self, SparseVector other): * self.vector[0] -= other.vector[0] # <<<<<<<<<<<<<< @@ -4185,7 +4219,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_25__isub__(struct __pyx_obj_5_cd */ (__pyx_v_self->vector[0]) -= (__pyx_v_other->vector[0]); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":115 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":115 * def __isub__(SparseVector self, SparseVector other): * self.vector[0] -= other.vector[0] * return self # <<<<<<<<<<<<<< @@ -4225,7 +4259,7 @@ static PyObject *__pyx_pw_5_cdec_12SparseVector_28__imul__(PyObject *__pyx_v_sel return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":117 +/* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":117 * return self * * def __imul__(SparseVector self, float scalar): # <<<<<<<<<<<<<< @@ -4238,7 +4272,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_27__imul__(struct __pyx_obj_5_cd __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__imul__", 0); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":118 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":118 * * def __imul__(SparseVector self, float scalar): * self.vector[0] *= scalar # <<<<<<<<<<<<<< @@ -4247,7 +4281,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_27__imul__(struct __pyx_obj_5_cd */ (__pyx_v_self->vector[0]) *= __pyx_v_scalar; - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":119 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":119 * def __imul__(SparseVector self, float scalar): * self.vector[0] *= scalar * return self # <<<<<<<<<<<<<< @@ -4289,7 +4323,7 @@ static PyObject *__pyx_pw_5_cdec_12SparseVector_30__idiv__(PyObject *__pyx_v_sel } #endif /*!(#if PY_MAJOR_VERSION < 3)*/ -/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":121 +/* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":121 * return self * * def __idiv__(SparseVector self, float scalar): # <<<<<<<<<<<<<< @@ -4303,7 +4337,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_29__idiv__(struct __pyx_obj_5_cd __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__idiv__", 0); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":122 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":122 * * def __idiv__(SparseVector self, float scalar): * self.vector[0] /= scalar # <<<<<<<<<<<<<< @@ -4312,7 +4346,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_29__idiv__(struct __pyx_obj_5_cd */ (__pyx_v_self->vector[0]) /= __pyx_v_scalar; - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":123 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":123 * def __idiv__(SparseVector self, float scalar): * self.vector[0] /= scalar * return self # <<<<<<<<<<<<<< @@ -4349,7 +4383,7 @@ static PyObject *__pyx_pw_5_cdec_12SparseVector_32__add__(PyObject *__pyx_v_x, P return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":125 +/* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":125 * return self * * def __add__(SparseVector x, SparseVector y): # <<<<<<<<<<<<<< @@ -4367,7 +4401,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_31__add__(struct __pyx_obj_5_cde int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__add__", 0); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":126 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":126 * * def __add__(SparseVector x, SparseVector y): * cdef SparseVector result = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<< @@ -4380,7 +4414,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_31__add__(struct __pyx_obj_5_cde __pyx_v_result = ((struct __pyx_obj_5_cdec_SparseVector *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":127 + /* "/Users/vchahun/Sandbox/cdec/python/src/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]) # <<<<<<<<<<<<<< @@ -4389,7 +4423,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_31__add__(struct __pyx_obj_5_cde */ __pyx_v_result->vector = new FastSparseVector<weight_t>(((__pyx_v_x->vector[0]) + (__pyx_v_y->vector[0]))); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":128 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":128 * cdef SparseVector result = SparseVector.__new__(SparseVector) * result.vector = new FastSparseVector[weight_t](x.vector[0] + y.vector[0]) * return result # <<<<<<<<<<<<<< @@ -4431,7 +4465,7 @@ static PyObject *__pyx_pw_5_cdec_12SparseVector_34__sub__(PyObject *__pyx_v_x, P return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":130 +/* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":130 * return result * * def __sub__(SparseVector x, SparseVector y): # <<<<<<<<<<<<<< @@ -4449,7 +4483,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_33__sub__(struct __pyx_obj_5_cde int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__sub__", 0); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":131 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":131 * * def __sub__(SparseVector x, SparseVector y): * cdef SparseVector result = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<< @@ -4462,7 +4496,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_33__sub__(struct __pyx_obj_5_cde __pyx_v_result = ((struct __pyx_obj_5_cdec_SparseVector *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":132 + /* "/Users/vchahun/Sandbox/cdec/python/src/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]) # <<<<<<<<<<<<<< @@ -4471,7 +4505,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_33__sub__(struct __pyx_obj_5_cde */ __pyx_v_result->vector = new FastSparseVector<weight_t>(((__pyx_v_x->vector[0]) - (__pyx_v_y->vector[0]))); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":133 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":133 * cdef SparseVector result = SparseVector.__new__(SparseVector) * result.vector = new FastSparseVector[weight_t](x.vector[0] - y.vector[0]) * return result # <<<<<<<<<<<<<< @@ -4507,7 +4541,7 @@ static PyObject *__pyx_pw_5_cdec_12SparseVector_36__mul__(PyObject *__pyx_v_x, P return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":135 +/* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":135 * return result * * def __mul__(x, y): # <<<<<<<<<<<<<< @@ -4529,7 +4563,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_35__mul__(PyObject *__pyx_v_x, P int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__mul__", 0); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":138 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":138 * cdef SparseVector vector * cdef float scalar * if isinstance(x, SparseVector): vector, scalar = x, y # <<<<<<<<<<<<<< @@ -4552,7 +4586,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_35__mul__(PyObject *__pyx_v_x, P } /*else*/ { - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":139 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":139 * cdef float scalar * if isinstance(x, SparseVector): vector, scalar = x, y * else: vector, scalar = y, x # <<<<<<<<<<<<<< @@ -4569,7 +4603,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_35__mul__(PyObject *__pyx_v_x, P } __pyx_L3:; - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":140 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":140 * if isinstance(x, SparseVector): vector, scalar = x, y * else: vector, scalar = y, x * cdef SparseVector result = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<< @@ -4582,7 +4616,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_35__mul__(PyObject *__pyx_v_x, P __pyx_v_result = ((struct __pyx_obj_5_cdec_SparseVector *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":141 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":141 * else: vector, scalar = y, x * cdef SparseVector result = SparseVector.__new__(SparseVector) * result.vector = new FastSparseVector[weight_t](vector.vector[0] * scalar) # <<<<<<<<<<<<<< @@ -4591,7 +4625,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_35__mul__(PyObject *__pyx_v_x, P */ __pyx_v_result->vector = new FastSparseVector<weight_t>(((__pyx_v_vector->vector[0]) * __pyx_v_scalar)); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":142 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":142 * cdef SparseVector result = SparseVector.__new__(SparseVector) * result.vector = new FastSparseVector[weight_t](vector.vector[0] * scalar) * return result # <<<<<<<<<<<<<< @@ -4630,7 +4664,7 @@ static PyObject *__pyx_pw_5_cdec_12SparseVector_38__div__(PyObject *__pyx_v_x, P } #endif /*!(#if PY_MAJOR_VERSION < 3)*/ -/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":144 +/* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":144 * return result * * def __div__(x, y): # <<<<<<<<<<<<<< @@ -4653,7 +4687,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_37__div__(PyObject *__pyx_v_x, P int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__div__", 0); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":147 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":147 * cdef SparseVector vector * cdef float scalar * if isinstance(x, SparseVector): vector, scalar = x, y # <<<<<<<<<<<<<< @@ -4676,7 +4710,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_37__div__(PyObject *__pyx_v_x, P } /*else*/ { - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":148 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":148 * cdef float scalar * if isinstance(x, SparseVector): vector, scalar = x, y * else: vector, scalar = y, x # <<<<<<<<<<<<<< @@ -4693,7 +4727,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_37__div__(PyObject *__pyx_v_x, P } __pyx_L3:; - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":149 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":149 * if isinstance(x, SparseVector): vector, scalar = x, y * else: vector, scalar = y, x * cdef SparseVector result = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<< @@ -4706,7 +4740,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_37__div__(PyObject *__pyx_v_x, P __pyx_v_result = ((struct __pyx_obj_5_cdec_SparseVector *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":150 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":150 * else: vector, scalar = y, x * cdef SparseVector result = SparseVector.__new__(SparseVector) * result.vector = new FastSparseVector[weight_t](vector.vector[0] / scalar) # <<<<<<<<<<<<<< @@ -4714,7 +4748,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_37__div__(PyObject *__pyx_v_x, P */ __pyx_v_result->vector = new FastSparseVector<weight_t>(((__pyx_v_vector->vector[0]) / __pyx_v_scalar)); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":151 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":151 * cdef SparseVector result = SparseVector.__new__(SparseVector) * result.vector = new FastSparseVector[weight_t](vector.vector[0] / scalar) * return result # <<<<<<<<<<<<<< @@ -4752,7 +4786,7 @@ static PyObject *__pyx_pw_5_cdec_1_phrase(PyObject *__pyx_self, PyObject *__pyx_ } static PyObject *__pyx_gb_5_cdec_7_phrase_2generator18(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":6 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":6 * * def _phrase(phrase): * return ' '.join(w.encode('utf8') if isinstance(w, unicode) else str(w) for w in phrase) # <<<<<<<<<<<<<< @@ -4918,7 +4952,7 @@ static PyObject *__pyx_gb_5_cdec_7_phrase_2generator18(__pyx_GeneratorObject *__ return NULL; } -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":5 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":5 * import cdec.sa._sa as _sa * * def _phrase(phrase): # <<<<<<<<<<<<<< @@ -4947,7 +4981,7 @@ static PyObject *__pyx_pf_5_cdec__phrase(CYTHON_UNUSED PyObject *__pyx_self, PyO __Pyx_INCREF(__pyx_cur_scope->__pyx_v_phrase); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_phrase); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":6 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":6 * * def _phrase(phrase): * return ' '.join(w.encode('utf8') if isinstance(w, unicode) else str(w) for w in phrase) # <<<<<<<<<<<<<< @@ -5058,7 +5092,7 @@ static int __pyx_pw_5_cdec_2NT_1__init__(PyObject *__pyx_v_self, PyObject *__pyx return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":11 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":11 * cdef public bytes cat * cdef public unsigned ref * def __init__(self, bytes cat, unsigned ref=0): # <<<<<<<<<<<<<< @@ -5071,7 +5105,7 @@ static int __pyx_pf_5_cdec_2NT___init__(struct __pyx_obj_5_cdec_NT *__pyx_v_self __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":13 + /* "/Users/vchahun/Sandbox/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -5084,7 +5118,7 @@ static int __pyx_pf_5_cdec_2NT___init__(struct __pyx_obj_5_cdec_NT *__pyx_v_self __Pyx_DECREF(((PyObject *)__pyx_v_self->cat)); __pyx_v_self->cat = __pyx_v_cat; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":14 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":14 * """NT(bytes cat, int ref=0) -> Non-terminal from category `cat`.""" * self.cat = cat * self.ref = ref # <<<<<<<<<<<<<< @@ -5109,7 +5143,7 @@ static PyObject *__pyx_pw_5_cdec_2NT_3__str__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":16 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":16 * self.ref = ref * * def __str__(self): # <<<<<<<<<<<<<< @@ -5128,7 +5162,7 @@ static PyObject *__pyx_pf_5_cdec_2NT_2__str__(struct __pyx_obj_5_cdec_NT *__pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 0); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":17 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":17 * * def __str__(self): * if self.ref > 0: # <<<<<<<<<<<<<< @@ -5138,7 +5172,7 @@ static PyObject *__pyx_pf_5_cdec_2NT_2__str__(struct __pyx_obj_5_cdec_NT *__pyx_ __pyx_t_1 = (__pyx_v_self->ref > 0); if (__pyx_t_1) { - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":18 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":18 * def __str__(self): * if self.ref > 0: * return '[%s,%d]' % (self.cat, self.ref) # <<<<<<<<<<<<<< @@ -5166,7 +5200,7 @@ static PyObject *__pyx_pf_5_cdec_2NT_2__str__(struct __pyx_obj_5_cdec_NT *__pyx_ } __pyx_L3:; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":19 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":19 * if self.ref > 0: * return '[%s,%d]' % (self.cat, self.ref) * return '[%s]' % self.cat # <<<<<<<<<<<<<< @@ -5204,7 +5238,7 @@ static PyObject *__pyx_pw_5_cdec_2NT_3cat_1__get__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":9 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":9 * * cdef class NT: * cdef public bytes cat # <<<<<<<<<<<<<< @@ -5300,7 +5334,7 @@ static PyObject *__pyx_pw_5_cdec_2NT_3ref_1__get__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":10 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":10 * cdef class NT: * cdef public bytes cat * cdef public unsigned ref # <<<<<<<<<<<<<< @@ -5418,7 +5452,7 @@ static int __pyx_pw_5_cdec_5NTRef_1__init__(PyObject *__pyx_v_self, PyObject *__ return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":23 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":23 * cdef class NTRef: * cdef public unsigned ref * def __init__(self, unsigned ref): # <<<<<<<<<<<<<< @@ -5431,7 +5465,7 @@ static int __pyx_pf_5_cdec_5NTRef___init__(struct __pyx_obj_5_cdec_NTRef *__pyx_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":25 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":25 * def __init__(self, unsigned ref): * """NTRef(int ref) -> Non-terminal reference.""" * self.ref = ref # <<<<<<<<<<<<<< @@ -5456,7 +5490,7 @@ static PyObject *__pyx_pw_5_cdec_5NTRef_3__str__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":27 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":27 * self.ref = ref * * def __str__(self): # <<<<<<<<<<<<<< @@ -5474,7 +5508,7 @@ static PyObject *__pyx_pf_5_cdec_5NTRef_2__str__(struct __pyx_obj_5_cdec_NTRef * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 0); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":28 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":28 * * def __str__(self): * return '[%d]' % self.ref # <<<<<<<<<<<<<< @@ -5515,7 +5549,7 @@ static PyObject *__pyx_pw_5_cdec_5NTRef_3ref_1__get__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":22 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":22 * * cdef class NTRef: * cdef public unsigned ref # <<<<<<<<<<<<<< @@ -5582,7 +5616,7 @@ static int __pyx_pf_5_cdec_5NTRef_3ref_2__set__(struct __pyx_obj_5_cdec_NTRef *_ return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":30 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":30 * return '[%d]' % self.ref * * cdef TRule convert_rule(_sa.Rule rule): # <<<<<<<<<<<<<< @@ -5612,7 +5646,7 @@ static struct __pyx_obj_5_cdec_TRule *__pyx_f_5_cdec_convert_rule(struct __pyx_o int __pyx_clineno = 0; __Pyx_RefNannySetupContext("convert_rule", 0); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":31 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":31 * * cdef TRule convert_rule(_sa.Rule rule): * lhs = _sa.sym_tocat(rule.lhs) # <<<<<<<<<<<<<< @@ -5621,7 +5655,7 @@ static struct __pyx_obj_5_cdec_TRule *__pyx_f_5_cdec_convert_rule(struct __pyx_o */ __pyx_v_lhs = __pyx_f_4cdec_2sa_3_sa_sym_tocat(__pyx_v_rule->lhs); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":32 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":32 * cdef TRule convert_rule(_sa.Rule rule): * lhs = _sa.sym_tocat(rule.lhs) * scores = dict(rule.scores) # <<<<<<<<<<<<<< @@ -5639,7 +5673,7 @@ static struct __pyx_obj_5_cdec_TRule *__pyx_f_5_cdec_convert_rule(struct __pyx_o __pyx_v_scores = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":33 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":33 * lhs = _sa.sym_tocat(rule.lhs) * scores = dict(rule.scores) * f, e = [], [] # <<<<<<<<<<<<<< @@ -5655,7 +5689,7 @@ static struct __pyx_obj_5_cdec_TRule *__pyx_f_5_cdec_convert_rule(struct __pyx_o __pyx_v_e = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":34 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":34 * scores = dict(rule.scores) * f, e = [], [] * cdef int* fsyms = rule.f.syms # <<<<<<<<<<<<<< @@ -5664,7 +5698,7 @@ static struct __pyx_obj_5_cdec_TRule *__pyx_f_5_cdec_convert_rule(struct __pyx_o */ __pyx_v_fsyms = __pyx_v_rule->f->syms; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":35 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":35 * f, e = [], [] * cdef int* fsyms = rule.f.syms * for i in range(rule.f.n): # <<<<<<<<<<<<<< @@ -5675,7 +5709,7 @@ static struct __pyx_obj_5_cdec_TRule *__pyx_f_5_cdec_convert_rule(struct __pyx_o for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":36 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":36 * cdef int* fsyms = rule.f.syms * for i in range(rule.f.n): * if _sa.sym_isvar(fsyms[i]): # <<<<<<<<<<<<<< @@ -5685,7 +5719,7 @@ static struct __pyx_obj_5_cdec_TRule *__pyx_f_5_cdec_convert_rule(struct __pyx_o __pyx_t_5 = __pyx_f_4cdec_2sa_3_sa_sym_isvar((__pyx_v_fsyms[__pyx_v_i])); if (__pyx_t_5) { - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":37 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":37 * for i in range(rule.f.n): * if _sa.sym_isvar(fsyms[i]): * f.append(NT(_sa.sym_tocat(fsyms[i]))) # <<<<<<<<<<<<<< @@ -5708,7 +5742,7 @@ static struct __pyx_obj_5_cdec_TRule *__pyx_f_5_cdec_convert_rule(struct __pyx_o } /*else*/ { - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":39 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":39 * f.append(NT(_sa.sym_tocat(fsyms[i]))) * else: * f.append(_sa.sym_tostring(fsyms[i])) # <<<<<<<<<<<<<< @@ -5723,7 +5757,7 @@ static struct __pyx_obj_5_cdec_TRule *__pyx_f_5_cdec_convert_rule(struct __pyx_o __pyx_L5:; } - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":40 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":40 * else: * f.append(_sa.sym_tostring(fsyms[i])) * cdef int* esyms = rule.e.syms # <<<<<<<<<<<<<< @@ -5732,7 +5766,7 @@ static struct __pyx_obj_5_cdec_TRule *__pyx_f_5_cdec_convert_rule(struct __pyx_o */ __pyx_v_esyms = __pyx_v_rule->e->syms; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":41 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":41 * f.append(_sa.sym_tostring(fsyms[i])) * cdef int* esyms = rule.e.syms * for i in range(rule.e.n): # <<<<<<<<<<<<<< @@ -5743,7 +5777,7 @@ static struct __pyx_obj_5_cdec_TRule *__pyx_f_5_cdec_convert_rule(struct __pyx_o for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":42 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":42 * cdef int* esyms = rule.e.syms * for i in range(rule.e.n): * if _sa.sym_isvar(esyms[i]): # <<<<<<<<<<<<<< @@ -5753,7 +5787,7 @@ static struct __pyx_obj_5_cdec_TRule *__pyx_f_5_cdec_convert_rule(struct __pyx_o __pyx_t_5 = __pyx_f_4cdec_2sa_3_sa_sym_isvar((__pyx_v_esyms[__pyx_v_i])); if (__pyx_t_5) { - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":43 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":43 * for i in range(rule.e.n): * if _sa.sym_isvar(esyms[i]): * e.append(NTRef(_sa.sym_getindex(esyms[i]))) # <<<<<<<<<<<<<< @@ -5776,7 +5810,7 @@ static struct __pyx_obj_5_cdec_TRule *__pyx_f_5_cdec_convert_rule(struct __pyx_o } /*else*/ { - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":45 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":45 * e.append(NTRef(_sa.sym_getindex(esyms[i]))) * else: * e.append(_sa.sym_tostring(esyms[i])) # <<<<<<<<<<<<<< @@ -5791,7 +5825,7 @@ static struct __pyx_obj_5_cdec_TRule *__pyx_f_5_cdec_convert_rule(struct __pyx_o __pyx_L8:; } - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":46 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":46 * else: * e.append(_sa.sym_tostring(esyms[i])) * a = list(rule.alignments()) # <<<<<<<<<<<<<< @@ -5814,7 +5848,7 @@ static struct __pyx_obj_5_cdec_TRule *__pyx_f_5_cdec_convert_rule(struct __pyx_o __pyx_v_a = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":47 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":47 * e.append(_sa.sym_tostring(esyms[i])) * a = list(rule.alignments()) * return TRule(lhs, f, e, scores, a) # <<<<<<<<<<<<<< @@ -5884,7 +5918,7 @@ static int __pyx_pw_5_cdec_5TRule_1__init__(PyObject *__pyx_v_self, PyObject *__ 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}; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":52 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":52 * cdef shared_ptr[grammar.TRule]* rule * * def __init__(self, lhs, f, e, scores, a=None): # <<<<<<<<<<<<<< @@ -5973,7 +6007,7 @@ static int __pyx_pf_5_cdec_5TRule___init__(struct __pyx_obj_5_cdec_TRule *__pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":59 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":59 * scores: dictionary of feature scores * a: optional list of alignment points""" * self.rule = new shared_ptr[grammar.TRule](new grammar.TRule()) # <<<<<<<<<<<<<< @@ -5983,7 +6017,7 @@ static int __pyx_pf_5_cdec_5TRule___init__(struct __pyx_obj_5_cdec_TRule *__pyx_ try {__pyx_t_1 = new TRule();} catch(...) {__Pyx_CppExn2PyErr(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}} __pyx_v_self->rule = new boost::shared_ptr<TRule>(__pyx_t_1); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":60 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":60 * a: optional list of alignment points""" * self.rule = new shared_ptr[grammar.TRule](new grammar.TRule()) * self.lhs = lhs # <<<<<<<<<<<<<< @@ -5992,7 +6026,7 @@ static int __pyx_pf_5_cdec_5TRule___init__(struct __pyx_obj_5_cdec_TRule *__pyx_ */ if (PyObject_SetAttr(((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;} - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":61 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":61 * self.rule = new shared_ptr[grammar.TRule](new grammar.TRule()) * self.lhs = lhs * self.e = e # <<<<<<<<<<<<<< @@ -6001,7 +6035,7 @@ static int __pyx_pf_5_cdec_5TRule___init__(struct __pyx_obj_5_cdec_TRule *__pyx_ */ if (PyObject_SetAttr(((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/vchahune/tools/cdec/python/src/grammar.pxi":62 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":62 * self.lhs = lhs * self.e = e * self.f = f # <<<<<<<<<<<<<< @@ -6010,7 +6044,7 @@ static int __pyx_pf_5_cdec_5TRule___init__(struct __pyx_obj_5_cdec_TRule *__pyx_ */ if (PyObject_SetAttr(((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;} - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":63 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":63 * self.e = e * self.f = f * self.scores = scores # <<<<<<<<<<<<<< @@ -6019,7 +6053,7 @@ static int __pyx_pf_5_cdec_5TRule___init__(struct __pyx_obj_5_cdec_TRule *__pyx_ */ if (PyObject_SetAttr(((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;} - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":64 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":64 * self.f = f * self.scores = scores * if a: # <<<<<<<<<<<<<< @@ -6029,7 +6063,7 @@ static int __pyx_pf_5_cdec_5TRule___init__(struct __pyx_obj_5_cdec_TRule *__pyx_ __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;} if (__pyx_t_2) { - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":65 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":65 * self.scores = scores * if a: * self.a = a # <<<<<<<<<<<<<< @@ -6041,7 +6075,7 @@ static int __pyx_pf_5_cdec_5TRule___init__(struct __pyx_obj_5_cdec_TRule *__pyx_ } __pyx_L3:; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":66 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":66 * if a: * self.a = a * self.rule.get().ComputeArity() # <<<<<<<<<<<<<< @@ -6069,7 +6103,7 @@ static void __pyx_pw_5_cdec_5TRule_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyFinishContext(); } -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":68 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":68 * self.rule.get().ComputeArity() * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -6081,7 +6115,7 @@ static void __pyx_pf_5_cdec_5TRule_2__dealloc__(CYTHON_UNUSED struct __pyx_obj_5 __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":69 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":69 * * def __dealloc__(self): * del self.rule # <<<<<<<<<<<<<< @@ -6104,7 +6138,7 @@ static PyObject *__pyx_pw_5_cdec_5TRule_5arity_1__get__(PyObject *__pyx_v_self) return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":72 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":72 * * property arity: * def __get__(self): # <<<<<<<<<<<<<< @@ -6121,7 +6155,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_5arity___get__(struct __pyx_obj_5_cdec_T int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":73 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":73 * property arity: * def __get__(self): * return self.rule.get().arity_ # <<<<<<<<<<<<<< @@ -6158,7 +6192,7 @@ static PyObject *__pyx_pw_5_cdec_5TRule_1f_1__get__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":76 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":76 * * property f: * def __get__(self): # <<<<<<<<<<<<<< @@ -6185,7 +6219,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1f___get__(struct __pyx_obj_5_cdec_TRule int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":77 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":77 * property f: * def __get__(self): * cdef vector[WordID]* f_ = &self.rule.get().f_ # <<<<<<<<<<<<<< @@ -6194,7 +6228,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1f___get__(struct __pyx_obj_5_cdec_TRule */ __pyx_v_f_ = (&__pyx_v_self->rule->get()->f_); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":79 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":79 * cdef vector[WordID]* f_ = &self.rule.get().f_ * cdef WordID w * cdef f = [] # <<<<<<<<<<<<<< @@ -6206,7 +6240,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1f___get__(struct __pyx_obj_5_cdec_TRule __pyx_v_f = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":81 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":81 * cdef f = [] * cdef unsigned i * cdef int idx = 0 # <<<<<<<<<<<<<< @@ -6215,7 +6249,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1f___get__(struct __pyx_obj_5_cdec_TRule */ __pyx_v_idx = 0; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":82 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":82 * cdef unsigned i * cdef int idx = 0 * for i in range(f_.size()): # <<<<<<<<<<<<<< @@ -6226,7 +6260,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1f___get__(struct __pyx_obj_5_cdec_TRule for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":83 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":83 * cdef int idx = 0 * for i in range(f_.size()): * w = f_[0][i] # <<<<<<<<<<<<<< @@ -6235,7 +6269,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1f___get__(struct __pyx_obj_5_cdec_TRule */ __pyx_v_w = ((__pyx_v_f_[0])[__pyx_v_i]); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":84 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":84 * for i in range(f_.size()): * w = f_[0][i] * if w < 0: # <<<<<<<<<<<<<< @@ -6245,7 +6279,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1f___get__(struct __pyx_obj_5_cdec_TRule __pyx_t_4 = (__pyx_v_w < 0); if (__pyx_t_4) { - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":85 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":85 * w = f_[0][i] * if w < 0: * idx += 1 # <<<<<<<<<<<<<< @@ -6254,7 +6288,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1f___get__(struct __pyx_obj_5_cdec_TRule */ __pyx_v_idx = (__pyx_v_idx + 1); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":86 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":86 * if w < 0: * idx += 1 * f.append(NT(TDConvert(-w).c_str(), idx)) # <<<<<<<<<<<<<< @@ -6284,7 +6318,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1f___get__(struct __pyx_obj_5_cdec_TRule } /*else*/ { - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":88 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":88 * f.append(NT(TDConvert(-w).c_str(), idx)) * else: * f.append(unicode(TDConvert(w).c_str(), encoding='utf8')) # <<<<<<<<<<<<<< @@ -6313,7 +6347,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1f___get__(struct __pyx_obj_5_cdec_TRule __pyx_L5:; } - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":89 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":89 * else: * f.append(unicode(TDConvert(w).c_str(), encoding='utf8')) * return f # <<<<<<<<<<<<<< @@ -6351,7 +6385,7 @@ static int __pyx_pw_5_cdec_5TRule_1f_3__set__(PyObject *__pyx_v_self, PyObject * return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":91 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":91 * return f * * def __set__(self, f): # <<<<<<<<<<<<<< @@ -6377,7 +6411,7 @@ static int __pyx_pf_5_cdec_5TRule_1f_2__set__(struct __pyx_obj_5_cdec_TRule *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":92 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":92 * * def __set__(self, f): * cdef vector[WordID]* f_ = &self.rule.get().f_ # <<<<<<<<<<<<<< @@ -6386,7 +6420,7 @@ static int __pyx_pf_5_cdec_5TRule_1f_2__set__(struct __pyx_obj_5_cdec_TRule *__p */ __pyx_v_f_ = (&__pyx_v_self->rule->get()->f_); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":93 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":93 * def __set__(self, f): * cdef vector[WordID]* f_ = &self.rule.get().f_ * f_.resize(len(f)) # <<<<<<<<<<<<<< @@ -6396,7 +6430,7 @@ static int __pyx_pf_5_cdec_5TRule_1f_2__set__(struct __pyx_obj_5_cdec_TRule *__p __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_v_f_->resize(__pyx_t_1); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":95 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":95 * f_.resize(len(f)) * cdef unsigned i * cdef int idx = 0 # <<<<<<<<<<<<<< @@ -6405,7 +6439,7 @@ static int __pyx_pf_5_cdec_5TRule_1f_2__set__(struct __pyx_obj_5_cdec_TRule *__p */ __pyx_v_idx = 0; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":96 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":96 * cdef unsigned i * cdef int idx = 0 * for i in range(len(f)): # <<<<<<<<<<<<<< @@ -6416,7 +6450,7 @@ static int __pyx_pf_5_cdec_5TRule_1f_2__set__(struct __pyx_obj_5_cdec_TRule *__p for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":97 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":97 * cdef int idx = 0 * for i in range(len(f)): * if isinstance(f[i], NT): # <<<<<<<<<<<<<< @@ -6432,7 +6466,7 @@ static int __pyx_pf_5_cdec_5TRule_1f_2__set__(struct __pyx_obj_5_cdec_TRule *__p __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":98 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":98 * for i in range(len(f)): * if isinstance(f[i], NT): * f_[0][i] = -TDConvert((<NT> f[i]).cat) # <<<<<<<<<<<<<< @@ -6448,7 +6482,7 @@ static int __pyx_pf_5_cdec_5TRule_1f_2__set__(struct __pyx_obj_5_cdec_TRule *__p } /*else*/ { - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":100 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":100 * f_[0][i] = -TDConvert((<NT> f[i]).cat) * else: * fi = as_str(f[i]) # <<<<<<<<<<<<<< @@ -6464,7 +6498,7 @@ static int __pyx_pf_5_cdec_5TRule_1f_2__set__(struct __pyx_obj_5_cdec_TRule *__p __pyx_v_fi = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":101 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":101 * else: * fi = as_str(f[i]) * f_[0][i] = TDConvert(fi) # <<<<<<<<<<<<<< @@ -6501,7 +6535,7 @@ static PyObject *__pyx_pw_5_cdec_5TRule_1e_1__get__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":104 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":104 * * property e: * def __get__(self): # <<<<<<<<<<<<<< @@ -6528,7 +6562,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1e___get__(struct __pyx_obj_5_cdec_TRule int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":105 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":105 * property e: * def __get__(self): * cdef vector[WordID]* e_ = &self.rule.get().e_ # <<<<<<<<<<<<<< @@ -6537,7 +6571,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1e___get__(struct __pyx_obj_5_cdec_TRule */ __pyx_v_e_ = (&__pyx_v_self->rule->get()->e_); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":107 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":107 * cdef vector[WordID]* e_ = &self.rule.get().e_ * cdef WordID w * cdef e = [] # <<<<<<<<<<<<<< @@ -6549,7 +6583,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1e___get__(struct __pyx_obj_5_cdec_TRule __pyx_v_e = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":109 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":109 * cdef e = [] * cdef unsigned i * cdef int idx = 0 # <<<<<<<<<<<<<< @@ -6558,7 +6592,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1e___get__(struct __pyx_obj_5_cdec_TRule */ __pyx_v_idx = 0; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":110 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":110 * cdef unsigned i * cdef int idx = 0 * for i in range(e_.size()): # <<<<<<<<<<<<<< @@ -6569,7 +6603,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1e___get__(struct __pyx_obj_5_cdec_TRule for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":111 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":111 * cdef int idx = 0 * for i in range(e_.size()): * w = e_[0][i] # <<<<<<<<<<<<<< @@ -6578,7 +6612,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1e___get__(struct __pyx_obj_5_cdec_TRule */ __pyx_v_w = ((__pyx_v_e_[0])[__pyx_v_i]); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":112 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":112 * for i in range(e_.size()): * w = e_[0][i] * if w < 1: # <<<<<<<<<<<<<< @@ -6588,7 +6622,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1e___get__(struct __pyx_obj_5_cdec_TRule __pyx_t_4 = (__pyx_v_w < 1); if (__pyx_t_4) { - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":113 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":113 * w = e_[0][i] * if w < 1: * idx += 1 # <<<<<<<<<<<<<< @@ -6597,7 +6631,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1e___get__(struct __pyx_obj_5_cdec_TRule */ __pyx_v_idx = (__pyx_v_idx + 1); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":114 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":114 * if w < 1: * idx += 1 * e.append(NTRef(1-w)) # <<<<<<<<<<<<<< @@ -6622,7 +6656,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1e___get__(struct __pyx_obj_5_cdec_TRule } /*else*/ { - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":116 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":116 * e.append(NTRef(1-w)) * else: * e.append(unicode(TDConvert(w).c_str(), encoding='utf8')) # <<<<<<<<<<<<<< @@ -6651,7 +6685,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1e___get__(struct __pyx_obj_5_cdec_TRule __pyx_L5:; } - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":117 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":117 * else: * e.append(unicode(TDConvert(w).c_str(), encoding='utf8')) * return e # <<<<<<<<<<<<<< @@ -6689,7 +6723,7 @@ static int __pyx_pw_5_cdec_5TRule_1e_3__set__(PyObject *__pyx_v_self, PyObject * return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":119 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":119 * return e * * def __set__(self, e): # <<<<<<<<<<<<<< @@ -6715,7 +6749,7 @@ static int __pyx_pf_5_cdec_5TRule_1e_2__set__(struct __pyx_obj_5_cdec_TRule *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":120 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":120 * * def __set__(self, e): * cdef vector[WordID]* e_ = &self.rule.get().e_ # <<<<<<<<<<<<<< @@ -6724,7 +6758,7 @@ static int __pyx_pf_5_cdec_5TRule_1e_2__set__(struct __pyx_obj_5_cdec_TRule *__p */ __pyx_v_e_ = (&__pyx_v_self->rule->get()->e_); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":121 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":121 * def __set__(self, e): * cdef vector[WordID]* e_ = &self.rule.get().e_ * e_.resize(len(e)) # <<<<<<<<<<<<<< @@ -6734,7 +6768,7 @@ static int __pyx_pf_5_cdec_5TRule_1e_2__set__(struct __pyx_obj_5_cdec_TRule *__p __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_v_e_->resize(__pyx_t_1); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":123 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":123 * e_.resize(len(e)) * cdef unsigned i * for i in range(len(e)): # <<<<<<<<<<<<<< @@ -6745,7 +6779,7 @@ static int __pyx_pf_5_cdec_5TRule_1e_2__set__(struct __pyx_obj_5_cdec_TRule *__p for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":124 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":124 * cdef unsigned i * for i in range(len(e)): * if isinstance(e[i], NTRef): # <<<<<<<<<<<<<< @@ -6761,7 +6795,7 @@ static int __pyx_pf_5_cdec_5TRule_1e_2__set__(struct __pyx_obj_5_cdec_TRule *__p __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":125 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":125 * for i in range(len(e)): * if isinstance(e[i], NTRef): * e_[0][i] = 1-e[i].ref # <<<<<<<<<<<<<< @@ -6783,7 +6817,7 @@ static int __pyx_pf_5_cdec_5TRule_1e_2__set__(struct __pyx_obj_5_cdec_TRule *__p } /*else*/ { - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":127 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":127 * e_[0][i] = 1-e[i].ref * else: * ei = as_str(e[i]) # <<<<<<<<<<<<<< @@ -6799,7 +6833,7 @@ static int __pyx_pf_5_cdec_5TRule_1e_2__set__(struct __pyx_obj_5_cdec_TRule *__p __pyx_v_ei = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":128 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":128 * else: * ei = as_str(e[i]) * e_[0][i] = TDConvert(ei) # <<<<<<<<<<<<<< @@ -6837,7 +6871,7 @@ static PyObject *__pyx_pw_5_cdec_5TRule_1a_1__get__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":131 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":131 * * property a: * def __get__(self): # <<<<<<<<<<<<<< @@ -6902,7 +6936,7 @@ static PyObject *__pyx_gb_5_cdec_5TRule_1a_2generator2(__pyx_GeneratorObject *__ __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":133 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":133 * def __get__(self): * cdef unsigned i * cdef vector[grammar.AlignmentPoint]* a = &self.rule.get().a_ # <<<<<<<<<<<<<< @@ -6911,7 +6945,7 @@ static PyObject *__pyx_gb_5_cdec_5TRule_1a_2generator2(__pyx_GeneratorObject *__ */ __pyx_cur_scope->__pyx_v_a = (&__pyx_cur_scope->__pyx_v_self->rule->get()->a_); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":134 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":134 * cdef unsigned i * cdef vector[grammar.AlignmentPoint]* a = &self.rule.get().a_ * for i in range(a.size()): # <<<<<<<<<<<<<< @@ -6922,7 +6956,7 @@ static PyObject *__pyx_gb_5_cdec_5TRule_1a_2generator2(__pyx_GeneratorObject *__ 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/vchahune/tools/cdec/python/src/grammar.pxi":135 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":135 * cdef vector[grammar.AlignmentPoint]* a = &self.rule.get().a_ * for i in range(a.size()): * yield (a[0][i].s_, a[0][i].t_) # <<<<<<<<<<<<<< @@ -6981,7 +7015,7 @@ static int __pyx_pw_5_cdec_5TRule_1a_4__set__(PyObject *__pyx_v_self, PyObject * return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":137 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":137 * yield (a[0][i].s_, a[0][i].t_) * * def __set__(self, a): # <<<<<<<<<<<<<< @@ -7010,7 +7044,7 @@ static int __pyx_pf_5_cdec_5TRule_1a_3__set__(struct __pyx_obj_5_cdec_TRule *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":138 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":138 * * def __set__(self, a): * cdef vector[grammar.AlignmentPoint]* a_ = &self.rule.get().a_ # <<<<<<<<<<<<<< @@ -7019,7 +7053,7 @@ static int __pyx_pf_5_cdec_5TRule_1a_3__set__(struct __pyx_obj_5_cdec_TRule *__p */ __pyx_v_a_ = (&__pyx_v_self->rule->get()->a_); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":139 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":139 * def __set__(self, a): * cdef vector[grammar.AlignmentPoint]* a_ = &self.rule.get().a_ * a_.resize(len(a)) # <<<<<<<<<<<<<< @@ -7029,7 +7063,7 @@ static int __pyx_pf_5_cdec_5TRule_1a_3__set__(struct __pyx_obj_5_cdec_TRule *__p __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_v_a_->resize(__pyx_t_1); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":142 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":142 * cdef unsigned i * cdef int s, t * for i in range(len(a)): # <<<<<<<<<<<<<< @@ -7040,7 +7074,7 @@ static int __pyx_pf_5_cdec_5TRule_1a_3__set__(struct __pyx_obj_5_cdec_TRule *__p for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) { __pyx_v_i = __pyx_t_2; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":143 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":143 * cdef int s, t * for i in range(len(a)): * s, t = a[i] # <<<<<<<<<<<<<< @@ -7105,7 +7139,7 @@ static int __pyx_pf_5_cdec_5TRule_1a_3__set__(struct __pyx_obj_5_cdec_TRule *__p __pyx_v_s = __pyx_t_8; __pyx_v_t = __pyx_t_9; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":144 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":144 * for i in range(len(a)): * s, t = a[i] * a_[0][i] = grammar.AlignmentPoint(s, t) # <<<<<<<<<<<<<< @@ -7140,7 +7174,7 @@ static PyObject *__pyx_pw_5_cdec_5TRule_6scores_1__get__(PyObject *__pyx_v_self) return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":147 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":147 * * property scores: * def __get__(self): # <<<<<<<<<<<<<< @@ -7158,7 +7192,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_6scores___get__(struct __pyx_obj_5_cdec_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":148 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":148 * property scores: * def __get__(self): * cdef SparseVector scores = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<< @@ -7171,7 +7205,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_6scores___get__(struct __pyx_obj_5_cdec_ __pyx_v_scores = ((struct __pyx_obj_5_cdec_SparseVector *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":149 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":149 * def __get__(self): * cdef SparseVector scores = SparseVector.__new__(SparseVector) * scores.vector = new FastSparseVector[double](self.rule.get().scores_) # <<<<<<<<<<<<<< @@ -7180,7 +7214,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_6scores___get__(struct __pyx_obj_5_cdec_ */ __pyx_v_scores->vector = new FastSparseVector<double>(__pyx_v_self->rule->get()->scores_); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":150 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":150 * cdef SparseVector scores = SparseVector.__new__(SparseVector) * scores.vector = new FastSparseVector[double](self.rule.get().scores_) * return scores # <<<<<<<<<<<<<< @@ -7216,7 +7250,7 @@ static int __pyx_pw_5_cdec_5TRule_6scores_3__set__(PyObject *__pyx_v_self, PyObj return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":152 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":152 * return scores * * def __set__(self, scores): # <<<<<<<<<<<<<< @@ -7248,7 +7282,7 @@ static int __pyx_pf_5_cdec_5TRule_6scores_2__set__(struct __pyx_obj_5_cdec_TRule int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":153 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":153 * * def __set__(self, scores): * cdef FastSparseVector[double]* scores_ = &self.rule.get().scores_ # <<<<<<<<<<<<<< @@ -7257,7 +7291,7 @@ static int __pyx_pf_5_cdec_5TRule_6scores_2__set__(struct __pyx_obj_5_cdec_TRule */ __pyx_v_scores_ = (&__pyx_v_self->rule->get()->scores_); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":154 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":154 * def __set__(self, scores): * cdef FastSparseVector[double]* scores_ = &self.rule.get().scores_ * scores_.clear() # <<<<<<<<<<<<<< @@ -7266,7 +7300,7 @@ static int __pyx_pf_5_cdec_5TRule_6scores_2__set__(struct __pyx_obj_5_cdec_TRule */ __pyx_v_scores_->clear(); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":157 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":157 * cdef int fid * cdef float fval * for fname, fval in scores.items(): # <<<<<<<<<<<<<< @@ -7369,7 +7403,7 @@ static int __pyx_pf_5_cdec_5TRule_6scores_2__set__(struct __pyx_obj_5_cdec_TRule __pyx_t_5 = 0; __pyx_v_fval = __pyx_t_9; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":158 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":158 * cdef float fval * for fname, fval in scores.items(): * fn = as_str(fname) # <<<<<<<<<<<<<< @@ -7382,7 +7416,7 @@ static int __pyx_pf_5_cdec_5TRule_6scores_2__set__(struct __pyx_obj_5_cdec_TRule __pyx_v_fn = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":159 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":159 * for fname, fval in scores.items(): * fn = as_str(fname) * fid = FDConvert(fn) # <<<<<<<<<<<<<< @@ -7392,7 +7426,7 @@ static int __pyx_pf_5_cdec_5TRule_6scores_2__set__(struct __pyx_obj_5_cdec_TRule __pyx_t_10 = PyBytes_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_v_fid = FD::Convert(__pyx_t_10); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":160 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":160 * fn = as_str(fname) * fid = FDConvert(fn) * if fid < 0: raise KeyError(fname) # <<<<<<<<<<<<<< @@ -7416,7 +7450,7 @@ static int __pyx_pf_5_cdec_5TRule_6scores_2__set__(struct __pyx_obj_5_cdec_TRule } __pyx_L7:; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":161 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":161 * fid = FDConvert(fn) * if fid < 0: raise KeyError(fname) * scores_.set_value(fid, fval) # <<<<<<<<<<<<<< @@ -7455,7 +7489,7 @@ static PyObject *__pyx_pw_5_cdec_5TRule_3lhs_1__get__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":164 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":164 * * property lhs: * def __get__(self): # <<<<<<<<<<<<<< @@ -7473,7 +7507,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_3lhs___get__(struct __pyx_obj_5_cdec_TRu int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":165 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":165 * property lhs: * def __get__(self): * return NT(TDConvert(-self.rule.get().lhs_).c_str()) # <<<<<<<<<<<<<< @@ -7519,7 +7553,7 @@ static int __pyx_pw_5_cdec_5TRule_3lhs_3__set__(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":167 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":167 * return NT(TDConvert(-self.rule.get().lhs_).c_str()) * * def __set__(self, lhs): # <<<<<<<<<<<<<< @@ -7541,7 +7575,7 @@ static int __pyx_pf_5_cdec_5TRule_3lhs_2__set__(struct __pyx_obj_5_cdec_TRule *_ __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_lhs); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":168 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":168 * * def __set__(self, lhs): * if not isinstance(lhs, NT): # <<<<<<<<<<<<<< @@ -7555,7 +7589,7 @@ static int __pyx_pf_5_cdec_5TRule_3lhs_2__set__(struct __pyx_obj_5_cdec_TRule *_ __pyx_t_3 = (!__pyx_t_2); if (__pyx_t_3) { - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":169 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":169 * def __set__(self, lhs): * if not isinstance(lhs, NT): * lhs = NT(lhs) # <<<<<<<<<<<<<< @@ -7577,7 +7611,7 @@ static int __pyx_pf_5_cdec_5TRule_3lhs_2__set__(struct __pyx_obj_5_cdec_TRule *_ } __pyx_L3:; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":170 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":170 * if not isinstance(lhs, NT): * lhs = NT(lhs) * self.rule.get().lhs_ = -TDConvert((<NT> lhs).cat) # <<<<<<<<<<<<<< @@ -7612,7 +7646,7 @@ static PyObject *__pyx_pw_5_cdec_5TRule_5__str__(PyObject *__pyx_v_self) { } static PyObject *__pyx_gb_5_cdec_5TRule_7__str___2generator19(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */ -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":173 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":173 * * def __str__(self): * scores = ' '.join('%s=%s' % feat for feat in self.scores) # <<<<<<<<<<<<<< @@ -7754,7 +7788,7 @@ static PyObject *__pyx_gb_5_cdec_5TRule_7__str___2generator19(__pyx_GeneratorObj return NULL; } -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":172 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":172 * self.rule.get().lhs_ = -TDConvert((<NT> lhs).cat) * * def __str__(self): # <<<<<<<<<<<<<< @@ -7786,7 +7820,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_4__str__(struct __pyx_obj_5_cdec_TRule * __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":173 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":173 * * def __str__(self): * scores = ' '.join('%s=%s' % feat for feat in self.scores) # <<<<<<<<<<<<<< @@ -7809,7 +7843,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_4__str__(struct __pyx_obj_5_cdec_TRule * __pyx_v_scores = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":174 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":174 * def __str__(self): * scores = ' '.join('%s=%s' % feat for feat in self.scores) * return '%s ||| %s ||| %s ||| %s' % (self.lhs, # <<<<<<<<<<<<<< @@ -7820,7 +7854,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_4__str__(struct __pyx_obj_5_cdec_TRule * __pyx_t_2 = PyObject_GetAttr(((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_GOTREF(__pyx_t_2); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":175 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":175 * scores = ' '.join('%s=%s' % feat for feat in self.scores) * return '%s ||| %s ||| %s ||| %s' % (self.lhs, * _phrase(self.f), _phrase(self.e), scores) # <<<<<<<<<<<<<< @@ -7961,7 +7995,7 @@ static int __pyx_pw_5_cdec_5MRule_1__init__(PyObject *__pyx_v_self, PyObject *__ return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":178 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":178 * * cdef class MRule(TRule): * def __init__(self, lhs, rhs, scores): # <<<<<<<<<<<<<< @@ -7987,7 +8021,7 @@ static int __pyx_pf_5_cdec_5MRule___init__(struct __pyx_obj_5_cdec_MRule *__pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":183 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":183 * rhs: right hand side phrase (list of words/NT) * scores: dictionary of feature scores""" * cdef unsigned i = 1 # <<<<<<<<<<<<<< @@ -7996,7 +8030,7 @@ static int __pyx_pf_5_cdec_5MRule___init__(struct __pyx_obj_5_cdec_MRule *__pyx_ */ __pyx_v_i = 1; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":184 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":184 * scores: dictionary of feature scores""" * cdef unsigned i = 1 * e = [] # <<<<<<<<<<<<<< @@ -8008,7 +8042,7 @@ static int __pyx_pf_5_cdec_5MRule___init__(struct __pyx_obj_5_cdec_MRule *__pyx_ __pyx_v_e = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":185 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":185 * cdef unsigned i = 1 * e = [] * for s in rhs: # <<<<<<<<<<<<<< @@ -8053,7 +8087,7 @@ static int __pyx_pf_5_cdec_5MRule___init__(struct __pyx_obj_5_cdec_MRule *__pyx_ __pyx_v_s = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":186 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":186 * e = [] * for s in rhs: * if isinstance(s, NT): # <<<<<<<<<<<<<< @@ -8066,7 +8100,7 @@ static int __pyx_pf_5_cdec_5MRule___init__(struct __pyx_obj_5_cdec_MRule *__pyx_ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":187 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":187 * for s in rhs: * if isinstance(s, NT): * e.append(NTRef(i)) # <<<<<<<<<<<<<< @@ -8086,7 +8120,7 @@ static int __pyx_pf_5_cdec_5MRule___init__(struct __pyx_obj_5_cdec_MRule *__pyx_ __pyx_t_7 = PyList_Append(__pyx_v_e, __pyx_t_4); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":188 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":188 * if isinstance(s, NT): * e.append(NTRef(i)) * i += 1 # <<<<<<<<<<<<<< @@ -8098,7 +8132,7 @@ static int __pyx_pf_5_cdec_5MRule___init__(struct __pyx_obj_5_cdec_MRule *__pyx_ } /*else*/ { - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":190 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":190 * i += 1 * else: * e.append(s) # <<<<<<<<<<<<<< @@ -8111,7 +8145,7 @@ static int __pyx_pf_5_cdec_5MRule___init__(struct __pyx_obj_5_cdec_MRule *__pyx_ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":191 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":191 * else: * e.append(s) * super(MRule, self).__init__(lhs, rhs, e, scores, None) # <<<<<<<<<<<<<< @@ -8179,7 +8213,7 @@ static void __pyx_pw_5_cdec_7Grammar_1__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyFinishContext(); } -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":196 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":196 * cdef shared_ptr[grammar.Grammar]* grammar * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -8191,7 +8225,7 @@ static void __pyx_pf_5_cdec_7Grammar___dealloc__(CYTHON_UNUSED struct __pyx_obj_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":197 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":197 * * def __dealloc__(self): * del self.grammar # <<<<<<<<<<<<<< @@ -8215,7 +8249,7 @@ static PyObject *__pyx_pw_5_cdec_7Grammar_3__iter__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":199 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":199 * del self.grammar * * def __iter__(self): # <<<<<<<<<<<<<< @@ -8278,7 +8312,7 @@ static PyObject *__pyx_gb_5_cdec_7Grammar_4generator3(__pyx_GeneratorObject *__p __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":200 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":200 * * def __iter__(self): * cdef grammar.const_GrammarIter* root = self.grammar.get().GetRoot() # <<<<<<<<<<<<<< @@ -8287,7 +8321,7 @@ static PyObject *__pyx_gb_5_cdec_7Grammar_4generator3(__pyx_GeneratorObject *__p */ __pyx_cur_scope->__pyx_v_root = __pyx_cur_scope->__pyx_v_self->grammar->get()->GetRoot(); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":201 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":201 * def __iter__(self): * cdef grammar.const_GrammarIter* root = self.grammar.get().GetRoot() * cdef grammar.const_RuleBin* rbin = root.GetRules() # <<<<<<<<<<<<<< @@ -8296,7 +8330,7 @@ static PyObject *__pyx_gb_5_cdec_7Grammar_4generator3(__pyx_GeneratorObject *__p */ __pyx_cur_scope->__pyx_v_rbin = __pyx_cur_scope->__pyx_v_root->GetRules(); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":204 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":204 * cdef TRule trule * cdef unsigned i * for i in range(rbin.GetNumRules()): # <<<<<<<<<<<<<< @@ -8307,7 +8341,7 @@ static PyObject *__pyx_gb_5_cdec_7Grammar_4generator3(__pyx_GeneratorObject *__p 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/vchahune/tools/cdec/python/src/grammar.pxi":205 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":205 * cdef unsigned i * for i in range(rbin.GetNumRules()): * trule = TRule.__new__(TRule) # <<<<<<<<<<<<<< @@ -8323,7 +8357,7 @@ static PyObject *__pyx_gb_5_cdec_7Grammar_4generator3(__pyx_GeneratorObject *__p __pyx_cur_scope->__pyx_v_trule = ((struct __pyx_obj_5_cdec_TRule *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":206 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":206 * for i in range(rbin.GetNumRules()): * trule = TRule.__new__(TRule) * trule.rule = new shared_ptr[grammar.TRule](rbin.GetIthRule(i)) # <<<<<<<<<<<<<< @@ -8332,7 +8366,7 @@ static PyObject *__pyx_gb_5_cdec_7Grammar_4generator3(__pyx_GeneratorObject *__p */ __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/vchahune/tools/cdec/python/src/grammar.pxi":207 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":207 * trule = TRule.__new__(TRule) * trule.rule = new shared_ptr[grammar.TRule](rbin.GetIthRule(i)) * yield trule # <<<<<<<<<<<<<< @@ -8377,7 +8411,7 @@ static PyObject *__pyx_pw_5_cdec_7Grammar_4name_1__get__(PyObject *__pyx_v_self) return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":210 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":210 * * property name: * def __get__(self): # <<<<<<<<<<<<<< @@ -8395,7 +8429,7 @@ static PyObject *__pyx_pf_5_cdec_7Grammar_4name___get__(struct __pyx_obj_5_cdec_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":211 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":211 * property name: * def __get__(self): * str(self.grammar.get().GetGrammarName().c_str()) # <<<<<<<<<<<<<< @@ -8438,7 +8472,7 @@ static int __pyx_pw_5_cdec_7Grammar_4name_3__set__(PyObject *__pyx_v_self, PyObj return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":213 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":213 * str(self.grammar.get().GetGrammarName().c_str()) * * def __set__(self, name): # <<<<<<<<<<<<<< @@ -8457,7 +8491,7 @@ static int __pyx_pf_5_cdec_7Grammar_4name_2__set__(struct __pyx_obj_5_cdec_Gramm __Pyx_RefNannySetupContext("__set__", 0); __Pyx_INCREF(__pyx_v_name); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":214 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":214 * * def __set__(self, name): * name = as_str(name) # <<<<<<<<<<<<<< @@ -8470,7 +8504,7 @@ static int __pyx_pf_5_cdec_7Grammar_4name_2__set__(struct __pyx_obj_5_cdec_Gramm __pyx_v_name = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":215 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":215 * def __set__(self, name): * name = as_str(name) * self.grammar.get().SetGrammarName(name) # <<<<<<<<<<<<<< @@ -8543,7 +8577,7 @@ static int __pyx_pw_5_cdec_11TextGrammar_1__init__(PyObject *__pyx_v_self, PyObj return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":218 +/* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":218 * * cdef class TextGrammar(Grammar): * def __init__(self, rules): # <<<<<<<<<<<<<< @@ -8568,7 +8602,7 @@ static int __pyx_pf_5_cdec_11TextGrammar___init__(struct __pyx_obj_5_cdec_TextGr int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":220 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":220 * def __init__(self, rules): * """TextGrammar(rules) -> SCFG Grammar containing the rules.""" * self.grammar = new shared_ptr[grammar.Grammar](new grammar.TextGrammar()) # <<<<<<<<<<<<<< @@ -8577,7 +8611,7 @@ static int __pyx_pf_5_cdec_11TextGrammar___init__(struct __pyx_obj_5_cdec_TextGr */ __pyx_v_self->__pyx_base.grammar = new boost::shared_ptr<Grammar>(new TextGrammar()); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":221 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":221 * """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() # <<<<<<<<<<<<<< @@ -8586,7 +8620,7 @@ static int __pyx_pf_5_cdec_11TextGrammar___init__(struct __pyx_obj_5_cdec_TextGr */ __pyx_v__g = ((TextGrammar *)__pyx_v_self->__pyx_base.grammar->get()); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":222 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":222 * self.grammar = new shared_ptr[grammar.Grammar](new grammar.TextGrammar()) * cdef grammar.TextGrammar* _g = <grammar.TextGrammar*> self.grammar.get() * for trule in rules: # <<<<<<<<<<<<<< @@ -8631,7 +8665,7 @@ static int __pyx_pf_5_cdec_11TextGrammar___init__(struct __pyx_obj_5_cdec_TextGr __pyx_v_trule = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":223 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":223 * cdef grammar.TextGrammar* _g = <grammar.TextGrammar*> self.grammar.get() * for trule in rules: * if isinstance(trule, _sa.Rule): # <<<<<<<<<<<<<< @@ -8644,7 +8678,7 @@ static int __pyx_pf_5_cdec_11TextGrammar___init__(struct __pyx_obj_5_cdec_TextGr __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":224 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":224 * for trule in rules: * if isinstance(trule, _sa.Rule): * trule = convert_rule(trule) # <<<<<<<<<<<<<< @@ -8663,7 +8697,7 @@ static int __pyx_pf_5_cdec_11TextGrammar___init__(struct __pyx_obj_5_cdec_TextGr goto __pyx_L5; } - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":225 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":225 * if isinstance(trule, _sa.Rule): * trule = convert_rule(trule) * elif not isinstance(trule, TRule): # <<<<<<<<<<<<<< @@ -8677,7 +8711,7 @@ static int __pyx_pf_5_cdec_11TextGrammar___init__(struct __pyx_obj_5_cdec_TextGr __pyx_t_7 = (!__pyx_t_5); if (__pyx_t_7) { - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":226 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":226 * trule = convert_rule(trule) * elif not isinstance(trule, TRule): * raise ValueError('the grammar should contain TRule objects') # <<<<<<<<<<<<<< @@ -8692,7 +8726,7 @@ static int __pyx_pf_5_cdec_11TextGrammar___init__(struct __pyx_obj_5_cdec_TextGr } __pyx_L5:; - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":227 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":227 * elif not isinstance(trule, TRule): * raise ValueError('the grammar should contain TRule objects') * _g.AddRule((<TRule> trule).rule[0]) # <<<<<<<<<<<<<< @@ -8724,7 +8758,7 @@ static void __pyx_pw_5_cdec_10Hypergraph_1__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyFinishContext(); } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":8 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":8 * cdef MT19937* rng * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -8737,7 +8771,7 @@ static void __pyx_pf_5_cdec_10Hypergraph___dealloc__(struct __pyx_obj_5_cdec_Hyp int __pyx_t_1; __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":9 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":9 * * def __dealloc__(self): * del self.hg # <<<<<<<<<<<<<< @@ -8746,7 +8780,7 @@ static void __pyx_pf_5_cdec_10Hypergraph___dealloc__(struct __pyx_obj_5_cdec_Hyp */ delete __pyx_v_self->hg; - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":10 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":10 * def __dealloc__(self): * del self.hg * if self.rng != NULL: # <<<<<<<<<<<<<< @@ -8756,7 +8790,7 @@ static void __pyx_pf_5_cdec_10Hypergraph___dealloc__(struct __pyx_obj_5_cdec_Hyp __pyx_t_1 = (__pyx_v_self->rng != NULL); if (__pyx_t_1) { - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":11 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":11 * del self.hg * if self.rng != NULL: * del self.rng # <<<<<<<<<<<<<< @@ -8771,7 +8805,7 @@ static void __pyx_pf_5_cdec_10Hypergraph___dealloc__(struct __pyx_obj_5_cdec_Hyp __Pyx_RefNannyFinishContext(); } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":13 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":13 * del self.rng * * cdef MT19937* _rng(self): # <<<<<<<<<<<<<< @@ -8789,7 +8823,7 @@ static MT19937 *__pyx_f_5_cdec_10Hypergraph__rng(struct __pyx_obj_5_cdec_Hypergr int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_rng", 0); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":14 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":14 * * cdef MT19937* _rng(self): * if self.rng == NULL: # <<<<<<<<<<<<<< @@ -8799,7 +8833,7 @@ static MT19937 *__pyx_f_5_cdec_10Hypergraph__rng(struct __pyx_obj_5_cdec_Hypergr __pyx_t_1 = (__pyx_v_self->rng == NULL); if (__pyx_t_1) { - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":15 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":15 * cdef MT19937* _rng(self): * if self.rng == NULL: * self.rng = new MT19937() # <<<<<<<<<<<<<< @@ -8812,7 +8846,7 @@ static MT19937 *__pyx_f_5_cdec_10Hypergraph__rng(struct __pyx_obj_5_cdec_Hypergr } __pyx_L3:; - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":16 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":16 * if self.rng == NULL: * self.rng = new MT19937() * return self.rng # <<<<<<<<<<<<<< @@ -8844,7 +8878,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_3viterbi(PyObject *__pyx_v_self, C return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":18 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":18 * return self.rng * * def viterbi(self): # <<<<<<<<<<<<<< @@ -8863,7 +8897,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_2viterbi(struct __pyx_obj_5_cdec_H int __pyx_clineno = 0; __Pyx_RefNannySetupContext("viterbi", 0); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":21 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":21 * """hg.viterbi() -> String for the best hypothesis in the hypergraph.""" * cdef vector[WordID] trans * hypergraph.ViterbiESentence(self.hg[0], &trans) # <<<<<<<<<<<<<< @@ -8872,7 +8906,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_2viterbi(struct __pyx_obj_5_cdec_H */ ViterbiESentence((__pyx_v_self->hg[0]), (&__pyx_v_trans)); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":22 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":22 * cdef vector[WordID] trans * hypergraph.ViterbiESentence(self.hg[0], &trans) * return unicode(GetString(trans).c_str(), 'utf8') # <<<<<<<<<<<<<< @@ -8922,7 +8956,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_5viterbi_trees(PyObject *__pyx_v_s return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":24 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":24 * return unicode(GetString(trans).c_str(), 'utf8') * * def viterbi_trees(self): # <<<<<<<<<<<<<< @@ -8942,7 +8976,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_4viterbi_trees(struct __pyx_obj_5_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("viterbi_trees", 0); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":29 + /* "/Users/vchahun/Sandbox/cdec/python/src/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') # <<<<<<<<<<<<<< @@ -8965,7 +8999,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_4viterbi_trees(struct __pyx_obj_5_ __pyx_v_f_tree = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":30 + /* "/Users/vchahun/Sandbox/cdec/python/src/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') # <<<<<<<<<<<<<< @@ -8988,7 +9022,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_4viterbi_trees(struct __pyx_obj_5_ __pyx_v_e_tree = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":31 + /* "/Users/vchahun/Sandbox/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -9035,7 +9069,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_7viterbi_features(PyObject *__pyx_ return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":33 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":33 * return (f_tree, e_tree) * * def viterbi_features(self): # <<<<<<<<<<<<<< @@ -9053,7 +9087,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_6viterbi_features(struct __pyx_obj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("viterbi_features", 0); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":36 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":36 * """hg.viterbi_features() -> SparseVector with the features corresponding * to the best derivation in the hypergraph.""" * cdef SparseVector fmap = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<< @@ -9066,7 +9100,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_6viterbi_features(struct __pyx_obj __pyx_v_fmap = ((struct __pyx_obj_5_cdec_SparseVector *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":37 + /* "/Users/vchahun/Sandbox/cdec/python/src/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])) # <<<<<<<<<<<<<< @@ -9075,7 +9109,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_6viterbi_features(struct __pyx_obj */ __pyx_v_fmap->vector = new FastSparseVector<weight_t>(ViterbiFeatures((__pyx_v_self->hg[0]))); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":38 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":38 * cdef SparseVector fmap = SparseVector.__new__(SparseVector) * fmap.vector = new FastSparseVector[weight_t](hypergraph.ViterbiFeatures(self.hg[0])) * return fmap # <<<<<<<<<<<<<< @@ -9111,7 +9145,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_9viterbi_forest(PyObject *__pyx_v_ return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":40 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":40 * return fmap * * def viterbi_forest(self): # <<<<<<<<<<<<<< @@ -9129,7 +9163,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_8viterbi_forest(struct __pyx_obj_5 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("viterbi_forest", 0); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":41 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":41 * * def viterbi_forest(self): * cdef Hypergraph hg = Hypergraph() # <<<<<<<<<<<<<< @@ -9141,7 +9175,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_8viterbi_forest(struct __pyx_obj_5 __pyx_v_hg = ((struct __pyx_obj_5_cdec_Hypergraph *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":42 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":42 * def viterbi_forest(self): * cdef Hypergraph hg = Hypergraph() * hg.hg = new hypergraph.Hypergraph(self.hg[0].CreateViterbiHypergraph(NULL).get()[0]) # <<<<<<<<<<<<<< @@ -9150,7 +9184,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_8viterbi_forest(struct __pyx_obj_5 */ __pyx_v_hg->hg = new Hypergraph(((__pyx_v_self->hg[0]).CreateViterbiHypergraph(NULL).get()[0])); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":43 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":43 * cdef Hypergraph hg = Hypergraph() * hg.hg = new hypergraph.Hypergraph(self.hg[0].CreateViterbiHypergraph(NULL).get()[0]) * return hg # <<<<<<<<<<<<<< @@ -9187,7 +9221,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_11viterbi_joshua(PyObject *__pyx_v return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":45 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":45 * return hg * * def viterbi_joshua(self): # <<<<<<<<<<<<<< @@ -9205,7 +9239,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_10viterbi_joshua(struct __pyx_obj_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("viterbi_joshua", 0); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":47 + /* "/Users/vchahun/Sandbox/cdec/python/src/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') # <<<<<<<<<<<<<< @@ -9256,7 +9290,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_13kbest(PyObject *__pyx_v_self, Py return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":49 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":49 * return unicode(hypergraph.JoshuaVisualizationString(self.hg[0]).c_str(), 'utf8') * * def kbest(self, size): # <<<<<<<<<<<<<< @@ -9324,7 +9358,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_14generator4(__pyx_GeneratorObject __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/vchahune/tools/cdec/python/src/hypergraph.pxi":51 + /* "/Users/vchahun/Sandbox/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -9334,7 +9368,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_14generator4(__pyx_GeneratorObject __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); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":54 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":54 * cdef kbest.KBestDerivations[vector[WordID], kbest.ESentenceTraversal].Derivation* derivation * cdef unsigned k * try: # <<<<<<<<<<<<<< @@ -9343,7 +9377,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_14generator4(__pyx_GeneratorObject */ /*try:*/ { - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":55 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":55 * cdef unsigned k * try: * for k in range(size): # <<<<<<<<<<<<<< @@ -9354,7 +9388,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_14generator4(__pyx_GeneratorObject 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/vchahune/tools/cdec/python/src/hypergraph.pxi":56 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":56 * try: * for k in range(size): * derivation = derivations.LazyKthBest(self.hg.nodes_.size() - 1, k) # <<<<<<<<<<<<<< @@ -9363,7 +9397,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_14generator4(__pyx_GeneratorObject */ __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/vchahune/tools/cdec/python/src/hypergraph.pxi":57 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":57 * for k in range(size): * derivation = derivations.LazyKthBest(self.hg.nodes_.size() - 1, k) * if not derivation: break # <<<<<<<<<<<<<< @@ -9377,7 +9411,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_14generator4(__pyx_GeneratorObject } __pyx_L9:; - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":58 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":58 * derivation = derivations.LazyKthBest(self.hg.nodes_.size() - 1, k) * if not derivation: break * yield unicode(GetString(derivation._yield).c_str(), 'utf8') # <<<<<<<<<<<<<< @@ -9414,7 +9448,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_14generator4(__pyx_GeneratorObject __pyx_L8_break:; } - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":60 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":60 * yield unicode(GetString(derivation._yield).c_str(), 'utf8') * finally: * del derivations # <<<<<<<<<<<<<< @@ -9475,7 +9509,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_16kbest_trees(PyObject *__pyx_v_se return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":62 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":62 * del derivations * * def kbest_trees(self, size): # <<<<<<<<<<<<<< @@ -9545,7 +9579,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_17generator5(__pyx_GeneratorObject __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/vchahune/tools/cdec/python/src/hypergraph.pxi":64 + /* "/Users/vchahun/Sandbox/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -9555,7 +9589,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_17generator5(__pyx_GeneratorObject __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); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":66 + /* "/Users/vchahun/Sandbox/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -9565,7 +9599,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_17generator5(__pyx_GeneratorObject __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); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":69 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":69 * cdef kbest.KBestDerivations[vector[WordID], kbest.ETreeTraversal].Derivation* e_derivation * cdef unsigned k * try: # <<<<<<<<<<<<<< @@ -9574,7 +9608,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_17generator5(__pyx_GeneratorObject */ /*try:*/ { - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":70 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":70 * cdef unsigned k * try: * for k in range(size): # <<<<<<<<<<<<<< @@ -9585,7 +9619,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_17generator5(__pyx_GeneratorObject 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/vchahune/tools/cdec/python/src/hypergraph.pxi":71 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":71 * try: * for k in range(size): * f_derivation = f_derivations.LazyKthBest(self.hg.nodes_.size() - 1, k) # <<<<<<<<<<<<<< @@ -9594,7 +9628,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_17generator5(__pyx_GeneratorObject */ __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/vchahune/tools/cdec/python/src/hypergraph.pxi":72 + /* "/Users/vchahun/Sandbox/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -9603,7 +9637,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_17generator5(__pyx_GeneratorObject */ __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/vchahune/tools/cdec/python/src/hypergraph.pxi":73 + /* "/Users/vchahun/Sandbox/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -9623,7 +9657,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_17generator5(__pyx_GeneratorObject } __pyx_L9:; - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":74 + /* "/Users/vchahun/Sandbox/cdec/python/src/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') # <<<<<<<<<<<<<< @@ -9649,7 +9683,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_17generator5(__pyx_GeneratorObject __pyx_cur_scope->__pyx_v_f_tree = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":75 + /* "/Users/vchahun/Sandbox/cdec/python/src/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') # <<<<<<<<<<<<<< @@ -9675,7 +9709,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_17generator5(__pyx_GeneratorObject __pyx_cur_scope->__pyx_v_e_tree = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":76 + /* "/Users/vchahun/Sandbox/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -9707,7 +9741,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_17generator5(__pyx_GeneratorObject __pyx_L8_break:; } - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":78 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":78 * yield (f_tree, e_tree) * finally: * del f_derivations # <<<<<<<<<<<<<< @@ -9731,7 +9765,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_17generator5(__pyx_GeneratorObject __pyx_L6:; delete __pyx_cur_scope->__pyx_v_f_derivations; - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":79 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":79 * finally: * del f_derivations * del e_derivations # <<<<<<<<<<<<<< @@ -9777,7 +9811,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_19kbest_features(PyObject *__pyx_v return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":81 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":81 * del e_derivations * * def kbest_features(self, size): # <<<<<<<<<<<<<< @@ -9844,7 +9878,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_20generator6(__pyx_GeneratorObject __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/vchahune/tools/cdec/python/src/hypergraph.pxi":83 + /* "/Users/vchahun/Sandbox/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -9854,7 +9888,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_20generator6(__pyx_GeneratorObject __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); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":87 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":87 * cdef SparseVector fmap * cdef unsigned k * try: # <<<<<<<<<<<<<< @@ -9863,7 +9897,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_20generator6(__pyx_GeneratorObject */ /*try:*/ { - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":88 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":88 * cdef unsigned k * try: * for k in range(size): # <<<<<<<<<<<<<< @@ -9874,7 +9908,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_20generator6(__pyx_GeneratorObject 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/vchahune/tools/cdec/python/src/hypergraph.pxi":89 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":89 * try: * for k in range(size): * derivation = derivations.LazyKthBest(self.hg.nodes_.size() - 1, k) # <<<<<<<<<<<<<< @@ -9883,7 +9917,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_20generator6(__pyx_GeneratorObject */ __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/vchahune/tools/cdec/python/src/hypergraph.pxi":90 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":90 * for k in range(size): * derivation = derivations.LazyKthBest(self.hg.nodes_.size() - 1, k) * if not derivation: break # <<<<<<<<<<<<<< @@ -9897,7 +9931,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_20generator6(__pyx_GeneratorObject } __pyx_L9:; - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":91 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":91 * derivation = derivations.LazyKthBest(self.hg.nodes_.size() - 1, k) * if not derivation: break * fmap = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<< @@ -9913,7 +9947,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_20generator6(__pyx_GeneratorObject __pyx_cur_scope->__pyx_v_fmap = ((struct __pyx_obj_5_cdec_SparseVector *)__pyx_t_4); __pyx_t_4 = 0; - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":92 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":92 * if not derivation: break * fmap = SparseVector.__new__(SparseVector) * fmap.vector = new FastSparseVector[weight_t](derivation._yield) # <<<<<<<<<<<<<< @@ -9922,7 +9956,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_20generator6(__pyx_GeneratorObject */ __pyx_cur_scope->__pyx_v_fmap->vector = new FastSparseVector<weight_t>(__pyx_cur_scope->__pyx_v_derivation->yield); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":93 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":93 * fmap = SparseVector.__new__(SparseVector) * fmap.vector = new FastSparseVector[weight_t](derivation._yield) * yield fmap # <<<<<<<<<<<<<< @@ -9946,7 +9980,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_20generator6(__pyx_GeneratorObject __pyx_L8_break:; } - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":95 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":95 * yield fmap * finally: * del derivations # <<<<<<<<<<<<<< @@ -10015,7 +10049,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_22sample(PyObject *__pyx_v_self, P return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":97 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":97 * del derivations * * def sample(self, unsigned n): # <<<<<<<<<<<<<< @@ -10081,7 +10115,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_23generator7(__pyx_GeneratorObject __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":99 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":99 * def sample(self, unsigned n): * """hg.sample(n) -> Sample of n hypotheses from the hypergraph.""" * cdef vector[hypergraph.Hypothesis]* hypos = new vector[hypergraph.Hypothesis]() # <<<<<<<<<<<<<< @@ -10091,7 +10125,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_23generator7(__pyx_GeneratorObject try {__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_cur_scope->__pyx_v_hypos = __pyx_t_1; - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":100 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":100 * """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) # <<<<<<<<<<<<<< @@ -10100,7 +10134,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_23generator7(__pyx_GeneratorObject */ HypergraphSampler::sample_hypotheses((__pyx_cur_scope->__pyx_v_self->hg[0]), __pyx_cur_scope->__pyx_v_n, ((struct __pyx_vtabstruct_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/vchahune/tools/cdec/python/src/hypergraph.pxi":102 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":102 * hypergraph.sample_hypotheses(self.hg[0], n, self._rng(), hypos) * cdef unsigned k * try: # <<<<<<<<<<<<<< @@ -10109,7 +10143,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_23generator7(__pyx_GeneratorObject */ /*try:*/ { - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":103 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":103 * cdef unsigned k * try: * for k in range(hypos.size()): # <<<<<<<<<<<<<< @@ -10120,7 +10154,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_23generator7(__pyx_GeneratorObject 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/vchahune/tools/cdec/python/src/hypergraph.pxi":104 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":104 * try: * for k in range(hypos.size()): * yield unicode(GetString(hypos[0][k].words).c_str(), 'utf8') # <<<<<<<<<<<<<< @@ -10156,7 +10190,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_23generator7(__pyx_GeneratorObject } } - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":106 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":106 * yield unicode(GetString(hypos[0][k].words).c_str(), 'utf8') * finally: * del hypos # <<<<<<<<<<<<<< @@ -10227,7 +10261,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_25sample_trees(PyObject *__pyx_v_s return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":108 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":108 * del hypos * * def sample_trees(self, unsigned n): # <<<<<<<<<<<<<< @@ -10293,7 +10327,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_26generator8(__pyx_GeneratorObject __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":110 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":110 * def sample_trees(self, unsigned n): * """hg.sample_trees(n) -> Sample of n trees from the hypergraph.""" * cdef vector[string]* trees = new vector[string]() # <<<<<<<<<<<<<< @@ -10303,7 +10337,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_26generator8(__pyx_GeneratorObject try {__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_cur_scope->__pyx_v_trees = __pyx_t_1; - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":111 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":111 * """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) # <<<<<<<<<<<<<< @@ -10312,7 +10346,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_26generator8(__pyx_GeneratorObject */ HypergraphSampler::sample_trees((__pyx_cur_scope->__pyx_v_self->hg[0]), __pyx_cur_scope->__pyx_v_n, ((struct __pyx_vtabstruct_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/vchahune/tools/cdec/python/src/hypergraph.pxi":113 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":113 * hypergraph.sample_trees(self.hg[0], n, self._rng(), trees) * cdef unsigned k * try: # <<<<<<<<<<<<<< @@ -10321,7 +10355,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_26generator8(__pyx_GeneratorObject */ /*try:*/ { - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":114 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":114 * cdef unsigned k * try: * for k in range(trees.size()): # <<<<<<<<<<<<<< @@ -10332,7 +10366,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_26generator8(__pyx_GeneratorObject 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/vchahune/tools/cdec/python/src/hypergraph.pxi":115 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":115 * try: * for k in range(trees.size()): * yield unicode(trees[0][k].c_str(), 'utf8') # <<<<<<<<<<<<<< @@ -10368,7 +10402,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_26generator8(__pyx_GeneratorObject } } - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":117 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":117 * yield unicode(trees[0][k].c_str(), 'utf8') * finally: * del trees # <<<<<<<<<<<<<< @@ -10428,7 +10462,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_28intersect(PyObject *__pyx_v_self return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":119 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":119 * del trees * * def intersect(self, inp): # <<<<<<<<<<<<<< @@ -10448,7 +10482,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_27intersect(struct __pyx_obj_5_cde int __pyx_clineno = 0; __Pyx_RefNannySetupContext("intersect", 0); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":122 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":122 * """hg.intersect(Lattice/string): Intersect the hypergraph with the provided reference.""" * cdef Lattice lat * if isinstance(inp, Lattice): # <<<<<<<<<<<<<< @@ -10461,7 +10495,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_27intersect(struct __pyx_obj_5_cde __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":123 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":123 * cdef Lattice lat * if isinstance(inp, Lattice): * lat = <Lattice> inp # <<<<<<<<<<<<<< @@ -10473,7 +10507,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_27intersect(struct __pyx_obj_5_cde goto __pyx_L3; } - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":124 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":124 * if isinstance(inp, Lattice): * lat = <Lattice> inp * elif isinstance(inp, basestring): # <<<<<<<<<<<<<< @@ -10486,7 +10520,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_27intersect(struct __pyx_obj_5_cde __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":125 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":125 * lat = <Lattice> inp * elif isinstance(inp, basestring): * lat = Lattice(inp) # <<<<<<<<<<<<<< @@ -10507,7 +10541,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_27intersect(struct __pyx_obj_5_cde } /*else*/ { - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":127 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":127 * lat = Lattice(inp) * else: * raise TypeError('cannot intersect hypergraph with %s' % type(inp)) # <<<<<<<<<<<<<< @@ -10530,7 +10564,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_27intersect(struct __pyx_obj_5_cde } __pyx_L3:; - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":128 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":128 * else: * raise TypeError('cannot intersect hypergraph with %s' % type(inp)) * return hypergraph.Intersect(lat.lattice[0], self.hg) # <<<<<<<<<<<<<< @@ -10626,7 +10660,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_30prune(PyObject *__pyx_v_self, Py return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":130 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":130 * return hypergraph.Intersect(lat.lattice[0], self.hg) * * def prune(self, beam_alpha=0, density=0, **kwargs): # <<<<<<<<<<<<<< @@ -10646,7 +10680,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_29prune(struct __pyx_obj_5_cdec_Hy int __pyx_clineno = 0; __Pyx_RefNannySetupContext("prune", 0); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":134 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":134 * beam_alpha: use beam pruning * density: use density pruning""" * cdef hypergraph.EdgeMask* preserve_mask = NULL # <<<<<<<<<<<<<< @@ -10655,7 +10689,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_29prune(struct __pyx_obj_5_cdec_Hy */ __pyx_v_preserve_mask = NULL; - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":135 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":135 * density: use density pruning""" * cdef hypergraph.EdgeMask* preserve_mask = NULL * if 'csplit_preserve_full_word' in kwargs: # <<<<<<<<<<<<<< @@ -10665,7 +10699,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_29prune(struct __pyx_obj_5_cdec_Hy __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;} if (__pyx_t_1) { - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":136 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":136 * cdef hypergraph.EdgeMask* preserve_mask = NULL * if 'csplit_preserve_full_word' in kwargs: * preserve_mask = new hypergraph.EdgeMask(self.hg.edges_.size()) # <<<<<<<<<<<<<< @@ -10674,7 +10708,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_29prune(struct __pyx_obj_5_cdec_Hy */ __pyx_v_preserve_mask = new std::vector<bool>(__pyx_v_self->hg->edges_.size()); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":137 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":137 * 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 # <<<<<<<<<<<<<< @@ -10686,7 +10720,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_29prune(struct __pyx_obj_5_cdec_Hy } __pyx_L3:; - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":138 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":138 * 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) # <<<<<<<<<<<<<< @@ -10697,7 +10731,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_29prune(struct __pyx_obj_5_cdec_Hy __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_density); 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_v_self->hg->PruneInsideOutside(__pyx_t_2, __pyx_t_3, __pyx_v_preserve_mask, 0, 1.0, 0); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":139 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":139 * preserve_mask[0][hypergraph.GetFullWordEdgeIndex(self.hg[0])] = True * self.hg.PruneInsideOutside(beam_alpha, density, preserve_mask, False, 1, False) * if preserve_mask: # <<<<<<<<<<<<<< @@ -10707,7 +10741,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_29prune(struct __pyx_obj_5_cdec_Hy __pyx_t_1 = (__pyx_v_preserve_mask != 0); if (__pyx_t_1) { - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":140 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":140 * self.hg.PruneInsideOutside(beam_alpha, density, preserve_mask, False, 1, False) * if preserve_mask: * del preserve_mask # <<<<<<<<<<<<<< @@ -10742,7 +10776,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_32lattice(PyObject *__pyx_v_self, return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":142 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":142 * del preserve_mask * * def lattice(self): # TODO direct hg -> lattice conversion in cdec # <<<<<<<<<<<<<< @@ -10762,7 +10796,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_31lattice(struct __pyx_obj_5_cdec_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lattice", 0); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":144 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":144 * 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() # <<<<<<<<<<<<<< @@ -10774,7 +10808,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_31lattice(struct __pyx_obj_5_cdec_ __pyx_v_plf = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":145 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":145 * """hg.lattice() -> Lattice corresponding to the hypergraph.""" * cdef bytes plf = hypergraph.AsPLF(self.hg[0], True).c_str() * return Lattice(eval(plf)) # <<<<<<<<<<<<<< @@ -10845,7 +10879,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_34plf(PyObject *__pyx_v_self, CYTH return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":147 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":147 * return Lattice(eval(plf)) * * def plf(self): # <<<<<<<<<<<<<< @@ -10863,7 +10897,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_33plf(struct __pyx_obj_5_cdec_Hype int __pyx_clineno = 0; __Pyx_RefNannySetupContext("plf", 0); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":149 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":149 * def plf(self): * """hg.plf() -> Lattice PLF representation corresponding to the hypergraph.""" * return bytes(hypergraph.AsPLF(self.hg[0], True).c_str()) # <<<<<<<<<<<<<< @@ -10910,7 +10944,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_36reweight(PyObject *__pyx_v_self, return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":151 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":151 * return bytes(hypergraph.AsPLF(self.hg[0], True).c_str()) * * def reweight(self, weights): # <<<<<<<<<<<<<< @@ -10929,7 +10963,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_35reweight(struct __pyx_obj_5_cdec int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reweight", 0); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":153 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":153 * def reweight(self, weights): * """hg.reweight(SparseVector/DenseVector): Reweight the hypergraph with a new vector.""" * if isinstance(weights, SparseVector): # <<<<<<<<<<<<<< @@ -10942,7 +10976,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_35reweight(struct __pyx_obj_5_cdec __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":154 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":154 * """hg.reweight(SparseVector/DenseVector): Reweight the hypergraph with a new vector.""" * if isinstance(weights, SparseVector): * self.hg.Reweight((<SparseVector> weights).vector[0]) # <<<<<<<<<<<<<< @@ -10953,7 +10987,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_35reweight(struct __pyx_obj_5_cdec goto __pyx_L3; } - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":155 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":155 * if isinstance(weights, SparseVector): * self.hg.Reweight((<SparseVector> weights).vector[0]) * elif isinstance(weights, DenseVector): # <<<<<<<<<<<<<< @@ -10966,7 +11000,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_35reweight(struct __pyx_obj_5_cdec __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":156 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":156 * self.hg.Reweight((<SparseVector> weights).vector[0]) * elif isinstance(weights, DenseVector): * self.hg.Reweight((<DenseVector> weights).vector[0]) # <<<<<<<<<<<<<< @@ -10978,7 +11012,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_35reweight(struct __pyx_obj_5_cdec } /*else*/ { - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":158 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":158 * self.hg.Reweight((<DenseVector> weights).vector[0]) * else: * raise TypeError('cannot reweight hypergraph with %s' % type(weights)) # <<<<<<<<<<<<<< @@ -11026,7 +11060,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_5edges_1__get__(PyObject *__pyx_v_ return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":161 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":161 * * property edges: * def __get__(self): # <<<<<<<<<<<<<< @@ -11090,7 +11124,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_5edges_2generator9(__pyx_Generator __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":163 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":163 * def __get__(self): * cdef unsigned i * for i in range(self.hg.edges_.size()): # <<<<<<<<<<<<<< @@ -11101,7 +11135,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_5edges_2generator9(__pyx_Generator 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/vchahune/tools/cdec/python/src/hypergraph.pxi":164 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":164 * cdef unsigned i * for i in range(self.hg.edges_.size()): * yield HypergraphEdge().init(self.hg, i) # <<<<<<<<<<<<<< @@ -11153,7 +11187,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_5nodes_1__get__(PyObject *__pyx_v_ return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":167 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":167 * * property nodes: * def __get__(self): # <<<<<<<<<<<<<< @@ -11217,7 +11251,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_5nodes_2generator10(__pyx_Generato __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":169 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":169 * def __get__(self): * cdef unsigned i * for i in range(self.hg.nodes_.size()): # <<<<<<<<<<<<<< @@ -11228,7 +11262,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_5nodes_2generator10(__pyx_Generato 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/vchahune/tools/cdec/python/src/hypergraph.pxi":170 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":170 * cdef unsigned i * for i in range(self.hg.nodes_.size()): * yield HypergraphNode().init(self.hg, i) # <<<<<<<<<<<<<< @@ -11279,7 +11313,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_4goal_1__get__(PyObject *__pyx_v_s return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":173 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":173 * * property goal: * def __get__(self): # <<<<<<<<<<<<<< @@ -11297,7 +11331,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_4goal___get__(struct __pyx_obj_5_c int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":174 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":174 * property goal: * def __get__(self): * return HypergraphNode().init(self.hg, self.hg.GoalNode()) # <<<<<<<<<<<<<< @@ -11338,7 +11372,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_6npaths_1__get__(PyObject *__pyx_v return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":177 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":177 * * property npaths: * def __get__(self): # <<<<<<<<<<<<<< @@ -11355,7 +11389,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_6npaths___get__(struct __pyx_obj_5 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":178 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":178 * property npaths: * def __get__(self): * return self.hg.NumberOfPaths() # <<<<<<<<<<<<<< @@ -11393,7 +11427,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_38inside_outside(PyObject *__pyx_v return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":180 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":180 * return self.hg.NumberOfPaths() * * def inside_outside(self): # <<<<<<<<<<<<<< @@ -11417,7 +11451,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_37inside_outside(struct __pyx_obj_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("inside_outside", 0); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":182 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":182 * def inside_outside(self): * """hg.inside_outside() -> SparseVector with inside-outside scores for each feature.""" * cdef FastSparseVector[prob_t]* result = new FastSparseVector[prob_t]() # <<<<<<<<<<<<<< @@ -11426,7 +11460,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_37inside_outside(struct __pyx_obj_ */ __pyx_v_result = new FastSparseVector<prob_t>(); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":183 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":183 * """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) # <<<<<<<<<<<<<< @@ -11435,7 +11469,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_37inside_outside(struct __pyx_obj_ */ __pyx_v_z = InsideOutside<prob_t, EdgeProb, SparseVector<prob_t>, EdgeFeaturesAndProbWeightFunction>((__pyx_v_self->hg[0]), __pyx_v_result); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":184 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":184 * cdef FastSparseVector[prob_t]* result = new FastSparseVector[prob_t]() * cdef prob_t z = hypergraph.InsideOutside(self.hg[0], result) * result[0] /= z # <<<<<<<<<<<<<< @@ -11444,7 +11478,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_37inside_outside(struct __pyx_obj_ */ (__pyx_v_result[0]) /= __pyx_v_z; - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":185 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":185 * cdef prob_t z = hypergraph.InsideOutside(self.hg[0], result) * result[0] /= z * cdef SparseVector vector = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<< @@ -11457,7 +11491,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_37inside_outside(struct __pyx_obj_ __pyx_v_vector = ((struct __pyx_obj_5_cdec_SparseVector *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":186 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":186 * result[0] /= z * cdef SparseVector vector = SparseVector.__new__(SparseVector) * vector.vector = new FastSparseVector[double]() # <<<<<<<<<<<<<< @@ -11466,7 +11500,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_37inside_outside(struct __pyx_obj_ */ __pyx_v_vector->vector = new FastSparseVector<double>(); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":187 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":187 * 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) # <<<<<<<<<<<<<< @@ -11475,7 +11509,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_37inside_outside(struct __pyx_obj_ */ __pyx_v_it = new FastSparseVector<prob_t>::const_iterator((__pyx_v_result[0]), 0); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":189 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":189 * 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()): # <<<<<<<<<<<<<< @@ -11486,7 +11520,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_37inside_outside(struct __pyx_obj_ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":190 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":190 * cdef unsigned i * for i in range(result.size()): * vector.vector.set_value(it[0].ptr().first, log(it[0].ptr().second)) # <<<<<<<<<<<<<< @@ -11495,7 +11529,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_37inside_outside(struct __pyx_obj_ */ __pyx_v_vector->vector->set_value((__pyx_v_it[0]).operator->()->first, log((__pyx_v_it[0]).operator->()->second)); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":191 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":191 * for i in range(result.size()): * vector.vector.set_value(it[0].ptr().first, log(it[0].ptr().second)) * pinc(it[0]) # ++it # <<<<<<<<<<<<<< @@ -11505,7 +11539,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_37inside_outside(struct __pyx_obj_ (++(__pyx_v_it[0])); } - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":192 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":192 * vector.vector.set_value(it[0].ptr().first, log(it[0].ptr().second)) * pinc(it[0]) # ++it * del it # <<<<<<<<<<<<<< @@ -11514,7 +11548,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_37inside_outside(struct __pyx_obj_ */ delete __pyx_v_it; - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":193 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":193 * pinc(it[0]) # ++it * del it * del result # <<<<<<<<<<<<<< @@ -11523,7 +11557,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_37inside_outside(struct __pyx_obj_ */ delete __pyx_v_result; - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":194 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":194 * del it * del result * return vector # <<<<<<<<<<<<<< @@ -11548,7 +11582,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_37inside_outside(struct __pyx_obj_ return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":201 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":201 * cdef public TRule trule * * cdef init(self, hypergraph.Hypergraph* hg, unsigned i): # <<<<<<<<<<<<<< @@ -11565,7 +11599,7 @@ static PyObject *__pyx_f_5_cdec_14HypergraphEdge_init(struct __pyx_obj_5_cdec_Hy int __pyx_clineno = 0; __Pyx_RefNannySetupContext("init", 0); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":202 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":202 * * cdef init(self, hypergraph.Hypergraph* hg, unsigned i): * self.hg = hg # <<<<<<<<<<<<<< @@ -11574,7 +11608,7 @@ static PyObject *__pyx_f_5_cdec_14HypergraphEdge_init(struct __pyx_obj_5_cdec_Hy */ __pyx_v_self->hg = __pyx_v_hg; - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":203 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":203 * cdef init(self, hypergraph.Hypergraph* hg, unsigned i): * self.hg = hg * self.edge = &hg.edges_[i] # <<<<<<<<<<<<<< @@ -11583,7 +11617,7 @@ static PyObject *__pyx_f_5_cdec_14HypergraphEdge_init(struct __pyx_obj_5_cdec_Hy */ __pyx_v_self->edge = (&(__pyx_v_hg->edges_[__pyx_v_i])); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":204 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":204 * self.hg = hg * self.edge = &hg.edges_[i] * self.trule = TRule.__new__(TRule) # <<<<<<<<<<<<<< @@ -11599,7 +11633,7 @@ static PyObject *__pyx_f_5_cdec_14HypergraphEdge_init(struct __pyx_obj_5_cdec_Hy __pyx_v_self->trule = ((struct __pyx_obj_5_cdec_TRule *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":205 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":205 * self.edge = &hg.edges_[i] * self.trule = TRule.__new__(TRule) * self.trule.rule = new shared_ptr[grammar.TRule](self.edge.rule_) # <<<<<<<<<<<<<< @@ -11608,7 +11642,7 @@ static PyObject *__pyx_f_5_cdec_14HypergraphEdge_init(struct __pyx_obj_5_cdec_Hy */ __pyx_v_self->trule->rule = new boost::shared_ptr<TRule>(__pyx_v_self->edge->rule_); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":206 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":206 * self.trule = TRule.__new__(TRule) * self.trule.rule = new shared_ptr[grammar.TRule](self.edge.rule_) * return self # <<<<<<<<<<<<<< @@ -11643,7 +11677,7 @@ static Py_ssize_t __pyx_pw_5_cdec_14HypergraphEdge_1__len__(PyObject *__pyx_v_se return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":208 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":208 * return self * * def __len__(self): # <<<<<<<<<<<<<< @@ -11656,7 +11690,7 @@ static Py_ssize_t __pyx_pf_5_cdec_14HypergraphEdge___len__(struct __pyx_obj_5_cd __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__", 0); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":209 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":209 * * def __len__(self): * return self.edge.tail_nodes_.size() # <<<<<<<<<<<<<< @@ -11683,7 +11717,7 @@ static PyObject *__pyx_pw_5_cdec_14HypergraphEdge_9head_node_1__get__(PyObject * return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":212 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":212 * * property head_node: * def __get__(self): # <<<<<<<<<<<<<< @@ -11701,7 +11735,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphEdge_9head_node___get__(struct __py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":213 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":213 * property head_node: * def __get__(self): * return HypergraphNode().init(self.hg, self.edge.head_node_) # <<<<<<<<<<<<<< @@ -11743,7 +11777,7 @@ static PyObject *__pyx_pw_5_cdec_14HypergraphEdge_10tail_nodes_1__get__(PyObject return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":216 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":216 * * property tail_nodes: * def __get__(self): # <<<<<<<<<<<<<< @@ -11807,7 +11841,7 @@ static PyObject *__pyx_gb_5_cdec_14HypergraphEdge_10tail_nodes_2generator11(__py __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":218 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":218 * def __get__(self): * cdef unsigned i * for i in range(self.edge.tail_nodes_.size()): # <<<<<<<<<<<<<< @@ -11818,7 +11852,7 @@ static PyObject *__pyx_gb_5_cdec_14HypergraphEdge_10tail_nodes_2generator11(__py 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/vchahune/tools/cdec/python/src/hypergraph.pxi":219 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":219 * cdef unsigned i * for i in range(self.edge.tail_nodes_.size()): * yield HypergraphNode().init(self.hg, self.edge.tail_nodes_[i]) # <<<<<<<<<<<<<< @@ -11869,7 +11903,7 @@ static PyObject *__pyx_pw_5_cdec_14HypergraphEdge_4span_1__get__(PyObject *__pyx return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":222 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":222 * * property span: * def __get__(self): # <<<<<<<<<<<<<< @@ -11888,7 +11922,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphEdge_4span___get__(struct __pyx_obj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":223 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":223 * property span: * def __get__(self): * return (self.edge.i_, self.edge.j_) # <<<<<<<<<<<<<< @@ -11937,7 +11971,7 @@ static PyObject *__pyx_pw_5_cdec_14HypergraphEdge_8src_span_1__get__(PyObject *_ return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":226 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":226 * * property src_span: * def __get__(self): # <<<<<<<<<<<<<< @@ -11956,7 +11990,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphEdge_8src_span___get__(struct __pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":227 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":227 * property src_span: * def __get__(self): * return (self.edge.prev_i_, self.edge.prev_j_) # <<<<<<<<<<<<<< @@ -12005,7 +12039,7 @@ static PyObject *__pyx_pw_5_cdec_14HypergraphEdge_14feature_values_1__get__(PyOb return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":230 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":230 * * property feature_values: * def __get__(self): # <<<<<<<<<<<<<< @@ -12023,7 +12057,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphEdge_14feature_values___get__(struc int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":231 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":231 * property feature_values: * def __get__(self): * cdef SparseVector vector = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<< @@ -12036,7 +12070,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphEdge_14feature_values___get__(struc __pyx_v_vector = ((struct __pyx_obj_5_cdec_SparseVector *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":232 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":232 * def __get__(self): * cdef SparseVector vector = SparseVector.__new__(SparseVector) * vector.vector = new FastSparseVector[double](self.edge.feature_values_) # <<<<<<<<<<<<<< @@ -12045,7 +12079,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphEdge_14feature_values___get__(struc */ __pyx_v_vector->vector = new FastSparseVector<double>(__pyx_v_self->edge->feature_values_); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":233 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":233 * cdef SparseVector vector = SparseVector.__new__(SparseVector) * vector.vector = new FastSparseVector[double](self.edge.feature_values_) * return vector # <<<<<<<<<<<<<< @@ -12081,7 +12115,7 @@ static PyObject *__pyx_pw_5_cdec_14HypergraphEdge_4prob_1__get__(PyObject *__pyx return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":236 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":236 * * property prob: * def __get__(self): # <<<<<<<<<<<<<< @@ -12098,7 +12132,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphEdge_4prob___get__(struct __pyx_obj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":237 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":237 * property prob: * def __get__(self): * return self.edge.edge_prob_.as_float() # <<<<<<<<<<<<<< @@ -12141,7 +12175,7 @@ static PyObject *__pyx_pw_5_cdec_14HypergraphEdge_3__richcmp__(PyObject *__pyx_v return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":239 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":239 * return self.edge.edge_prob_.as_float() * * def __richcmp__(HypergraphEdge x, HypergraphEdge y, int op): # <<<<<<<<<<<<<< @@ -12159,7 +12193,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphEdge_2__richcmp__(struct __pyx_obj_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__richcmp__", 0); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":242 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":242 * if op == 2: # == * return x.edge == y.edge * elif op == 3: # != # <<<<<<<<<<<<<< @@ -12168,7 +12202,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphEdge_2__richcmp__(struct __pyx_obj_ */ switch (__pyx_v_op) { - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":240 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":240 * * def __richcmp__(HypergraphEdge x, HypergraphEdge y, int op): * if op == 2: # == # <<<<<<<<<<<<<< @@ -12177,7 +12211,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphEdge_2__richcmp__(struct __pyx_obj_ */ case 2: - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":241 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":241 * def __richcmp__(HypergraphEdge x, HypergraphEdge y, int op): * if op == 2: # == * return x.edge == y.edge # <<<<<<<<<<<<<< @@ -12192,7 +12226,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphEdge_2__richcmp__(struct __pyx_obj_ goto __pyx_L0; break; - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":242 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":242 * if op == 2: # == * return x.edge == y.edge * elif op == 3: # != # <<<<<<<<<<<<<< @@ -12201,7 +12235,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphEdge_2__richcmp__(struct __pyx_obj_ */ case 3: - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":243 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":243 * return x.edge == y.edge * elif op == 3: # != * return not (x == y) # <<<<<<<<<<<<<< @@ -12220,7 +12254,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphEdge_2__richcmp__(struct __pyx_obj_ break; } - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":244 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":244 * elif op == 3: # != * return not (x == y) * raise NotImplemented('comparison not implemented for HypergraphEdge') # <<<<<<<<<<<<<< @@ -12256,7 +12290,7 @@ static PyObject *__pyx_pw_5_cdec_14HypergraphEdge_5trule_1__get__(PyObject *__py return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":199 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":199 * cdef hypergraph.Hypergraph* hg * cdef hypergraph.HypergraphEdge* edge * cdef public TRule trule # <<<<<<<<<<<<<< @@ -12341,7 +12375,7 @@ static int __pyx_pf_5_cdec_14HypergraphEdge_5trule_4__del__(struct __pyx_obj_5_c return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":250 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":250 * cdef hypergraph.HypergraphNode* node * * cdef init(self, hypergraph.Hypergraph* hg, unsigned i): # <<<<<<<<<<<<<< @@ -12354,7 +12388,7 @@ static PyObject *__pyx_f_5_cdec_14HypergraphNode_init(struct __pyx_obj_5_cdec_Hy __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("init", 0); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":251 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":251 * * cdef init(self, hypergraph.Hypergraph* hg, unsigned i): * self.hg = hg # <<<<<<<<<<<<<< @@ -12363,7 +12397,7 @@ static PyObject *__pyx_f_5_cdec_14HypergraphNode_init(struct __pyx_obj_5_cdec_Hy */ __pyx_v_self->hg = __pyx_v_hg; - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":252 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":252 * cdef init(self, hypergraph.Hypergraph* hg, unsigned i): * self.hg = hg * self.node = &hg.nodes_[i] # <<<<<<<<<<<<<< @@ -12372,7 +12406,7 @@ static PyObject *__pyx_f_5_cdec_14HypergraphNode_init(struct __pyx_obj_5_cdec_Hy */ __pyx_v_self->node = (&(__pyx_v_hg->nodes_[__pyx_v_i])); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":253 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":253 * self.hg = hg * self.node = &hg.nodes_[i] * return self # <<<<<<<<<<<<<< @@ -12403,7 +12437,7 @@ static PyObject *__pyx_pw_5_cdec_14HypergraphNode_8in_edges_1__get__(PyObject *_ return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":256 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":256 * * property in_edges: * def __get__(self): # <<<<<<<<<<<<<< @@ -12467,7 +12501,7 @@ static PyObject *__pyx_gb_5_cdec_14HypergraphNode_8in_edges_2generator12(__pyx_G __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":258 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":258 * def __get__(self): * cdef unsigned i * for i in range(self.node.in_edges_.size()): # <<<<<<<<<<<<<< @@ -12478,7 +12512,7 @@ static PyObject *__pyx_gb_5_cdec_14HypergraphNode_8in_edges_2generator12(__pyx_G 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/vchahune/tools/cdec/python/src/hypergraph.pxi":259 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":259 * cdef unsigned i * for i in range(self.node.in_edges_.size()): * yield HypergraphEdge().init(self.hg, self.node.in_edges_[i]) # <<<<<<<<<<<<<< @@ -12530,7 +12564,7 @@ static PyObject *__pyx_pw_5_cdec_14HypergraphNode_9out_edges_1__get__(PyObject * return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":262 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":262 * * property out_edges: * def __get__(self): # <<<<<<<<<<<<<< @@ -12594,7 +12628,7 @@ static PyObject *__pyx_gb_5_cdec_14HypergraphNode_9out_edges_2generator13(__pyx_ __pyx_L3_first_run:; if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":264 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":264 * def __get__(self): * cdef unsigned i * for i in range(self.node.out_edges_.size()): # <<<<<<<<<<<<<< @@ -12605,7 +12639,7 @@ static PyObject *__pyx_gb_5_cdec_14HypergraphNode_9out_edges_2generator13(__pyx_ 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/vchahune/tools/cdec/python/src/hypergraph.pxi":265 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":265 * cdef unsigned i * for i in range(self.node.out_edges_.size()): * yield HypergraphEdge().init(self.hg, self.node.out_edges_[i]) # <<<<<<<<<<<<<< @@ -12656,7 +12690,7 @@ static PyObject *__pyx_pw_5_cdec_14HypergraphNode_4span_1__get__(PyObject *__pyx return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":268 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":268 * * property span: * def __get__(self): # <<<<<<<<<<<<<< @@ -12674,7 +12708,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphNode_4span___get__(struct __pyx_obj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":269 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":269 * property span: * def __get__(self): * return next(self.in_edges).span # <<<<<<<<<<<<<< @@ -12718,7 +12752,7 @@ static PyObject *__pyx_pw_5_cdec_14HypergraphNode_3cat_1__get__(PyObject *__pyx_ return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":272 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":272 * * property cat: * def __get__(self): # <<<<<<<<<<<<<< @@ -12736,7 +12770,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphNode_3cat___get__(struct __pyx_obj_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":273 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":273 * property cat: * def __get__(self): * if self.node.cat_: # <<<<<<<<<<<<<< @@ -12745,7 +12779,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphNode_3cat___get__(struct __pyx_obj_ */ if (__pyx_v_self->node->cat_) { - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":274 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":274 * def __get__(self): * if self.node.cat_: * return str(TDConvert(-self.node.cat_).c_str()) # <<<<<<<<<<<<<< @@ -12800,7 +12834,7 @@ static PyObject *__pyx_pw_5_cdec_14HypergraphNode_1__richcmp__(PyObject *__pyx_v return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":276 +/* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":276 * return str(TDConvert(-self.node.cat_).c_str()) * * def __richcmp__(HypergraphNode x, HypergraphNode y, int op): # <<<<<<<<<<<<<< @@ -12818,7 +12852,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphNode___richcmp__(struct __pyx_obj_5 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__richcmp__", 0); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":279 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":279 * if op == 2: # == * return x.node == y.node * elif op == 3: # != # <<<<<<<<<<<<<< @@ -12827,7 +12861,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphNode___richcmp__(struct __pyx_obj_5 */ switch (__pyx_v_op) { - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":277 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":277 * * def __richcmp__(HypergraphNode x, HypergraphNode y, int op): * if op == 2: # == # <<<<<<<<<<<<<< @@ -12836,7 +12870,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphNode___richcmp__(struct __pyx_obj_5 */ case 2: - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":278 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":278 * def __richcmp__(HypergraphNode x, HypergraphNode y, int op): * if op == 2: # == * return x.node == y.node # <<<<<<<<<<<<<< @@ -12851,7 +12885,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphNode___richcmp__(struct __pyx_obj_5 goto __pyx_L0; break; - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":279 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":279 * if op == 2: # == * return x.node == y.node * elif op == 3: # != # <<<<<<<<<<<<<< @@ -12860,7 +12894,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphNode___richcmp__(struct __pyx_obj_5 */ case 3: - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":280 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":280 * return x.node == y.node * elif op == 3: # != * return not (x == y) # <<<<<<<<<<<<<< @@ -12878,7 +12912,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphNode___richcmp__(struct __pyx_obj_5 break; } - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":281 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":281 * elif op == 3: # != * return not (x == y) * raise NotImplemented('comparison not implemented for HypergraphNode') # <<<<<<<<<<<<<< @@ -12915,7 +12949,7 @@ static int __pyx_pw_5_cdec_7Lattice_1__cinit__(PyObject *__pyx_v_self, PyObject return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/lattice.pxi":6 +/* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":6 * cdef lattice.Lattice* lattice * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -12928,7 +12962,7 @@ static int __pyx_pf_5_cdec_7Lattice___cinit__(struct __pyx_obj_5_cdec_Lattice *_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":7 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":7 * * def __cinit__(self): * self.lattice = new lattice.Lattice() # <<<<<<<<<<<<<< @@ -12993,7 +13027,7 @@ static int __pyx_pw_5_cdec_7Lattice_3__init__(PyObject *__pyx_v_self, PyObject * return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/lattice.pxi":9 +/* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":9 * self.lattice = new lattice.Lattice() * * def __init__(self, inp): # <<<<<<<<<<<<<< @@ -13018,7 +13052,7 @@ static int __pyx_pf_5_cdec_7Lattice_2__init__(struct __pyx_obj_5_cdec_Lattice *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":12 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":12 * """Lattice(tuple) -> Lattice from node list. * Lattice(string) -> Lattice from PLF representation.""" * if isinstance(inp, tuple): # <<<<<<<<<<<<<< @@ -13031,7 +13065,7 @@ static int __pyx_pf_5_cdec_7Lattice_2__init__(struct __pyx_obj_5_cdec_Lattice *_ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":13 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":13 * Lattice(string) -> Lattice from PLF representation.""" * if isinstance(inp, tuple): * self.lattice.resize(len(inp)) # <<<<<<<<<<<<<< @@ -13041,7 +13075,7 @@ static int __pyx_pf_5_cdec_7Lattice_2__init__(struct __pyx_obj_5_cdec_Lattice *_ __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/vchahune/tools/cdec/python/src/lattice.pxi":14 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":14 * if isinstance(inp, tuple): * self.lattice.resize(len(inp)) * for i, arcs in enumerate(inp): # <<<<<<<<<<<<<< @@ -13096,7 +13130,7 @@ static int __pyx_pf_5_cdec_7Lattice_2__init__(struct __pyx_obj_5_cdec_Lattice *_ __pyx_t_1 = __pyx_t_6; __pyx_t_6 = 0; - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":15 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":15 * self.lattice.resize(len(inp)) * for i, arcs in enumerate(inp): * self[i] = arcs # <<<<<<<<<<<<<< @@ -13110,7 +13144,7 @@ static int __pyx_pf_5_cdec_7Lattice_2__init__(struct __pyx_obj_5_cdec_Lattice *_ goto __pyx_L3; } - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":16 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":16 * for i, arcs in enumerate(inp): * self[i] = arcs * elif isinstance(inp, basestring): # <<<<<<<<<<<<<< @@ -13123,7 +13157,7 @@ static int __pyx_pf_5_cdec_7Lattice_2__init__(struct __pyx_obj_5_cdec_Lattice *_ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":17 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":17 * self[i] = arcs * elif isinstance(inp, basestring): * lattice.ConvertTextOrPLF(as_str(inp), self.lattice) # <<<<<<<<<<<<<< @@ -13139,7 +13173,7 @@ static int __pyx_pf_5_cdec_7Lattice_2__init__(struct __pyx_obj_5_cdec_Lattice *_ } /*else*/ { - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":19 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":19 * lattice.ConvertTextOrPLF(as_str(inp), self.lattice) * else: * raise TypeError('cannot create lattice from %s' % type(inp)) # <<<<<<<<<<<<<< @@ -13186,7 +13220,7 @@ static void __pyx_pw_5_cdec_7Lattice_5__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyFinishContext(); } -/* "/home/vchahune/tools/cdec/python/src/lattice.pxi":21 +/* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":21 * raise TypeError('cannot create lattice from %s' % type(inp)) * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -13198,7 +13232,7 @@ static void __pyx_pf_5_cdec_7Lattice_4__dealloc__(CYTHON_UNUSED struct __pyx_obj __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":22 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":22 * * def __dealloc__(self): * del self.lattice # <<<<<<<<<<<<<< @@ -13231,7 +13265,7 @@ static PyObject *__pyx_pw_5_cdec_7Lattice_7__getitem__(PyObject *__pyx_v_self, P return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/lattice.pxi":24 +/* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":24 * del self.lattice * * def __getitem__(self, int index): # <<<<<<<<<<<<<< @@ -13261,7 +13295,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_6__getitem__(struct __pyx_obj_5_cdec_L int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":25 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":25 * * def __getitem__(self, int index): * if not 0 <= index < len(self): # <<<<<<<<<<<<<< @@ -13276,7 +13310,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_6__getitem__(struct __pyx_obj_5_cdec_L __pyx_t_3 = (!__pyx_t_1); if (__pyx_t_3) { - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":26 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":26 * def __getitem__(self, int index): * if not 0 <= index < len(self): * raise IndexError('lattice index out of range') # <<<<<<<<<<<<<< @@ -13292,7 +13326,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_6__getitem__(struct __pyx_obj_5_cdec_L } __pyx_L3:; - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":27 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":27 * if not 0 <= index < len(self): * raise IndexError('lattice index out of range') * arcs = [] # <<<<<<<<<<<<<< @@ -13304,7 +13338,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_6__getitem__(struct __pyx_obj_5_cdec_L __pyx_v_arcs = __pyx_t_4; __pyx_t_4 = 0; - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":28 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":28 * raise IndexError('lattice index out of range') * arcs = [] * cdef vector[lattice.LatticeArc] arc_vector = self.lattice[0][index] # <<<<<<<<<<<<<< @@ -13313,7 +13347,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_6__getitem__(struct __pyx_obj_5_cdec_L */ __pyx_v_arc_vector = ((__pyx_v_self->lattice[0])[__pyx_v_index]); - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":31 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":31 * cdef lattice.LatticeArc* arc * cdef unsigned i * for i in range(arc_vector.size()): # <<<<<<<<<<<<<< @@ -13324,7 +13358,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_6__getitem__(struct __pyx_obj_5_cdec_L for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":32 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":32 * cdef unsigned i * for i in range(arc_vector.size()): * arc = &arc_vector[i] # <<<<<<<<<<<<<< @@ -13333,7 +13367,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_6__getitem__(struct __pyx_obj_5_cdec_L */ __pyx_v_arc = (&(__pyx_v_arc_vector[__pyx_v_i])); - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":33 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":33 * for i in range(arc_vector.size()): * arc = &arc_vector[i] * label = unicode(TDConvert(arc.label).c_str(), 'utf8') # <<<<<<<<<<<<<< @@ -13357,7 +13391,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_6__getitem__(struct __pyx_obj_5_cdec_L __pyx_v_label = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":34 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":34 * arc = &arc_vector[i] * label = unicode(TDConvert(arc.label).c_str(), 'utf8') * arcs.append((label, arc.cost, arc.dist2next)) # <<<<<<<<<<<<<< @@ -13383,7 +13417,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_6__getitem__(struct __pyx_obj_5_cdec_L __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; } - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":35 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":35 * label = unicode(TDConvert(arc.label).c_str(), 'utf8') * arcs.append((label, arc.cost, arc.dist2next)) * return tuple(arcs) # <<<<<<<<<<<<<< @@ -13439,7 +13473,7 @@ static int __pyx_pw_5_cdec_7Lattice_9__setitem__(PyObject *__pyx_v_self, PyObjec return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/lattice.pxi":37 +/* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":37 * return tuple(arcs) * * def __setitem__(self, int index, tuple arcs): # <<<<<<<<<<<<<< @@ -13473,7 +13507,7 @@ static int __pyx_pf_5_cdec_7Lattice_8__setitem__(struct __pyx_obj_5_cdec_Lattice int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 0); - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":38 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":38 * * def __setitem__(self, int index, tuple arcs): * if not 0 <= index < len(self): # <<<<<<<<<<<<<< @@ -13488,7 +13522,7 @@ static int __pyx_pf_5_cdec_7Lattice_8__setitem__(struct __pyx_obj_5_cdec_Lattice __pyx_t_3 = (!__pyx_t_1); if (__pyx_t_3) { - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":39 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":39 * def __setitem__(self, int index, tuple arcs): * if not 0 <= index < len(self): * raise IndexError('lattice index out of range') # <<<<<<<<<<<<<< @@ -13504,7 +13538,7 @@ static int __pyx_pf_5_cdec_7Lattice_8__setitem__(struct __pyx_obj_5_cdec_Lattice } __pyx_L3:; - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":41 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":41 * raise IndexError('lattice index out of range') * cdef lattice.LatticeArc* arc * for (label, cost, dist2next) in arcs: # <<<<<<<<<<<<<< @@ -13588,7 +13622,7 @@ static int __pyx_pf_5_cdec_7Lattice_8__setitem__(struct __pyx_obj_5_cdec_Lattice __pyx_v_dist2next = __pyx_t_8; __pyx_t_8 = 0; - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":42 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":42 * cdef lattice.LatticeArc* arc * for (label, cost, dist2next) in arcs: * label_str = as_str(label) # <<<<<<<<<<<<<< @@ -13601,7 +13635,7 @@ static int __pyx_pf_5_cdec_7Lattice_8__setitem__(struct __pyx_obj_5_cdec_Lattice __pyx_v_label_str = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":43 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":43 * for (label, cost, dist2next) in arcs: * label_str = as_str(label) * arc = new lattice.LatticeArc(TDConvert(label_str), cost, dist2next) # <<<<<<<<<<<<<< @@ -13613,7 +13647,7 @@ static int __pyx_pf_5_cdec_7Lattice_8__setitem__(struct __pyx_obj_5_cdec_Lattice __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/vchahune/tools/cdec/python/src/lattice.pxi":44 + /* "/Users/vchahun/Sandbox/cdec/python/src/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]) # <<<<<<<<<<<<<< @@ -13622,7 +13656,7 @@ static int __pyx_pf_5_cdec_7Lattice_8__setitem__(struct __pyx_obj_5_cdec_Lattice */ ((__pyx_v_self->lattice[0])[__pyx_v_index]).push_back((__pyx_v_arc[0])); - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":45 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":45 * arc = new lattice.LatticeArc(TDConvert(label_str), cost, dist2next) * self.lattice[0][index].push_back(arc[0]) * del arc # <<<<<<<<<<<<<< @@ -13664,7 +13698,7 @@ static Py_ssize_t __pyx_pw_5_cdec_7Lattice_11__len__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/lattice.pxi":47 +/* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":47 * del arc * * def __len__(self): # <<<<<<<<<<<<<< @@ -13677,7 +13711,7 @@ static Py_ssize_t __pyx_pf_5_cdec_7Lattice_10__len__(struct __pyx_obj_5_cdec_Lat __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__", 0); - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":48 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":48 * * def __len__(self): * return self.lattice.size() # <<<<<<<<<<<<<< @@ -13704,7 +13738,7 @@ static PyObject *__pyx_pw_5_cdec_7Lattice_13__str__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/lattice.pxi":50 +/* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":50 * return self.lattice.size() * * def __str__(self): # <<<<<<<<<<<<<< @@ -13722,7 +13756,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_12__str__(struct __pyx_obj_5_cdec_Latt int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 0); - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":51 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":51 * * def __str__(self): * return str(hypergraph.AsPLF(self.lattice[0], True).c_str()) # <<<<<<<<<<<<<< @@ -13768,7 +13802,7 @@ static PyObject *__pyx_pw_5_cdec_7Lattice_15__unicode__(PyObject *__pyx_v_self, return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/lattice.pxi":53 +/* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":53 * return str(hypergraph.AsPLF(self.lattice[0], True).c_str()) * * def __unicode__(self): # <<<<<<<<<<<<<< @@ -13786,7 +13820,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_14__unicode__(struct __pyx_obj_5_cdec_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__unicode__", 0); - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":54 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":54 * * def __unicode__(self): * return unicode(str(self), 'utf8') # <<<<<<<<<<<<<< @@ -13842,7 +13876,7 @@ static PyObject *__pyx_pw_5_cdec_7Lattice_17__iter__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/lattice.pxi":56 +/* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":56 * return unicode(str(self), 'utf8') * * def __iter__(self): # <<<<<<<<<<<<<< @@ -13905,7 +13939,7 @@ static PyObject *__pyx_gb_5_cdec_7Lattice_18generator14(__pyx_GeneratorObject *_ __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/vchahune/tools/cdec/python/src/lattice.pxi":58 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":58 * def __iter__(self): * cdef unsigned i * for i in range(len(self)): # <<<<<<<<<<<<<< @@ -13916,7 +13950,7 @@ static PyObject *__pyx_gb_5_cdec_7Lattice_18generator14(__pyx_GeneratorObject *_ 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/vchahune/tools/cdec/python/src/lattice.pxi":59 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":59 * cdef unsigned i * for i in range(len(self)): * yield self[i] # <<<<<<<<<<<<<< @@ -13977,7 +14011,7 @@ static PyObject *__pyx_pw_5_cdec_7Lattice_5todot_1lines(PyObject *__pyx_self, CY return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/lattice.pxi":63 +/* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":63 * def todot(self): * """lattice.todot() -> Representation of the lattice in GraphViz dot format.""" * def lines(): # <<<<<<<<<<<<<< @@ -14054,7 +14088,7 @@ static PyObject *__pyx_gb_5_cdec_7Lattice_5todot_2generator20(__pyx_GeneratorObj __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/vchahune/tools/cdec/python/src/lattice.pxi":64 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":64 * """lattice.todot() -> Representation of the lattice in GraphViz dot format.""" * def lines(): * yield 'digraph lattice {' # <<<<<<<<<<<<<< @@ -14071,7 +14105,7 @@ static PyObject *__pyx_gb_5_cdec_7Lattice_5todot_2generator20(__pyx_GeneratorObj __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/vchahune/tools/cdec/python/src/lattice.pxi":65 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":65 * def lines(): * yield 'digraph lattice {' * yield 'rankdir = LR;' # <<<<<<<<<<<<<< @@ -14088,7 +14122,7 @@ static PyObject *__pyx_gb_5_cdec_7Lattice_5todot_2generator20(__pyx_GeneratorObj __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/vchahune/tools/cdec/python/src/lattice.pxi":66 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":66 * yield 'digraph lattice {' * yield 'rankdir = LR;' * yield 'node [shape=circle];' # <<<<<<<<<<<<<< @@ -14105,7 +14139,7 @@ static PyObject *__pyx_gb_5_cdec_7Lattice_5todot_2generator20(__pyx_GeneratorObj __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/vchahune/tools/cdec/python/src/lattice.pxi":67 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":67 * yield 'rankdir = LR;' * yield 'node [shape=circle];' * for i in range(len(self)): # <<<<<<<<<<<<<< @@ -14168,7 +14202,7 @@ static PyObject *__pyx_gb_5_cdec_7Lattice_5todot_2generator20(__pyx_GeneratorObj __pyx_cur_scope->__pyx_v_i = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":68 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":68 * yield 'node [shape=circle];' * for i in range(len(self)): * for label, weight, delta in self[i]: # <<<<<<<<<<<<<< @@ -14283,7 +14317,7 @@ static PyObject *__pyx_gb_5_cdec_7Lattice_5todot_2generator20(__pyx_GeneratorObj __pyx_cur_scope->__pyx_v_delta = __pyx_t_10; __pyx_t_10 = 0; - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":69 + /* "/Users/vchahun/Sandbox/cdec/python/src/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('"', '\\"')) # <<<<<<<<<<<<<< @@ -14343,7 +14377,7 @@ static PyObject *__pyx_gb_5_cdec_7Lattice_5todot_2generator20(__pyx_GeneratorObj } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":70 + /* "/Users/vchahun/Sandbox/cdec/python/src/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) # <<<<<<<<<<<<<< @@ -14369,7 +14403,7 @@ static PyObject *__pyx_gb_5_cdec_7Lattice_5todot_2generator20(__pyx_GeneratorObj __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/vchahune/tools/cdec/python/src/lattice.pxi":71 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":71 * yield '%d -> %d [label="%s"];' % (i, i+delta, label.replace('"', '\\"')) * yield '%d [shape=doublecircle]' % len(self) * yield '}' # <<<<<<<<<<<<<< @@ -14404,7 +14438,7 @@ static PyObject *__pyx_gb_5_cdec_7Lattice_5todot_2generator20(__pyx_GeneratorObj return NULL; } -/* "/home/vchahune/tools/cdec/python/src/lattice.pxi":61 +/* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":61 * yield self[i] * * def todot(self): # <<<<<<<<<<<<<< @@ -14434,7 +14468,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_19todot(struct __pyx_obj_5_cdec_Lattic __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":63 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":63 * def todot(self): * """lattice.todot() -> Representation of the lattice in GraphViz dot format.""" * def lines(): # <<<<<<<<<<<<<< @@ -14446,7 +14480,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_19todot(struct __pyx_obj_5_cdec_Lattic __pyx_v_lines = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":72 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":72 * yield '%d [shape=doublecircle]' % len(self) * yield '}' * return '\n'.join(lines()).encode('utf8') # <<<<<<<<<<<<<< @@ -14505,7 +14539,7 @@ static PyObject *__pyx_pw_5_cdec_7Lattice_22as_hypergraph(PyObject *__pyx_v_self return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/lattice.pxi":74 +/* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":74 * return '\n'.join(lines()).encode('utf8') * * def as_hypergraph(self): # <<<<<<<<<<<<<< @@ -14526,7 +14560,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_21as_hypergraph(struct __pyx_obj_5_cde int __pyx_clineno = 0; __Pyx_RefNannySetupContext("as_hypergraph", 0); - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":76 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":76 * def as_hypergraph(self): * """lattice.as_hypergraph() -> Hypergraph representation of the lattice.""" * cdef Hypergraph result = Hypergraph.__new__(Hypergraph) # <<<<<<<<<<<<<< @@ -14539,7 +14573,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_21as_hypergraph(struct __pyx_obj_5_cde __pyx_v_result = ((struct __pyx_obj_5_cdec_Hypergraph *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":77 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":77 * """lattice.as_hypergraph() -> Hypergraph representation of the lattice.""" * cdef Hypergraph result = Hypergraph.__new__(Hypergraph) * result.hg = new hypergraph.Hypergraph() # <<<<<<<<<<<<<< @@ -14548,7 +14582,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_21as_hypergraph(struct __pyx_obj_5_cde */ __pyx_v_result->hg = new Hypergraph(); - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":78 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":78 * cdef Hypergraph result = Hypergraph.__new__(Hypergraph) * result.hg = new hypergraph.Hypergraph() * cdef bytes plf = str(self) # <<<<<<<<<<<<<< @@ -14567,7 +14601,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_21as_hypergraph(struct __pyx_obj_5_cde __pyx_v_plf = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":79 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":79 * result.hg = new hypergraph.Hypergraph() * cdef bytes plf = str(self) * hypergraph.ReadFromPLF(plf, result.hg) # <<<<<<<<<<<<<< @@ -14576,7 +14610,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_21as_hypergraph(struct __pyx_obj_5_cde __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/vchahune/tools/cdec/python/src/lattice.pxi":80 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":80 * cdef bytes plf = str(self) * hypergraph.ReadFromPLF(plf, result.hg) * return result # <<<<<<<<<<<<<< @@ -14601,7 +14635,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_21as_hypergraph(struct __pyx_obj_5_cde return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":3 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":3 * cimport mteval * * cdef SufficientStats as_stats(x, y): # <<<<<<<<<<<<<< @@ -14622,7 +14656,7 @@ static struct __pyx_obj_5_cdec_SufficientStats *__pyx_f_5_cdec_as_stats(PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("as_stats", 0); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":4 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":4 * * cdef SufficientStats as_stats(x, y): * if isinstance(x, SufficientStats): # <<<<<<<<<<<<<< @@ -14635,7 +14669,7 @@ static struct __pyx_obj_5_cdec_SufficientStats *__pyx_f_5_cdec_as_stats(PyObject __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":5 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":5 * cdef SufficientStats as_stats(x, y): * if isinstance(x, SufficientStats): * return x # <<<<<<<<<<<<<< @@ -14650,7 +14684,7 @@ static struct __pyx_obj_5_cdec_SufficientStats *__pyx_f_5_cdec_as_stats(PyObject goto __pyx_L3; } - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":6 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":6 * if isinstance(x, SufficientStats): * return x * elif x == 0 and isinstance(y, SufficientStats): # <<<<<<<<<<<<<< @@ -14671,7 +14705,7 @@ static struct __pyx_obj_5_cdec_SufficientStats *__pyx_f_5_cdec_as_stats(PyObject } if (__pyx_t_4) { - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":7 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":7 * return x * elif x == 0 and isinstance(y, SufficientStats): * stats = SufficientStats() # <<<<<<<<<<<<<< @@ -14683,7 +14717,7 @@ static struct __pyx_obj_5_cdec_SufficientStats *__pyx_f_5_cdec_as_stats(PyObject __pyx_v_stats = ((struct __pyx_obj_5_cdec_SufficientStats *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":8 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":8 * elif x == 0 and isinstance(y, SufficientStats): * stats = SufficientStats() * stats.stats = new mteval.SufficientStats() # <<<<<<<<<<<<<< @@ -14692,7 +14726,7 @@ static struct __pyx_obj_5_cdec_SufficientStats *__pyx_f_5_cdec_as_stats(PyObject */ __pyx_v_stats->stats = new SufficientStats(); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":9 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":9 * stats = SufficientStats() * stats.stats = new mteval.SufficientStats() * stats.metric = (<SufficientStats> y).metric # <<<<<<<<<<<<<< @@ -14701,7 +14735,7 @@ static struct __pyx_obj_5_cdec_SufficientStats *__pyx_f_5_cdec_as_stats(PyObject */ __pyx_v_stats->metric = ((struct __pyx_obj_5_cdec_SufficientStats *)__pyx_v_y)->metric; - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":10 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":10 * stats.stats = new mteval.SufficientStats() * stats.metric = (<SufficientStats> y).metric * return stats # <<<<<<<<<<<<<< @@ -14740,7 +14774,7 @@ static PyObject *__pyx_pw_5_cdec_9Candidate_5words_1__get__(PyObject *__pyx_v_se return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":17 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":17 * * property words: * def __get__(self): # <<<<<<<<<<<<<< @@ -14759,7 +14793,7 @@ static PyObject *__pyx_pf_5_cdec_9Candidate_5words___get__(struct __pyx_obj_5_cd int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":18 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":18 * property words: * def __get__(self): * return unicode(GetString(self.candidate.ewords).c_str(), encoding='utf8') # <<<<<<<<<<<<<< @@ -14810,7 +14844,7 @@ static PyObject *__pyx_pw_5_cdec_9Candidate_4fmap_1__get__(PyObject *__pyx_v_sel return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":21 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":21 * * property fmap: * def __get__(self): # <<<<<<<<<<<<<< @@ -14828,7 +14862,7 @@ static PyObject *__pyx_pf_5_cdec_9Candidate_4fmap___get__(struct __pyx_obj_5_cde int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":22 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":22 * property fmap: * def __get__(self): * cdef SparseVector fmap = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<< @@ -14841,7 +14875,7 @@ static PyObject *__pyx_pf_5_cdec_9Candidate_4fmap___get__(struct __pyx_obj_5_cde __pyx_v_fmap = ((struct __pyx_obj_5_cdec_SparseVector *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":23 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":23 * def __get__(self): * cdef SparseVector fmap = SparseVector.__new__(SparseVector) * fmap.vector = new FastSparseVector[weight_t](self.candidate.fmap) # <<<<<<<<<<<<<< @@ -14850,7 +14884,7 @@ static PyObject *__pyx_pf_5_cdec_9Candidate_4fmap___get__(struct __pyx_obj_5_cde */ __pyx_v_fmap->vector = new FastSparseVector<weight_t>(__pyx_v_self->candidate->fmap); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":24 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":24 * cdef SparseVector fmap = SparseVector.__new__(SparseVector) * fmap.vector = new FastSparseVector[weight_t](self.candidate.fmap) * return fmap # <<<<<<<<<<<<<< @@ -14886,7 +14920,7 @@ static PyObject *__pyx_pw_5_cdec_9Candidate_5score_1__get__(PyObject *__pyx_v_se return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":14 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":14 * cdef class Candidate: * cdef mteval.const_Candidate* candidate * cdef public float score # <<<<<<<<<<<<<< @@ -14962,7 +14996,7 @@ static void __pyx_pw_5_cdec_15SufficientStats_1__dealloc__(PyObject *__pyx_v_sel __Pyx_RefNannyFinishContext(); } -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":30 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":30 * cdef mteval.EvaluationMetric* metric * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -14974,7 +15008,7 @@ static void __pyx_pf_5_cdec_15SufficientStats___dealloc__(CYTHON_UNUSED struct _ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":31 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":31 * * def __dealloc__(self): * del self.stats # <<<<<<<<<<<<<< @@ -14997,7 +15031,7 @@ static PyObject *__pyx_pw_5_cdec_15SufficientStats_5score_1__get__(PyObject *__p return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":34 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":34 * * property score: * def __get__(self): # <<<<<<<<<<<<<< @@ -15014,7 +15048,7 @@ static PyObject *__pyx_pf_5_cdec_15SufficientStats_5score___get__(struct __pyx_o int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":35 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":35 * property score: * def __get__(self): * return self.metric.ComputeScore(self.stats[0]) # <<<<<<<<<<<<<< @@ -15051,7 +15085,7 @@ static PyObject *__pyx_pw_5_cdec_15SufficientStats_6detail_1__get__(PyObject *__ return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":38 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":38 * * property detail: * def __get__(self): # <<<<<<<<<<<<<< @@ -15069,7 +15103,7 @@ static PyObject *__pyx_pf_5_cdec_15SufficientStats_6detail___get__(struct __pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":39 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":39 * property detail: * def __get__(self): * return str(self.metric.DetailedScore(self.stats[0]).c_str()) # <<<<<<<<<<<<<< @@ -15115,7 +15149,7 @@ static Py_ssize_t __pyx_pw_5_cdec_15SufficientStats_3__len__(PyObject *__pyx_v_s return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":41 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":41 * return str(self.metric.DetailedScore(self.stats[0]).c_str()) * * def __len__(self): # <<<<<<<<<<<<<< @@ -15128,7 +15162,7 @@ static Py_ssize_t __pyx_pf_5_cdec_15SufficientStats_2__len__(struct __pyx_obj_5_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__", 0); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":42 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":42 * * def __len__(self): * return self.stats.size() # <<<<<<<<<<<<<< @@ -15156,7 +15190,7 @@ static PyObject *__pyx_pw_5_cdec_15SufficientStats_5__iter__(PyObject *__pyx_v_s return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":44 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":44 * return self.stats.size() * * def __iter__(self): # <<<<<<<<<<<<<< @@ -15220,7 +15254,7 @@ static PyObject *__pyx_gb_5_cdec_15SufficientStats_6generator15(__pyx_GeneratorO __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/vchahune/tools/cdec/python/src/mteval.pxi":45 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":45 * * def __iter__(self): * for i in range(len(self)): # <<<<<<<<<<<<<< @@ -15279,7 +15313,7 @@ static PyObject *__pyx_gb_5_cdec_15SufficientStats_6generator15(__pyx_GeneratorO __pyx_cur_scope->__pyx_v_i = __pyx_t_2; __pyx_t_2 = 0; - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":46 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":46 * def __iter__(self): * for i in range(len(self)): * yield self[i] # <<<<<<<<<<<<<< @@ -15343,7 +15377,7 @@ static PyObject *__pyx_pw_5_cdec_15SufficientStats_8__getitem__(PyObject *__pyx_ return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":48 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":48 * yield self[i] * * def __getitem__(self, int index): # <<<<<<<<<<<<<< @@ -15363,7 +15397,7 @@ static PyObject *__pyx_pf_5_cdec_15SufficientStats_7__getitem__(struct __pyx_obj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":49 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":49 * * def __getitem__(self, int index): * if not 0 <= index < len(self): # <<<<<<<<<<<<<< @@ -15378,7 +15412,7 @@ static PyObject *__pyx_pf_5_cdec_15SufficientStats_7__getitem__(struct __pyx_obj __pyx_t_3 = (!__pyx_t_1); if (__pyx_t_3) { - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":50 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":50 * def __getitem__(self, int index): * if not 0 <= index < len(self): * raise IndexError('sufficient stats vector index out of range') # <<<<<<<<<<<<<< @@ -15394,7 +15428,7 @@ static PyObject *__pyx_pf_5_cdec_15SufficientStats_7__getitem__(struct __pyx_obj } __pyx_L3:; - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":51 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":51 * if not 0 <= index < len(self): * raise IndexError('sufficient stats vector index out of range') * return self.stats[0][index] # <<<<<<<<<<<<<< @@ -15436,7 +15470,7 @@ static PyObject *__pyx_pw_5_cdec_15SufficientStats_10__iadd__(PyObject *__pyx_v_ return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":53 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":53 * return self.stats[0][index] * * def __iadd__(SufficientStats self, SufficientStats other): # <<<<<<<<<<<<<< @@ -15449,7 +15483,7 @@ static PyObject *__pyx_pf_5_cdec_15SufficientStats_9__iadd__(struct __pyx_obj_5_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iadd__", 0); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":54 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":54 * * def __iadd__(SufficientStats self, SufficientStats other): * self.stats[0] += other.stats[0] # <<<<<<<<<<<<<< @@ -15458,7 +15492,7 @@ static PyObject *__pyx_pf_5_cdec_15SufficientStats_9__iadd__(struct __pyx_obj_5_ */ (__pyx_v_self->stats[0]) += (__pyx_v_other->stats[0]); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":55 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":55 * def __iadd__(SufficientStats self, SufficientStats other): * self.stats[0] += other.stats[0] * return self # <<<<<<<<<<<<<< @@ -15488,7 +15522,7 @@ static PyObject *__pyx_pw_5_cdec_15SufficientStats_12__add__(PyObject *__pyx_v_x return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":57 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":57 * return self * * def __add__(x, y): # <<<<<<<<<<<<<< @@ -15508,7 +15542,7 @@ static PyObject *__pyx_pf_5_cdec_15SufficientStats_11__add__(PyObject *__pyx_v_x int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__add__", 0); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":58 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":58 * * def __add__(x, y): * cdef SufficientStats sx = as_stats(x, y) # <<<<<<<<<<<<<< @@ -15520,7 +15554,7 @@ static PyObject *__pyx_pf_5_cdec_15SufficientStats_11__add__(PyObject *__pyx_v_x __pyx_v_sx = ((struct __pyx_obj_5_cdec_SufficientStats *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":59 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":59 * def __add__(x, y): * cdef SufficientStats sx = as_stats(x, y) * cdef SufficientStats sy = as_stats(y, x) # <<<<<<<<<<<<<< @@ -15532,7 +15566,7 @@ static PyObject *__pyx_pf_5_cdec_15SufficientStats_11__add__(PyObject *__pyx_v_x __pyx_v_sy = ((struct __pyx_obj_5_cdec_SufficientStats *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":60 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":60 * cdef SufficientStats sx = as_stats(x, y) * cdef SufficientStats sy = as_stats(y, x) * cdef SufficientStats result = SufficientStats() # <<<<<<<<<<<<<< @@ -15544,7 +15578,7 @@ static PyObject *__pyx_pf_5_cdec_15SufficientStats_11__add__(PyObject *__pyx_v_x __pyx_v_result = ((struct __pyx_obj_5_cdec_SufficientStats *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":61 + /* "/Users/vchahun/Sandbox/cdec/python/src/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])) # <<<<<<<<<<<<<< @@ -15553,7 +15587,7 @@ static PyObject *__pyx_pf_5_cdec_15SufficientStats_11__add__(PyObject *__pyx_v_x */ __pyx_v_result->stats = new SufficientStats(operator+((__pyx_v_sx->stats[0]), (__pyx_v_sy->stats[0]))); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":62 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":62 * cdef SufficientStats result = SufficientStats() * result.stats = new mteval.SufficientStats(mteval.add(sx.stats[0], sy.stats[0])) * result.metric = sx.metric # <<<<<<<<<<<<<< @@ -15562,7 +15596,7 @@ static PyObject *__pyx_pf_5_cdec_15SufficientStats_11__add__(PyObject *__pyx_v_x */ __pyx_v_result->metric = __pyx_v_sx->metric; - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":63 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":63 * result.stats = new mteval.SufficientStats(mteval.add(sx.stats[0], sy.stats[0])) * result.metric = sx.metric * return result # <<<<<<<<<<<<<< @@ -15641,7 +15675,7 @@ static int __pyx_pw_5_cdec_12CandidateSet_1__cinit__(PyObject *__pyx_v_self, PyO return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":70 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":70 * cdef mteval.CandidateSet* cs * * def __cinit__(self, SegmentEvaluator evaluator): # <<<<<<<<<<<<<< @@ -15654,7 +15688,7 @@ static int __pyx_pf_5_cdec_12CandidateSet___cinit__(struct __pyx_obj_5_cdec_Cand __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":71 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":71 * * def __cinit__(self, SegmentEvaluator evaluator): * self.scorer = new shared_ptr[mteval.SegmentEvaluator](evaluator.scorer[0]) # <<<<<<<<<<<<<< @@ -15663,7 +15697,7 @@ static int __pyx_pf_5_cdec_12CandidateSet___cinit__(struct __pyx_obj_5_cdec_Cand */ __pyx_v_self->scorer = new boost::shared_ptr<SegmentEvaluator>((__pyx_v_evaluator->scorer[0])); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":72 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":72 * def __cinit__(self, SegmentEvaluator evaluator): * self.scorer = new shared_ptr[mteval.SegmentEvaluator](evaluator.scorer[0]) * self.metric = evaluator.metric # <<<<<<<<<<<<<< @@ -15672,7 +15706,7 @@ static int __pyx_pf_5_cdec_12CandidateSet___cinit__(struct __pyx_obj_5_cdec_Cand */ __pyx_v_self->metric = __pyx_v_evaluator->metric; - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":73 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":73 * self.scorer = new shared_ptr[mteval.SegmentEvaluator](evaluator.scorer[0]) * self.metric = evaluator.metric * self.cs = new mteval.CandidateSet() # <<<<<<<<<<<<<< @@ -15695,7 +15729,7 @@ static void __pyx_pw_5_cdec_12CandidateSet_3__dealloc__(PyObject *__pyx_v_self) __Pyx_RefNannyFinishContext(); } -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":75 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":75 * self.cs = new mteval.CandidateSet() * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -15707,7 +15741,7 @@ static void __pyx_pf_5_cdec_12CandidateSet_2__dealloc__(CYTHON_UNUSED struct __p __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":76 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":76 * * def __dealloc__(self): * del self.scorer # <<<<<<<<<<<<<< @@ -15716,7 +15750,7 @@ static void __pyx_pf_5_cdec_12CandidateSet_2__dealloc__(CYTHON_UNUSED struct __p */ delete __pyx_v_self->scorer; - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":77 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":77 * def __dealloc__(self): * del self.scorer * del self.cs # <<<<<<<<<<<<<< @@ -15739,7 +15773,7 @@ static Py_ssize_t __pyx_pw_5_cdec_12CandidateSet_5__len__(PyObject *__pyx_v_self return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":79 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":79 * del self.cs * * def __len__(self): # <<<<<<<<<<<<<< @@ -15752,7 +15786,7 @@ static Py_ssize_t __pyx_pf_5_cdec_12CandidateSet_4__len__(struct __pyx_obj_5_cde __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__len__", 0); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":80 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":80 * * def __len__(self): * return self.cs.size() # <<<<<<<<<<<<<< @@ -15789,7 +15823,7 @@ static PyObject *__pyx_pw_5_cdec_12CandidateSet_7__getitem__(PyObject *__pyx_v_s return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":82 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":82 * return self.cs.size() * * def __getitem__(self,int k): # <<<<<<<<<<<<<< @@ -15809,7 +15843,7 @@ static PyObject *__pyx_pf_5_cdec_12CandidateSet_6__getitem__(struct __pyx_obj_5_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 0); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":83 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":83 * * def __getitem__(self,int k): * if not 0 <= k < self.cs.size(): # <<<<<<<<<<<<<< @@ -15823,7 +15857,7 @@ static PyObject *__pyx_pf_5_cdec_12CandidateSet_6__getitem__(struct __pyx_obj_5_ __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":84 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":84 * def __getitem__(self,int k): * if not 0 <= k < self.cs.size(): * raise IndexError('candidate set index out of range') # <<<<<<<<<<<<<< @@ -15839,7 +15873,7 @@ static PyObject *__pyx_pf_5_cdec_12CandidateSet_6__getitem__(struct __pyx_obj_5_ } __pyx_L3:; - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":85 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":85 * if not 0 <= k < self.cs.size(): * raise IndexError('candidate set index out of range') * cdef Candidate candidate = Candidate() # <<<<<<<<<<<<<< @@ -15851,7 +15885,7 @@ static PyObject *__pyx_pf_5_cdec_12CandidateSet_6__getitem__(struct __pyx_obj_5_ __pyx_v_candidate = ((struct __pyx_obj_5_cdec_Candidate *)__pyx_t_3); __pyx_t_3 = 0; - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":86 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":86 * raise IndexError('candidate set index out of range') * cdef Candidate candidate = Candidate() * candidate.candidate = &self.cs[0][k] # <<<<<<<<<<<<<< @@ -15860,7 +15894,7 @@ static PyObject *__pyx_pf_5_cdec_12CandidateSet_6__getitem__(struct __pyx_obj_5_ */ __pyx_v_candidate->candidate = (&((__pyx_v_self->cs[0])[__pyx_v_k])); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":87 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":87 * cdef Candidate candidate = Candidate() * candidate.candidate = &self.cs[0][k] * candidate.score = self.metric.ComputeScore(self.cs[0][k].eval_feats) # <<<<<<<<<<<<<< @@ -15869,7 +15903,7 @@ static PyObject *__pyx_pf_5_cdec_12CandidateSet_6__getitem__(struct __pyx_obj_5_ */ __pyx_v_candidate->score = __pyx_v_self->metric->ComputeScore(((__pyx_v_self->cs[0])[__pyx_v_k]).eval_feats); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":88 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":88 * candidate.candidate = &self.cs[0][k] * candidate.score = self.metric.ComputeScore(self.cs[0][k].eval_feats) * return candidate # <<<<<<<<<<<<<< @@ -15906,7 +15940,7 @@ static PyObject *__pyx_pw_5_cdec_12CandidateSet_9__iter__(PyObject *__pyx_v_self return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":90 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":90 * return candidate * * def __iter__(self): # <<<<<<<<<<<<<< @@ -15969,7 +16003,7 @@ static PyObject *__pyx_gb_5_cdec_12CandidateSet_10generator16(__pyx_GeneratorObj __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/vchahune/tools/cdec/python/src/mteval.pxi":92 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":92 * def __iter__(self): * cdef unsigned i * for i in range(len(self)): # <<<<<<<<<<<<<< @@ -15980,7 +16014,7 @@ static PyObject *__pyx_gb_5_cdec_12CandidateSet_10generator16(__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/vchahune/tools/cdec/python/src/mteval.pxi":93 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":93 * cdef unsigned i * for i in range(len(self)): * yield self[i] # <<<<<<<<<<<<<< @@ -16078,7 +16112,7 @@ static PyObject *__pyx_pw_5_cdec_12CandidateSet_12add_kbest(PyObject *__pyx_v_se return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":95 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":95 * yield self[i] * * def add_kbest(self, Hypergraph hypergraph, unsigned k): # <<<<<<<<<<<<<< @@ -16091,7 +16125,7 @@ static PyObject *__pyx_pf_5_cdec_12CandidateSet_11add_kbest(struct __pyx_obj_5_c __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("add_kbest", 0); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":98 + /* "/Users/vchahun/Sandbox/cdec/python/src/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()) # <<<<<<<<<<<<<< @@ -16115,7 +16149,7 @@ static void __pyx_pw_5_cdec_16SegmentEvaluator_1__dealloc__(PyObject *__pyx_v_se __Pyx_RefNannyFinishContext(); } -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":104 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":104 * cdef mteval.EvaluationMetric* metric * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -16127,7 +16161,7 @@ static void __pyx_pf_5_cdec_16SegmentEvaluator___dealloc__(CYTHON_UNUSED struct __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":105 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":105 * * def __dealloc__(self): * del self.scorer # <<<<<<<<<<<<<< @@ -16151,7 +16185,7 @@ static PyObject *__pyx_pw_5_cdec_16SegmentEvaluator_3evaluate(PyObject *__pyx_v_ return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":107 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":107 * del self.scorer * * def evaluate(self, sentence): # <<<<<<<<<<<<<< @@ -16172,7 +16206,7 @@ static PyObject *__pyx_pf_5_cdec_16SegmentEvaluator_2evaluate(struct __pyx_obj_5 int __pyx_clineno = 0; __Pyx_RefNannySetupContext("evaluate", 0); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":110 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":110 * """se.evaluate(sentence) -> SufficientStats for the given hypothesis.""" * cdef vector[WordID] hyp * cdef SufficientStats sf = SufficientStats() # <<<<<<<<<<<<<< @@ -16184,7 +16218,7 @@ static PyObject *__pyx_pf_5_cdec_16SegmentEvaluator_2evaluate(struct __pyx_obj_5 __pyx_v_sf = ((struct __pyx_obj_5_cdec_SufficientStats *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":111 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":111 * cdef vector[WordID] hyp * cdef SufficientStats sf = SufficientStats() * sf.metric = self.metric # <<<<<<<<<<<<<< @@ -16193,7 +16227,7 @@ static PyObject *__pyx_pf_5_cdec_16SegmentEvaluator_2evaluate(struct __pyx_obj_5 */ __pyx_v_sf->metric = __pyx_v_self->metric; - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":112 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":112 * cdef SufficientStats sf = SufficientStats() * sf.metric = self.metric * sf.stats = new mteval.SufficientStats() # <<<<<<<<<<<<<< @@ -16202,7 +16236,7 @@ static PyObject *__pyx_pf_5_cdec_16SegmentEvaluator_2evaluate(struct __pyx_obj_5 */ __pyx_v_sf->stats = new SufficientStats(); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":113 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":113 * sf.metric = self.metric * sf.stats = new mteval.SufficientStats() * ConvertSentence(as_str(sentence.strip()), &hyp) # <<<<<<<<<<<<<< @@ -16221,7 +16255,7 @@ static PyObject *__pyx_pf_5_cdec_16SegmentEvaluator_2evaluate(struct __pyx_obj_5 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; TD::ConvertSentence(__pyx_t_3, (&__pyx_v_hyp)); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":114 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":114 * sf.stats = new mteval.SufficientStats() * ConvertSentence(as_str(sentence.strip()), &hyp) * self.scorer.get().Evaluate(hyp, sf.stats) # <<<<<<<<<<<<<< @@ -16230,7 +16264,7 @@ static PyObject *__pyx_pf_5_cdec_16SegmentEvaluator_2evaluate(struct __pyx_obj_5 */ __pyx_v_self->scorer->get()->Evaluate(__pyx_v_hyp, __pyx_v_sf->stats); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":115 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":115 * ConvertSentence(as_str(sentence.strip()), &hyp) * self.scorer.get().Evaluate(hyp, sf.stats) * return sf # <<<<<<<<<<<<<< @@ -16268,7 +16302,7 @@ static PyObject *__pyx_pw_5_cdec_16SegmentEvaluator_5candidate_set(PyObject *__p return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":117 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":117 * return sf * * def candidate_set(self): # <<<<<<<<<<<<<< @@ -16286,7 +16320,7 @@ static PyObject *__pyx_pf_5_cdec_16SegmentEvaluator_4candidate_set(struct __pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("candidate_set", 0); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":119 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":119 * def candidate_set(self): * """se.candidate_set() -> Candidate set using this segment evaluator for scoring.""" * return CandidateSet(self) # <<<<<<<<<<<<<< @@ -16330,7 +16364,7 @@ static int __pyx_pw_5_cdec_6Scorer_1__cinit__(PyObject *__pyx_v_self, PyObject * static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__name,0}; PyObject* values[1] = {0}; - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":125 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":125 * cdef mteval.EvaluationMetric* metric * * def __cinit__(self, bytes name=None): # <<<<<<<<<<<<<< @@ -16395,7 +16429,7 @@ static int __pyx_pf_5_cdec_6Scorer___cinit__(struct __pyx_obj_5_cdec_Scorer *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":126 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":126 * * def __cinit__(self, bytes name=None): * if name: # <<<<<<<<<<<<<< @@ -16405,7 +16439,7 @@ static int __pyx_pf_5_cdec_6Scorer___cinit__(struct __pyx_obj_5_cdec_Scorer *__p __pyx_t_1 = (((PyObject *)__pyx_v_name) != Py_None) && (PyBytes_GET_SIZE(((PyObject *)__pyx_v_name)) != 0); if (__pyx_t_1) { - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":127 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":127 * def __cinit__(self, bytes name=None): * if name: * self.name = new string(name) # <<<<<<<<<<<<<< @@ -16416,7 +16450,7 @@ static int __pyx_pf_5_cdec_6Scorer___cinit__(struct __pyx_obj_5_cdec_Scorer *__p try {__pyx_t_3 = new std::string(__pyx_t_2);} catch(...) {__Pyx_CppExn2PyErr(); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}} __pyx_v_self->name = __pyx_t_3; - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":128 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":128 * if name: * self.name = new string(name) * self.metric = mteval.MetricInstance(self.name[0]) # <<<<<<<<<<<<<< @@ -16447,7 +16481,7 @@ static void __pyx_pw_5_cdec_6Scorer_3__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannyFinishContext(); } -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":130 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":130 * self.metric = mteval.MetricInstance(self.name[0]) * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -16459,7 +16493,7 @@ static void __pyx_pf_5_cdec_6Scorer_2__dealloc__(CYTHON_UNUSED struct __pyx_obj_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__dealloc__", 0); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":131 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":131 * * def __dealloc__(self): * del self.name # <<<<<<<<<<<<<< @@ -16518,7 +16552,7 @@ static PyObject *__pyx_pw_5_cdec_6Scorer_5__call__(PyObject *__pyx_v_self, PyObj return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":133 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":133 * del self.name * * def __call__(self, refs): # <<<<<<<<<<<<<< @@ -16548,7 +16582,7 @@ static PyObject *__pyx_pf_5_cdec_6Scorer_4__call__(struct __pyx_obj_5_cdec_Score __Pyx_RefNannySetupContext("__call__", 0); __Pyx_INCREF(__pyx_v_refs); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":134 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":134 * * def __call__(self, refs): * if isinstance(refs, basestring): # <<<<<<<<<<<<<< @@ -16561,7 +16595,7 @@ static PyObject *__pyx_pf_5_cdec_6Scorer_4__call__(struct __pyx_obj_5_cdec_Score __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":135 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":135 * def __call__(self, refs): * if isinstance(refs, basestring): * refs = [refs] # <<<<<<<<<<<<<< @@ -16580,7 +16614,7 @@ static PyObject *__pyx_pf_5_cdec_6Scorer_4__call__(struct __pyx_obj_5_cdec_Score } __pyx_L3:; - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":136 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":136 * if isinstance(refs, basestring): * refs = [refs] * cdef vector[vector[WordID]]* refsv = new vector[vector[WordID]]() # <<<<<<<<<<<<<< @@ -16590,7 +16624,7 @@ static PyObject *__pyx_pf_5_cdec_6Scorer_4__call__(struct __pyx_obj_5_cdec_Score try {__pyx_t_3 = new std::vector<std::vector<WordID> >();} catch(...) {__Pyx_CppExn2PyErr(); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}} __pyx_v_refsv = __pyx_t_3; - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":138 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":138 * cdef vector[vector[WordID]]* refsv = new vector[vector[WordID]]() * cdef vector[WordID]* refv * for ref in refs: # <<<<<<<<<<<<<< @@ -16635,7 +16669,7 @@ static PyObject *__pyx_pf_5_cdec_6Scorer_4__call__(struct __pyx_obj_5_cdec_Score __pyx_v_ref = __pyx_t_6; __pyx_t_6 = 0; - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":139 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":139 * cdef vector[WordID]* refv * for ref in refs: * refv = new vector[WordID]() # <<<<<<<<<<<<<< @@ -16645,7 +16679,7 @@ static PyObject *__pyx_pf_5_cdec_6Scorer_4__call__(struct __pyx_obj_5_cdec_Score try {__pyx_t_7 = new std::vector<WordID>();} catch(...) {__Pyx_CppExn2PyErr(); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}} __pyx_v_refv = __pyx_t_7; - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":140 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":140 * for ref in refs: * refv = new vector[WordID]() * ConvertSentence(as_str(ref.strip()), refv) # <<<<<<<<<<<<<< @@ -16664,7 +16698,7 @@ static PyObject *__pyx_pf_5_cdec_6Scorer_4__call__(struct __pyx_obj_5_cdec_Score __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; TD::ConvertSentence(__pyx_t_9, __pyx_v_refv); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":141 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":141 * refv = new vector[WordID]() * ConvertSentence(as_str(ref.strip()), refv) * refsv.push_back(refv[0]) # <<<<<<<<<<<<<< @@ -16673,7 +16707,7 @@ static PyObject *__pyx_pf_5_cdec_6Scorer_4__call__(struct __pyx_obj_5_cdec_Score */ __pyx_v_refsv->push_back((__pyx_v_refv[0])); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":142 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":142 * ConvertSentence(as_str(ref.strip()), refv) * refsv.push_back(refv[0]) * del refv # <<<<<<<<<<<<<< @@ -16684,7 +16718,7 @@ static PyObject *__pyx_pf_5_cdec_6Scorer_4__call__(struct __pyx_obj_5_cdec_Score } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":144 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":144 * del refv * cdef unsigned i * cdef SegmentEvaluator evaluator = SegmentEvaluator() # <<<<<<<<<<<<<< @@ -16696,7 +16730,7 @@ static PyObject *__pyx_pf_5_cdec_6Scorer_4__call__(struct __pyx_obj_5_cdec_Score __pyx_v_evaluator = ((struct __pyx_obj_5_cdec_SegmentEvaluator *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":145 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":145 * cdef unsigned i * cdef SegmentEvaluator evaluator = SegmentEvaluator() * evaluator.metric = self.metric # <<<<<<<<<<<<<< @@ -16705,7 +16739,7 @@ static PyObject *__pyx_pf_5_cdec_6Scorer_4__call__(struct __pyx_obj_5_cdec_Score */ __pyx_v_evaluator->metric = __pyx_v_self->metric; - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":146 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":146 * cdef SegmentEvaluator evaluator = SegmentEvaluator() * evaluator.metric = self.metric * evaluator.scorer = new shared_ptr[mteval.SegmentEvaluator]( # <<<<<<<<<<<<<< @@ -16714,7 +16748,7 @@ static PyObject *__pyx_pf_5_cdec_6Scorer_4__call__(struct __pyx_obj_5_cdec_Score */ __pyx_v_evaluator->scorer = new boost::shared_ptr<SegmentEvaluator>(__pyx_v_self->metric->CreateSegmentEvaluator((__pyx_v_refsv[0]))); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":148 + /* "/Users/vchahun/Sandbox/cdec/python/src/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 # <<<<<<<<<<<<<< @@ -16723,7 +16757,7 @@ static PyObject *__pyx_pf_5_cdec_6Scorer_4__call__(struct __pyx_obj_5_cdec_Score */ delete __pyx_v_refsv; - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":149 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":149 * self.metric.CreateSegmentEvaluator(refsv[0])) * del refsv # in theory should not delete but store in SegmentEvaluator * return evaluator # <<<<<<<<<<<<<< @@ -16763,7 +16797,7 @@ static PyObject *__pyx_pw_5_cdec_6Scorer_7__str__(PyObject *__pyx_v_self) { return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":151 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":151 * return evaluator * * def __str__(self): # <<<<<<<<<<<<<< @@ -16781,7 +16815,7 @@ static PyObject *__pyx_pf_5_cdec_6Scorer_6__str__(struct __pyx_obj_5_cdec_Scorer int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 0); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":152 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":152 * * def __str__(self): * return str(self.name.c_str()) # <<<<<<<<<<<<<< @@ -16816,7 +16850,7 @@ static PyObject *__pyx_pf_5_cdec_6Scorer_6__str__(struct __pyx_obj_5_cdec_Scorer return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":154 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":154 * return str(self.name.c_str()) * * cdef float _compute_score(void* metric_, mteval.SufficientStats* stats): # <<<<<<<<<<<<<< @@ -16842,7 +16876,7 @@ static float __pyx_f_5_cdec__compute_score(void *__pyx_v_metric_, SufficientStat int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_compute_score", 0); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":155 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":155 * * cdef float _compute_score(void* metric_, mteval.SufficientStats* stats): * cdef Metric metric = <Metric> metric_ # <<<<<<<<<<<<<< @@ -16852,7 +16886,7 @@ static float __pyx_f_5_cdec__compute_score(void *__pyx_v_metric_, SufficientStat __Pyx_INCREF(((PyObject *)((struct __pyx_obj_5_cdec_Metric *)__pyx_v_metric_))); __pyx_v_metric = ((struct __pyx_obj_5_cdec_Metric *)__pyx_v_metric_); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":156 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":156 * cdef float _compute_score(void* metric_, mteval.SufficientStats* stats): * cdef Metric metric = <Metric> metric_ * cdef list ss = [] # <<<<<<<<<<<<<< @@ -16864,7 +16898,7 @@ static float __pyx_f_5_cdec__compute_score(void *__pyx_v_metric_, SufficientStat __pyx_v_ss = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":158 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":158 * cdef list ss = [] * cdef unsigned i * for i in range(stats.size()): # <<<<<<<<<<<<<< @@ -16875,7 +16909,7 @@ static float __pyx_f_5_cdec__compute_score(void *__pyx_v_metric_, SufficientStat for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":159 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":159 * cdef unsigned i * for i in range(stats.size()): * ss.append(stats[0][i]) # <<<<<<<<<<<<<< @@ -16888,7 +16922,7 @@ static float __pyx_f_5_cdec__compute_score(void *__pyx_v_metric_, SufficientStat __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":160 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":160 * for i in range(stats.size()): * ss.append(stats[0][i]) * return metric.score(ss) # <<<<<<<<<<<<<< @@ -16926,7 +16960,7 @@ static float __pyx_f_5_cdec__compute_score(void *__pyx_v_metric_, SufficientStat return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":162 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":162 * return metric.score(ss) * * cdef void _compute_sufficient_stats(void* metric_, # <<<<<<<<<<<<<< @@ -16953,7 +16987,7 @@ static void __pyx_f_5_cdec__compute_sufficient_stats(void *__pyx_v_metric_, std: int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_compute_sufficient_stats", 0); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":166 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":166 * vector[string]* refs, * mteval.SufficientStats* out): * cdef Metric metric = <Metric> metric_ # <<<<<<<<<<<<<< @@ -16963,7 +16997,7 @@ static void __pyx_f_5_cdec__compute_sufficient_stats(void *__pyx_v_metric_, std: __Pyx_INCREF(((PyObject *)((struct __pyx_obj_5_cdec_Metric *)__pyx_v_metric_))); __pyx_v_metric = ((struct __pyx_obj_5_cdec_Metric *)__pyx_v_metric_); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":167 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":167 * mteval.SufficientStats* out): * cdef Metric metric = <Metric> metric_ * cdef list refs_ = [] # <<<<<<<<<<<<<< @@ -16975,7 +17009,7 @@ static void __pyx_f_5_cdec__compute_sufficient_stats(void *__pyx_v_metric_, std: __pyx_v_refs_ = __pyx_t_1; __pyx_t_1 = 0; - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":169 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":169 * cdef list refs_ = [] * cdef unsigned i * for i in range(refs.size()): # <<<<<<<<<<<<<< @@ -16986,7 +17020,7 @@ static void __pyx_f_5_cdec__compute_sufficient_stats(void *__pyx_v_metric_, std: for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":170 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":170 * cdef unsigned i * for i in range(refs.size()): * refs_.append(str(refs[0][i].c_str())) # <<<<<<<<<<<<<< @@ -17007,7 +17041,7 @@ static void __pyx_f_5_cdec__compute_sufficient_stats(void *__pyx_v_metric_, std: __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":171 + /* "/Users/vchahun/Sandbox/cdec/python/src/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_) # <<<<<<<<<<<<<< @@ -17042,7 +17076,7 @@ static void __pyx_f_5_cdec__compute_sufficient_stats(void *__pyx_v_metric_, std: __pyx_v_ss = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":172 + /* "/Users/vchahun/Sandbox/cdec/python/src/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)) # <<<<<<<<<<<<<< @@ -17056,7 +17090,7 @@ static void __pyx_f_5_cdec__compute_sufficient_stats(void *__pyx_v_metric_, std: __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/vchahune/tools/cdec/python/src/mteval.pxi":173 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":173 * cdef list ss = metric.evaluate(str(hyp.c_str()), refs_) * out.fields.resize(len(ss)) * for i in range(len(ss)): # <<<<<<<<<<<<<< @@ -17071,7 +17105,7 @@ static void __pyx_f_5_cdec__compute_sufficient_stats(void *__pyx_v_metric_, std: for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_7; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":174 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":174 * out.fields.resize(len(ss)) * for i in range(len(ss)): * out.fields[i] = ss[i] # <<<<<<<<<<<<<< @@ -17116,7 +17150,7 @@ static int __pyx_pw_5_cdec_6Metric_1__cinit__(PyObject *__pyx_v_self, PyObject * return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":178 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":178 * cdef class Metric: * cdef Scorer scorer * def __cinit__(self): # <<<<<<<<<<<<<< @@ -17137,7 +17171,7 @@ static int __pyx_pf_5_cdec_6Metric___cinit__(struct __pyx_obj_5_cdec_Metric *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":179 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":179 * cdef Scorer scorer * def __cinit__(self): * self.scorer = Scorer() # <<<<<<<<<<<<<< @@ -17152,7 +17186,7 @@ static int __pyx_pf_5_cdec_6Metric___cinit__(struct __pyx_obj_5_cdec_Metric *__p __pyx_v_self->scorer = ((struct __pyx_obj_5_cdec_Scorer *)__pyx_t_1); __pyx_t_1 = 0; - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":180 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":180 * def __cinit__(self): * self.scorer = Scorer() * cdef bytes class_name = self.__class__.__name__ # <<<<<<<<<<<<<< @@ -17168,7 +17202,7 @@ static int __pyx_pf_5_cdec_6Metric___cinit__(struct __pyx_obj_5_cdec_Metric *__p __pyx_v_class_name = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":181 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":181 * self.scorer = Scorer() * cdef bytes class_name = self.__class__.__name__ * self.scorer.name = new string(class_name) # <<<<<<<<<<<<<< @@ -17179,7 +17213,7 @@ static int __pyx_pf_5_cdec_6Metric___cinit__(struct __pyx_obj_5_cdec_Metric *__p try {__pyx_t_4 = new std::string(__pyx_t_3);} catch(...) {__Pyx_CppExn2PyErr(); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}} __pyx_v_self->scorer->name = __pyx_t_4; - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":182 + /* "/Users/vchahun/Sandbox/cdec/python/src/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], # <<<<<<<<<<<<<< @@ -17248,7 +17282,7 @@ static PyObject *__pyx_pw_5_cdec_6Metric_3__call__(PyObject *__pyx_v_self, PyObj return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":185 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":185 * <void*> self, _compute_sufficient_stats, _compute_score) * * def __call__(self, refs): # <<<<<<<<<<<<<< @@ -17266,7 +17300,7 @@ static PyObject *__pyx_pf_5_cdec_6Metric_2__call__(struct __pyx_obj_5_cdec_Metri int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__call__", 0); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":186 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":186 * * def __call__(self, refs): * return self.scorer(refs) # <<<<<<<<<<<<<< @@ -17310,7 +17344,7 @@ static PyObject *__pyx_pw_5_cdec_6Metric_5score(PyObject *__pyx_v_stats, CYTHON_ return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":188 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":188 * return self.scorer(refs) * * def score(SufficientStats stats): # <<<<<<<<<<<<<< @@ -17323,7 +17357,7 @@ static PyObject *__pyx_pf_5_cdec_6Metric_4score(CYTHON_UNUSED struct __pyx_obj_5 __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("score", 0); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":189 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":189 * * def score(SufficientStats stats): * return 0 # <<<<<<<<<<<<<< @@ -17398,7 +17432,7 @@ static PyObject *__pyx_pw_5_cdec_6Metric_7evaluate(PyObject *__pyx_v_self, PyObj return __pyx_r; } -/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":191 +/* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":191 * return 0 * * def evaluate(self, hyp, refs): # <<<<<<<<<<<<<< @@ -17415,7 +17449,7 @@ static PyObject *__pyx_pf_5_cdec_6Metric_6evaluate(CYTHON_UNUSED struct __pyx_ob int __pyx_clineno = 0; __Pyx_RefNannySetupContext("evaluate", 0); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":192 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":192 * * def evaluate(self, hyp, refs): * return [] # <<<<<<<<<<<<<< @@ -28849,7 +28883,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_n_s__utf8)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_2)); - /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":95 + /* "/Users/vchahun/Sandbox/cdec/python/src/vectors.pxi":95 * elif op == 3: # != * return not (x == y) * raise NotImplemented('comparison not implemented for SparseVector') # <<<<<<<<<<<<<< @@ -28863,7 +28897,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_4)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_5)); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":6 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":6 * * def _phrase(phrase): * return ' '.join(w.encode('utf8') if isinstance(w, unicode) else str(w) for w in phrase) # <<<<<<<<<<<<<< @@ -28877,7 +28911,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_n_s__utf8)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_6)); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":226 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":226 * trule = convert_rule(trule) * elif not isinstance(trule, TRule): * raise ValueError('the grammar should contain TRule objects') # <<<<<<<<<<<<<< @@ -28890,7 +28924,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_13)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_14)); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":244 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":244 * elif op == 3: # != * return not (x == y) * raise NotImplemented('comparison not implemented for HypergraphEdge') # <<<<<<<<<<<<<< @@ -28904,7 +28938,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_18)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_19)); - /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":281 + /* "/Users/vchahun/Sandbox/cdec/python/src/hypergraph.pxi":281 * elif op == 3: # != * return not (x == y) * raise NotImplemented('comparison not implemented for HypergraphNode') # <<<<<<<<<<<<<< @@ -28916,7 +28950,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_20)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_21)); - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":26 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":26 * def __getitem__(self, int index): * if not 0 <= index < len(self): * raise IndexError('lattice index out of range') # <<<<<<<<<<<<<< @@ -28930,7 +28964,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_23)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_24)); - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":39 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":39 * def __setitem__(self, int index, tuple arcs): * if not 0 <= index < len(self): * raise IndexError('lattice index out of range') # <<<<<<<<<<<<<< @@ -28944,7 +28978,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_23)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_25)); - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":69 + /* "/Users/vchahun/Sandbox/cdec/python/src/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('"', '\\"')) # <<<<<<<<<<<<<< @@ -28961,7 +28995,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_31)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_32)); - /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":63 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":63 * def todot(self): * """lattice.todot() -> Representation of the lattice in GraphViz dot format.""" * def lines(): # <<<<<<<<<<<<<< @@ -28985,7 +29019,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/vchahune/tools/cdec/python/src/lattice.pxi":72 + /* "/Users/vchahun/Sandbox/cdec/python/src/lattice.pxi":72 * yield '%d [shape=doublecircle]' % len(self) * yield '}' * return '\n'.join(lines()).encode('utf8') # <<<<<<<<<<<<<< @@ -28999,7 +29033,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_n_s__utf8)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_39)); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":50 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":50 * def __getitem__(self, int index): * if not 0 <= index < len(self): * raise IndexError('sufficient stats vector index out of range') # <<<<<<<<<<<<<< @@ -29013,7 +29047,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_40)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_41)); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":84 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":84 * def __getitem__(self,int k): * if not 0 <= k < self.cs.size(): * raise IndexError('candidate set index out of range') # <<<<<<<<<<<<<< @@ -29078,7 +29112,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(Py_None); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_51)); - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":5 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":5 * import cdec.sa._sa as _sa * * def _phrase(phrase): # <<<<<<<<<<<<<< @@ -29099,7 +29133,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_55)); __pyx_k_codeobj_56 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_57, __pyx_n_s___phrase, 5, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_56)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":194 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":194 * return [] * * BLEU = Scorer('IBM_BLEU') # <<<<<<<<<<<<<< @@ -29113,7 +29147,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_n_s__IBM_BLEU)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_58)); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":195 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":195 * * BLEU = Scorer('IBM_BLEU') * TER = Scorer('TER') # <<<<<<<<<<<<<< @@ -29126,7 +29160,7 @@ static int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(((PyObject *)__pyx_n_s__TER)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_59)); - /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":196 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":196 * BLEU = Scorer('IBM_BLEU') * TER = Scorer('TER') * CER = Scorer('CER') # <<<<<<<<<<<<<< @@ -29473,14 +29507,16 @@ PyMODINIT_FUNC PyInit__cdec(void) if (PyType_Ready(&__pyx_type_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_5_cdec___pyx_scope_struct_25_genexpr = &__pyx_type_5_cdec___pyx_scope_struct_25_genexpr; /*--- Type import code ---*/ - __pyx_ptype_4cdec_2sa_3_sa_FloatList = __Pyx_ImportType("cdec.sa._sa", "FloatList", sizeof(struct __pyx_obj_4cdec_2sa_3_sa_FloatList), 1); if (unlikely(!__pyx_ptype_4cdec_2sa_3_sa_FloatList)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_vtabptr_4cdec_2sa_3_sa_FloatList = (struct __pyx_vtabstruct_4cdec_2sa_3_sa_FloatList*)__Pyx_GetVtable(__pyx_ptype_4cdec_2sa_3_sa_FloatList->tp_dict); if (unlikely(!__pyx_vtabptr_4cdec_2sa_3_sa_FloatList)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa_IntList = __Pyx_ImportType("cdec.sa._sa", "IntList", sizeof(struct __pyx_obj_4cdec_2sa_3_sa_IntList), 1); if (unlikely(!__pyx_ptype_4cdec_2sa_3_sa_IntList)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_vtabptr_4cdec_2sa_3_sa_IntList = (struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList*)__Pyx_GetVtable(__pyx_ptype_4cdec_2sa_3_sa_IntList->tp_dict); if (unlikely(!__pyx_vtabptr_4cdec_2sa_3_sa_IntList)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa_FeatureVector = __Pyx_ImportType("cdec.sa._sa", "FeatureVector", sizeof(struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector), 1); if (unlikely(!__pyx_ptype_4cdec_2sa_3_sa_FeatureVector)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa_Phrase = __Pyx_ImportType("cdec.sa._sa", "Phrase", sizeof(struct __pyx_obj_4cdec_2sa_3_sa_Phrase), 1); if (unlikely(!__pyx_ptype_4cdec_2sa_3_sa_Phrase)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_vtabptr_4cdec_2sa_3_sa_Phrase = (struct __pyx_vtabstruct_4cdec_2sa_3_sa_Phrase*)__Pyx_GetVtable(__pyx_ptype_4cdec_2sa_3_sa_Phrase->tp_dict); if (unlikely(!__pyx_vtabptr_4cdec_2sa_3_sa_Phrase)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_ptype_4cdec_2sa_3_sa_Rule = __Pyx_ImportType("cdec.sa._sa", "Rule", sizeof(struct __pyx_obj_4cdec_2sa_3_sa_Rule), 1); if (unlikely(!__pyx_ptype_4cdec_2sa_3_sa_Rule)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_4cdec_2sa_3_sa_MemoryMap = __Pyx_ImportType("cdec.sa._sa", "MemoryMap", sizeof(struct __pyx_obj_4cdec_2sa_3_sa_MemoryMap), 1); if (unlikely(!__pyx_ptype_4cdec_2sa_3_sa_MemoryMap)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_vtabptr_4cdec_2sa_3_sa_MemoryMap = (struct __pyx_vtabstruct_4cdec_2sa_3_sa_MemoryMap*)__Pyx_GetVtable(__pyx_ptype_4cdec_2sa_3_sa_MemoryMap->tp_dict); if (unlikely(!__pyx_vtabptr_4cdec_2sa_3_sa_MemoryMap)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_4cdec_2sa_3_sa_FloatList = __Pyx_ImportType("cdec.sa._sa", "FloatList", sizeof(struct __pyx_obj_4cdec_2sa_3_sa_FloatList), 1); if (unlikely(!__pyx_ptype_4cdec_2sa_3_sa_FloatList)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_vtabptr_4cdec_2sa_3_sa_FloatList = (struct __pyx_vtabstruct_4cdec_2sa_3_sa_FloatList*)__Pyx_GetVtable(__pyx_ptype_4cdec_2sa_3_sa_FloatList->tp_dict); if (unlikely(!__pyx_vtabptr_4cdec_2sa_3_sa_FloatList)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_4cdec_2sa_3_sa_IntList = __Pyx_ImportType("cdec.sa._sa", "IntList", sizeof(struct __pyx_obj_4cdec_2sa_3_sa_IntList), 1); if (unlikely(!__pyx_ptype_4cdec_2sa_3_sa_IntList)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_vtabptr_4cdec_2sa_3_sa_IntList = (struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList*)__Pyx_GetVtable(__pyx_ptype_4cdec_2sa_3_sa_IntList->tp_dict); if (unlikely(!__pyx_vtabptr_4cdec_2sa_3_sa_IntList)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_4cdec_2sa_3_sa_FeatureVector = __Pyx_ImportType("cdec.sa._sa", "FeatureVector", sizeof(struct __pyx_obj_4cdec_2sa_3_sa_FeatureVector), 1); if (unlikely(!__pyx_ptype_4cdec_2sa_3_sa_FeatureVector)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_4cdec_2sa_3_sa_Phrase = __Pyx_ImportType("cdec.sa._sa", "Phrase", sizeof(struct __pyx_obj_4cdec_2sa_3_sa_Phrase), 1); if (unlikely(!__pyx_ptype_4cdec_2sa_3_sa_Phrase)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_vtabptr_4cdec_2sa_3_sa_Phrase = (struct __pyx_vtabstruct_4cdec_2sa_3_sa_Phrase*)__Pyx_GetVtable(__pyx_ptype_4cdec_2sa_3_sa_Phrase->tp_dict); if (unlikely(!__pyx_vtabptr_4cdec_2sa_3_sa_Phrase)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_ptype_4cdec_2sa_3_sa_Rule = __Pyx_ImportType("cdec.sa._sa", "Rule", sizeof(struct __pyx_obj_4cdec_2sa_3_sa_Rule), 1); if (unlikely(!__pyx_ptype_4cdec_2sa_3_sa_Rule)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Variable import code ---*/ /*--- Function import code ---*/ __pyx_t_1 = __Pyx_ImportModule("cdec.sa._sa"); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -29491,7 +29527,7 @@ PyMODINIT_FUNC PyInit__cdec(void) Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Execution code ---*/ - /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":3 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":3 * cimport grammar * cimport cdec.sa._sa as _sa * import cdec.sa._sa as _sa # <<<<<<<<<<<<<< @@ -29509,7 +29545,7 @@ PyMODINIT_FUNC PyInit__cdec(void) if (PyObject_SetAttr(__pyx_m, __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/vchahune/tools/cdec/python/src/grammar.pxi":5 + /* "/Users/vchahun/Sandbox/cdec/python/src/grammar.pxi":5 * import cdec.sa._sa as _sa * * def _phrase(phrase): # <<<<<<<<<<<<<< @@ -29521,7 +29557,7 @@ PyMODINIT_FUNC PyInit__cdec(void) if (PyObject_SetAttr(__pyx_m, __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/vchahune/tools/cdec/python/src/mteval.pxi":194 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":194 * return [] * * BLEU = Scorer('IBM_BLEU') # <<<<<<<<<<<<<< @@ -29533,7 +29569,7 @@ PyMODINIT_FUNC PyInit__cdec(void) if (PyObject_SetAttr(__pyx_m, __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/vchahune/tools/cdec/python/src/mteval.pxi":195 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":195 * * BLEU = Scorer('IBM_BLEU') * TER = Scorer('TER') # <<<<<<<<<<<<<< @@ -29544,7 +29580,7 @@ PyMODINIT_FUNC PyInit__cdec(void) if (PyObject_SetAttr(__pyx_m, __pyx_n_s__TER, __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/vchahune/tools/cdec/python/src/mteval.pxi":196 + /* "/Users/vchahun/Sandbox/cdec/python/src/mteval.pxi":196 * BLEU = Scorer('IBM_BLEU') * TER = Scorer('TER') * CER = Scorer('CER') # <<<<<<<<<<<<<< |