mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 09:26:27 +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
|
import pytest
|
||||||
|
|
||||||
|
nlp = English()
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def token():
|
def token():
|
||||||
nlp = English()
|
|
||||||
tokens = nlp(u'Give it back! He pleaded.')
|
tokens = nlp(u'Give it back! He pleaded.')
|
||||||
return tokens[0]
|
return tokens[0]
|
||||||
|
|
||||||
|
@ -29,3 +29,11 @@ def test_flags(token):
|
||||||
assert token.check_flag(IS_ALPHA)
|
assert token.check_flag(IS_ALPHA)
|
||||||
assert not token.check_flag(IS_DIGIT)
|
assert not token.check_flag(IS_DIGIT)
|
||||||
# TODO: Test more of these, esp. if a bug is found
|
# 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