From ac9e3a4a8beec9bfa849aa2c0d64788e58e9999f Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sun, 30 Dec 2018 13:15:54 +0100 Subject: [PATCH] Add test for #1773 --- spacy/tests/regression/test_issue1773.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 spacy/tests/regression/test_issue1773.py diff --git a/spacy/tests/regression/test_issue1773.py b/spacy/tests/regression/test_issue1773.py new file mode 100644 index 000000000..5b4307b44 --- /dev/null +++ b/spacy/tests/regression/test_issue1773.py @@ -0,0 +1,9 @@ +from __future__ import unicode_literals + + +def test_issue1773(en_tokenizer): + """Test that spaces don't receive a POS but no TAG. This is the root cause + of the serialization issue reported in #1773.""" + doc = en_tokenizer('\n') + if doc[0].pos_ == 'SPACE': + assert doc[0].tag_ != ""