* Test token properties

This commit is contained in:
Matthew Honnibal 2015-07-26 16:37:39 +02:00
parent 6bb96c122d
commit 48a4d15264

View File

@ -32,6 +32,18 @@ def test_flags(EN):
def test_single_token_string(EN): def test_single_token_string(EN):
tokens = EN(u'foobar') tokens = EN(u'foobar')
assert tokens[0].string == 'foobar' assert tokens[0].string == 'foobar'
def test_is_properties(EN):
Hi, comma, my, email, is_, addr = EN(u'Hi, my email is test@me.com')
assert Hi.is_title
assert Hi.is_alpha
assert not Hi.is_digit
assert comma.is_punct
assert email.is_ascii
assert not email.like_url
assert is_.is_lower
assert addr.like_email