From 478a79a3d5e92e83e90380e90027a656bd75d0a1 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Fri, 15 Jan 2016 16:17:07 +0100 Subject: [PATCH] * Add test for Issue #220: Whitespace being tagged as noun --- spacy/tests/tagger/test_spaces.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spacy/tests/tagger/test_spaces.py b/spacy/tests/tagger/test_spaces.py index 0ef05637b..87b67d1b8 100644 --- a/spacy/tests/tagger/test_spaces.py +++ b/spacy/tests/tagger/test_spaces.py @@ -25,3 +25,16 @@ def test_spaces(tagged): assert tagged[3].pos != SPACE assert tagged[4].pos == SPACE + +@pytest.mark.xfail +@pytest.mark.models +def test_return_char(EN): + string = ('hi Aaron,\r\n\r\nHow is your schedule today, I was wondering if ' + 'you had time for a phone\r\ncall this afternoon?\r\n\r\n\r\n') + tokens = EN(string) + for token in tokens: + if token.is_space: + assert token.pos == SPACE + assert tokens[3] == '\r\n\r\n' + assert tokens[3].is_space + assert tokens[3].pos == SPACE