diff options
author | Victor Chahuneau <vchahune@cs.cmu.edu> | 2012-07-11 16:08:43 +0900 |
---|---|---|
committer | Victor Chahuneau <vchahune@cs.cmu.edu> | 2012-07-11 16:08:43 +0900 |
commit | 42532406b1246e6f17766b804b8bd5cce828f0fa (patch) | |
tree | b867b7fded89c3de32f0629241a86ea735186884 /python/src/lattice.pxi | |
parent | 757f56e391bd2e1d7442ab38fc98aff00d064d38 (diff) |
[python] Direct hypergraph access
- small API changes (*_trees methods)
- decoder config can now passed as arguments
Diffstat (limited to 'python/src/lattice.pxi')
-rw-r--r-- | python/src/lattice.pxi | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/python/src/lattice.pxi b/python/src/lattice.pxi index f8341e29..c6b29e8b 100644 --- a/python/src/lattice.pxi +++ b/python/src/lattice.pxi @@ -22,12 +22,11 @@ cdef class Lattice: arcs = [] cdef vector[lattice.LatticeArc] arc_vector = self.lattice[0][index] cdef lattice.LatticeArc* arc - cdef str label cdef unsigned i for i in range(arc_vector.size()): arc = &arc_vector[i] - label = TDConvert(arc.label) - arcs.append((label.decode('utf8'), arc.cost, arc.dist2next)) + label = unicode(TDConvert(arc.label), 'utf8') + arcs.append((label, arc.cost, arc.dist2next)) return tuple(arcs) def __setitem__(self, int index, tuple arcs): |