mirror of https://github.com/explosion/spaCy.git
63b7accd74
Initially span.as_doc() was designed to return a view of the span's contents, as a Doc object. This was a nice idea, but it fails due to the token.idx property, which refers to the character offset within the string. In a span, the idx of the first token might not be 0. Because this data is different, we can't have a view --- it'll be inconsistent. This patch changes span.as_doc() to instead return a copy. The docs are updated accordingly. Closes #1537 * Update test for span.as_doc() * Make span.as_doc() return a copy. Closes #1537 * Document change to Span.as_doc() |
||
---|---|---|
.. | ||
_annotation | ||
_cython | ||
_top-level | ||
_data.json | ||
annotation.jade | ||
cli.jade | ||
cython-classes.jade | ||
cython-structs.jade | ||
cython.jade | ||
dependencyparser.jade | ||
doc.jade | ||
entityrecognizer.jade | ||
goldcorpus.jade | ||
goldparse.jade | ||
index.jade | ||
language.jade | ||
lemmatizer.jade | ||
lexeme.jade | ||
matcher.jade | ||
phrasematcher.jade | ||
pipe.jade | ||
span.jade | ||
stringstore.jade | ||
tagger.jade | ||
textcategorizer.jade | ||
token.jade | ||
tokenizer.jade | ||
top-level.jade | ||
vectors.jade | ||
vocab.jade |