diff --git a/spacy/tests/parser/test_space_attachment.py b/spacy/tests/parser/test_space_attachment.py index 114d324fd..d1e520a0f 100644 --- a/spacy/tests/parser/test_space_attachment.py +++ b/spacy/tests/parser/test_space_attachment.py @@ -1,6 +1,9 @@ from __future__ import unicode_literals import pytest +import numpy +from spacy.attrs import HEAD + @pytest.mark.models def test_space_attachment(EN): @@ -10,3 +13,15 @@ def test_space_attachment(EN): for sent in doc.sents: if len(sent) == 1: assert not sent[-1].is_space + + +@pytest.mark.xfail +def test_sentence_space(EN): + text = ('''I look forward to using Thingamajig. I've been told it will ''' + '''make my life easier...''') + doc = EN(text) + doc.from_array([HEAD], numpy.asarray([[1, 0, -1, -2, -1, -1, -5, + 4, 3, 2, 1, 0, 2, 1, -3, 1, 1, -3, -7]], + dtype='int32').T) + assert len(list(doc.sents)) == 2 +