mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-11-04 09:57:26 +03:00 
			
		
		
		
	* Add __iter__ method to tokens
This commit is contained in:
		
							parent
							
								
									f07457a91f
								
							
						
					
					
						commit
						954c970415
					
				| 
						 | 
				
			
			@ -59,6 +59,10 @@ cdef class Tokens:
 | 
			
		|||
        bounds_check(i, self.length, PADDING)
 | 
			
		||||
        return Token(self._string_store, i, self.idx[i], self.pos[i], self.lex[i][0])
 | 
			
		||||
 | 
			
		||||
    def __iter__(self):
 | 
			
		||||
        for i in range(self.length):
 | 
			
		||||
            yield self[i]
 | 
			
		||||
 | 
			
		||||
    def __len__(self):
 | 
			
		||||
        return self.length
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user