From 085574ccc1b4117b5c39f7d0e9ae735e053945b6 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Tue, 7 Apr 2015 06:05:18 +0200 Subject: [PATCH] * Add test for Issue #44 --- tests/test_token_api.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/test_token_api.py b/tests/test_token_api.py index 6e35701b4..eb7e1013b 100644 --- a/tests/test_token_api.py +++ b/tests/test_token_api.py @@ -6,9 +6,9 @@ from spacy.en.attrs import IS_STOP import pytest +nlp = English() @pytest.fixture def token(): - nlp = English() tokens = nlp(u'Give it back! He pleaded.') return tokens[0] @@ -29,3 +29,11 @@ def test_flags(token): assert token.check_flag(IS_ALPHA) assert not token.check_flag(IS_DIGIT) # TODO: Test more of these, esp. if a bug is found + + +def test_single_token_string(): + nlp = English() + tokens = nlp(u'foobar') + assert tokens[0].string == 'foobar' + +