Add rokenizer test for zero length string

This commit is contained in:
leofidus 2015-02-07 03:01:44 +01:00 committed by Matthew Honnibal
parent 2a0615104b
commit 363473aeed
1 changed files with 4 additions and 0 deletions

View File

@ -10,6 +10,10 @@ from spacy.en import English
def EN():
return English().tokenizer
def test_no_word(EN):
tokens = EN(u'')
assert len(tokens) == 0
def test_single_word(EN):
tokens = EN(u'hello')
assert tokens[0].orth_ == 'hello'