mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-14 13:47:13 +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
|
"""RETURNS (int): The number of leftward immediate children of the
|
||||||
span, in the syntactic dependency parse.
|
span, in the syntactic dependency parse.
|
||||||
"""
|
"""
|
||||||
# TODO: implement
|
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
raise NotImplementedError
|
return len(list(self.lefts))
|
||||||
|
|
||||||
property n_rights:
|
property n_rights:
|
||||||
"""RETURNS (int): The number of rightward immediate children of the
|
"""RETURNS (int): The number of rightward immediate children of the
|
||||||
span, in the syntactic dependency parse.
|
span, in the syntactic dependency parse.
|
||||||
"""
|
"""
|
||||||
# TODO: implement
|
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
raise NotImplementedError
|
return len(list(self.rights))
|
||||||
|
|
||||||
property subtree:
|
property subtree:
|
||||||
"""Tokens that descend from tokens in the span, but fall outside it.
|
"""Tokens that descend from tokens in the span, but fall outside it.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user