mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-13 02:36:32 +03:00
Add regression test for #886
This commit is contained in:
parent
13b1e6b3e0
commit
51ba3ef0a8
13
spacy/tests/regression/test_issue886.py
Normal file
13
spacy/tests/regression/test_issue886.py
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
# coding: utf8
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize('text', ["Datum:2014-06-02\nDokument:76467"])
|
||||||
|
def test_issue886(en_tokenizer, text):
|
||||||
|
"""Test that no extra space is added in doc.text method."""
|
||||||
|
doc = en_tokenizer(text)
|
||||||
|
for token in doc:
|
||||||
|
assert len(token.text) == len(token.text_with_ws)
|
||||||
|
assert text[token.idx] == token.text[0]
|
Loading…
Reference in New Issue
Block a user