summaryrefslogtreecommitdiff
path: root/python/src/lattice.pxi
diff options
context:
space:
mode:
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):