mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
Implement Span.n_lefts and Span.n_rights
This commit is contained in:
parent
c047498f87
commit
301fb2bb60
|
@ -474,17 +474,15 @@ cdef class Span:
|
|||
"""RETURNS (int): The number of leftward immediate children of the
|
||||
span, in the syntactic dependency parse.
|
||||
"""
|
||||
# TODO: implement
|
||||
def __get__(self):
|
||||
raise NotImplementedError
|
||||
return len(list(self.lefts))
|
||||
|
||||
property n_rights:
|
||||
"""RETURNS (int): The number of rightward immediate children of the
|
||||
span, in the syntactic dependency parse.
|
||||
"""
|
||||
# TODO: implement
|
||||
def __get__(self):
|
||||
raise NotImplementedError
|
||||
return len(list(self.rights))
|
||||
|
||||
property subtree:
|
||||
"""Tokens that descend from tokens in the span, but fall outside it.
|
||||
|
|
Loading…
Reference in New Issue
Block a user