summaryrefslogtreecommitdiff
path: root/python/src/sa/int_list.pxi
diff options
context:
space:
mode:
authorVictor Chahuneau <vchahune@cs.cmu.edu>2012-08-14 22:50:37 -0400
committerVictor Chahuneau <vchahune@cs.cmu.edu>2012-08-14 22:50:37 -0400
commita68aaea190197f17f308b91f66ceff222a784460 (patch)
tree214e557c94f255e88b19803cb3b5343983613a60 /python/src/sa/int_list.pxi
parent2d921d0cb937c3a2fa1bf8f4aa37be762227be63 (diff)
[cdec.sa] Explicit feature names in grammar extractor output
+ sparse features in extractor + hg.intersect(string) + basestring = str|unicode
Diffstat (limited to 'python/src/sa/int_list.pxi')
-rw-r--r--python/src/sa/int_list.pxi9
1 files changed, 5 insertions, 4 deletions
diff --git a/python/src/sa/int_list.pxi b/python/src/sa/int_list.pxi
index ad14bc9c..63c0fe67 100644
--- a/python/src/sa/int_list.pxi
+++ b/python/src/sa/int_list.pxi
@@ -7,10 +7,6 @@ from libc.stdlib cimport malloc, realloc, free
from libc.string cimport memset, memcpy
cdef class IntList:
- cdef int size
- cdef int increment
- cdef int len
- cdef int* arr
def __cinit__(self, int size=0, int increment=1, int initial_len=0):
if initial_len > size:
@@ -82,6 +78,11 @@ cdef class IntList:
def __dealloc__(self):
free(self.arr)
+ def __iter__(self):
+ cdef int i
+ for i in range(self.len):
+ yield self.arr[i]
+
def __getitem__(self, index):
cdef int i, j, k
if isinstance(index, int):