mirror of https://github.com/explosion/spaCy.git
* Adjust conjuncts iterator in Token
This commit is contained in:
parent
36517516ef
commit
f7dd377575
|
@ -253,14 +253,11 @@ 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
|
||||||
conjuncts = []
|
|
||||||
if self.dep_ != 'conj':
|
if self.dep_ != 'conj':
|
||||||
for word in self.rights:
|
for word in self.rights:
|
||||||
if word.dep_ == 'conj':
|
if word.dep_ == 'conj':
|
||||||
yield word
|
yield word
|
||||||
yield from word.conjuncts
|
yield from word.conjuncts
|
||||||
conjuncts.append(word)
|
|
||||||
conjuncts.extend(word.conjuncts)
|
|
||||||
|
|
||||||
property ent_type:
|
property ent_type:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
|
|
Loading…
Reference in New Issue