mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-12 10:16:27 +03:00
* Add test for how spaces are attached by the parser.
This commit is contained in:
parent
dfbcff2ff1
commit
08e29519a6
12
tests/parser/test_space_attachment.py
Normal file
12
tests/parser/test_space_attachment.py
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
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)
|
||||||
|
|
||||||
|
for word in doc:
|
||||||
|
if word.is_space:
|
||||||
|
assert word.head.i == (word.i - 1)
|
Loading…
Reference in New Issue
Block a user