bugfix: iterators now reset properly when called a second time

This commit is contained in:
Wolfgang Seeker 2016-04-15 17:49:16 +02:00
parent e6945c4d0e
commit b98cc3266d
1 changed files with 9 additions and 1 deletions

View File

@ -28,6 +28,10 @@ cdef class EnglishNounChunks(DocIterator):
self._conjunct = self._doc.vocab.strings['conj']
self.i = 0
def __iter__(self):
self.i = 0
return super(EnglishNounChunks,self).__iter__()
def __next__(self):
cdef const TokenC* word
cdef widx
@ -63,6 +67,10 @@ cdef class GermanNounChunks(DocIterator):
self._close_app = self._doc.vocab.strings['nk']
self.i = 0
def __iter__(self):
self.i = 0
return super(GermanNounChunks,self).__iter__()
def __next__(self):
cdef const TokenC* word
cdef int rbracket