From 3d6c79e595a2a03750f7ac198da55dc67ba32f5a Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Wed, 2 Nov 2016 23:40:11 +0100 Subject: [PATCH] Test Issue #599: .is_tagged and .is_parsed attributes not reflected after deserialization for empty documents. --- spacy/tests/regression/test_issue599.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 spacy/tests/regression/test_issue599.py diff --git a/spacy/tests/regression/test_issue599.py b/spacy/tests/regression/test_issue599.py new file mode 100644 index 000000000..ce35c6db2 --- /dev/null +++ b/spacy/tests/regression/test_issue599.py @@ -0,0 +1,11 @@ +from ...tokens import Doc +from ...vocab import Vocab + +def test_issue599(): + doc = Doc(Vocab()) + doc.is_tagged = True + doc.is_parsed = True + bytes_ = doc.to_bytes() + doc2 = Doc(doc.vocab) + doc2.from_bytes(bytes_) + assert doc2.is_parsed