mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-11 04:08:09 +03:00
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() |
||
---|---|---|
.. | ||
__init__.py | ||
test_add_entities.py | ||
test_array.py | ||
test_creation.py | ||
test_doc_api.py | ||
test_pickle_doc.py | ||
test_span_merge.py | ||
test_span.py | ||
test_to_json.py | ||
test_token_api.py | ||
test_underscore.py |