summaryrefslogtreecommitdiff
path: root/python/src/lattice.pxi
diff options
context:
space:
mode:
authorVictor Chahuneau <vchahune@cs.cmu.edu>2012-07-11 16:08:43 +0900
committerVictor Chahuneau <vchahune@cs.cmu.edu>2012-07-11 16:08:43 +0900
commit42532406b1246e6f17766b804b8bd5cce828f0fa (patch)
treeb867b7fded89c3de32f0629241a86ea735186884 /python/src/lattice.pxi
parent757f56e391bd2e1d7442ab38fc98aff00d064d38 (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.pxi5
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):