mirror of
https://github.com/explosion/spaCy.git
synced 2025-02-04 21:50:35 +03:00
* Add left_edge and right_edge properties
This commit is contained in:
parent
bdb56497b5
commit
d48218f4b2
|
@ -533,6 +533,18 @@ cdef class Token:
|
||||||
for word in self.rights:
|
for word in self.rights:
|
||||||
yield from word.subtree
|
yield from word.subtree
|
||||||
|
|
||||||
|
property left_edge:
|
||||||
|
def __get__(self):
|
||||||
|
return Token.cinit(self.vocab, self._string,
|
||||||
|
self.c + self.c.l_edge, self.i + self.c.l_edge,
|
||||||
|
self.array_len, self._seq)
|
||||||
|
|
||||||
|
property right_edge:
|
||||||
|
def __get__(self):
|
||||||
|
return Token.cinit(self.vocab, self._string,
|
||||||
|
self.c + self.c.r_edge, self.i + self.c.r_edge,
|
||||||
|
self.array_len, self._seq)
|
||||||
|
|
||||||
property head:
|
property head:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
"""The token predicted by the parser to be the head of the current token."""
|
"""The token predicted by the parser to be the head of the current token."""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user