mirror of https://github.com/explosion/spaCy.git
* Fix token.conjuncts method
This commit is contained in:
parent
b4cac52f7f
commit
23818f89b8
|
@ -248,12 +248,12 @@ cdef class Token:
|
||||||
|
|
||||||
property conjuncts:
|
property conjuncts:
|
||||||
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 = []
|
||||||
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 reversed(list(self.lefts)):
|
for word in self.rights:
|
||||||
if word.c.pos == CONJ:
|
if word.c.pos == CONJ:
|
||||||
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:
|
||||||
|
|
Loading…
Reference in New Issue