mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-10-30 23:47:31 +03:00 
			
		
		
		
	* Fix token.conjuncts method
This commit is contained in:
		
							parent
							
								
									23818f89b8
								
							
						
					
					
						commit
						b8f3345a82
					
				|  | @ -250,7 +250,7 @@ cdef class Token: | ||||||
|         def __get__(self): |         def __get__(self): | ||||||
|             """Get a list of conjoined words.""" |             """Get a list of conjoined words.""" | ||||||
|             cdef Token word |             cdef Token word | ||||||
|             conjs = [] |             conjs = [self] | ||||||
|             if self.c.pos != CONJ and self.c.pos != PUNCT: |             if self.c.pos != CONJ and self.c.pos != PUNCT: | ||||||
|                 seen_conj = False |                 seen_conj = False | ||||||
|                 for word in self.rights: |                 for word in self.rights: | ||||||
|  | @ -258,8 +258,6 @@ cdef class Token: | ||||||
|                         seen_conj = True |                         seen_conj = True | ||||||
|                     elif seen_conj and word.c.pos == self.c.pos: |                     elif seen_conj and word.c.pos == self.c.pos: | ||||||
|                         conjs.append(word) |                         conjs.append(word) | ||||||
|             conjs.reverse() |  | ||||||
|             conjs.append(self) |  | ||||||
|             if seen_conj: |             if seen_conj: | ||||||
|                 return conjs |                 return conjs | ||||||
|             elif self is not self.head and self in self.head.conjuncts: |             elif self is not self.head and self in self.head.conjuncts: | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user