summaryrefslogtreecommitdiff
path: root/python/src/lattice.pxi
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2012-07-28 12:11:44 -0400
committerChris Dyer <cdyer@cs.cmu.edu>2012-07-28 12:11:44 -0400
commit306e0ba4754c6c4f460536cfe8c3f118dc1cc175 (patch)
treead5ea3b0a5370ac613d1bad715fe0f5ab8c91c11 /python/src/lattice.pxi
parent934e55dc12c3f374684bc6a0797e6f85c7abb85a (diff)
parentee5e376e263d9aeabdeee6968b4457f53d3fc772 (diff)
Merge branch 'master' of github.com:redpony/cdec
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 {'