* Fix token.conjuncts method

This commit is contained in:
Matthew Honnibal 2015-10-15 03:36:01 +11:00
parent 23818f89b8
commit b8f3345a82

View File

@ -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: