summaryrefslogtreecommitdiff
path: root/python/src/lattice.pxi
diff options
context:
space:
mode:
authorVictor Chahuneau <vchahune@cs.cmu.edu>2012-07-27 22:25:15 -0400
committerVictor Chahuneau <vchahune@cs.cmu.edu>2012-07-27 22:25:15 -0400
commit1d481414a2fa8505a2591c88e2b7b8f86a682ca2 (patch)
treeed5e9dff569d89da453578ce3d109991623d9303 /python/src/lattice.pxi
parentb317e0efd2398d75d70e027bb1e2cf442e683981 (diff)
[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
Diffstat (limited to 'python/src/lattice.pxi')
-rw-r--r--python/src/lattice.pxi6
1 files changed, 3 insertions, 3 deletions
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(<char *>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 {'