spaCy/spacy/tests/parser/test_space_attachment.py

13 lines
297 B
Python
Raw Normal View History

from __future__ import unicode_literals
import pytest
@pytest.mark.models
def test_space_attachment(EN):
sentence = 'This is a test.\nTo ensure spaces are attached well.'
doc = EN(sentence)
2015-10-14 19:20:51 +03:00
for sent in doc.sents:
2015-10-14 19:24:57 +03:00
if len(sent) == 1:
assert not sent[-1].is_space