mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-24 17:06:29 +03:00
* Add test for Issue #44
This commit is contained in:
parent
6640386b25
commit
085574ccc1
|
@ -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'
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user