From 1d481414a2fa8505a2591c88e2b7b8f86a682ca2 Mon Sep 17 00:00:00 2001 From: Victor Chahuneau Date: Fri, 27 Jul 2012 22:25:15 -0400 Subject: [python] conversion from cdec.sa.Rule to cdec.TRule + remove configobj dependency + re-structure packages (no more top-level library) + "const" stuff + use __new__ instead of constructor for some objects --- python/src/lattice.pxi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'python/src/lattice.pxi') diff --git a/python/src/lattice.pxi b/python/src/lattice.pxi index 08405188..14864549 100644 --- a/python/src/lattice.pxi +++ b/python/src/lattice.pxi @@ -16,6 +16,9 @@ cdef class Lattice: self.lattice = new lattice.Lattice() lattice.ConvertTextToLattice(string(inp), self.lattice) + def __dealloc__(self): + del self.lattice + def __getitem__(self, int index): if not 0 <= index < len(self): raise IndexError('lattice index out of range') @@ -51,9 +54,6 @@ cdef class Lattice: for i in range(len(self)): yield self[i] - def __dealloc__(self): - del self.lattice - def todot(self): def lines(): yield 'digraph lattice {' -- cgit v1.2.3