diff --git a/spacy/tokens/span.pyx b/spacy/tokens/span.pyx index 64e485412..0ddb509c2 100644 --- a/spacy/tokens/span.pyx +++ b/spacy/tokens/span.pyx @@ -491,9 +491,9 @@ cdef class Span: return len(list(self.rights)) property subtree: - """Tokens that descend from tokens in the span, but fall outside it. + """Tokens within the span and tokens which descend from them. - YIELDS (Token): A descendant of a token within the span. + YIELDS (Token): A token within the span, or a descendant from it. """ def __get__(self): for word in self.lefts: diff --git a/spacy/tokens/token.pyx b/spacy/tokens/token.pyx index 381aa2aa8..38a34bbec 100644 --- a/spacy/tokens/token.pyx +++ b/spacy/tokens/token.pyx @@ -451,10 +451,11 @@ cdef class Token: yield from self.rights property subtree: - """A sequence of all the token's syntactic descendents. + """A sequence containing the token and all the token's syntactic + descendants. YIELDS (Token): A descendent token such that - `self.is_ancestor(descendent)`. + `self.is_ancestor(descendent) or token == self`. """ def __get__(self): for word in self.lefts: diff --git a/website/api/span.jade b/website/api/span.jade index e13fa29a5..a8d3a2b00 100644 --- a/website/api/span.jade +++ b/website/api/span.jade @@ -489,7 +489,7 @@ p +tag property +tag-model("parse") -p Tokens that descend from tokens in the span, but fall outside it. +p Tokens within the span and tokens which descend from them. +aside-code("Example"). doc = nlp(u'Give it back! He pleaded.') @@ -500,7 +500,7 @@ p Tokens that descend from tokens in the span, but fall outside it. +row("foot") +cell yields +cell #[code Token] - +cell A descendant of a token within the span. + +cell A token within the span, or a descendant from it. +h(2, "has_vector") Span.has_vector +tag property diff --git a/website/api/token.jade b/website/api/token.jade index 9a9a6dc1d..1303a37ec 100644 --- a/website/api/token.jade +++ b/website/api/token.jade @@ -1,3 +1,4 @@ + //- 💫 DOCS > API > TOKEN include ../_includes/_mixins @@ -405,7 +406,7 @@ p +tag property +tag-model("parse") -p A sequence of all the token's syntactic descendants. +p A sequence containing the token and all the token's syntactic descendants. +aside-code("Example"). doc = nlp(u'Give it back! He pleaded.') @@ -416,7 +417,7 @@ p A sequence of all the token's syntactic descendants. +row("foot") +cell yields +cell #[code Token] - +cell A descendant token such that #[code self.is_ancestor(descendant)]. + +cell A descendant token such that #[code self.is_ancestor(token) or token == self]. +h(2, "is_sent_start") Token.is_sent_start +tag property