2014-07-05 18:51:42 +00:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
2014-08-30 18:36:06 +00:00
|
|
|
from spacy.en import EN
|
2014-07-05 18:51:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_neq():
|
2014-08-30 18:36:06 +00:00
|
|
|
addr = EN.lookup('Hello')
|
2014-09-10 18:58:30 +00:00
|
|
|
assert EN.lookup('bye').string != addr.string
|
2014-07-05 18:51:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_eq():
|
2014-08-30 18:36:06 +00:00
|
|
|
addr = EN.lookup('Hello')
|
2014-09-10 18:58:30 +00:00
|
|
|
assert EN.lookup('Hello').string == addr.string
|
2014-07-05 18:51:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_round_trip():
|
2014-08-30 18:36:06 +00:00
|
|
|
hello = EN.lookup('Hello')
|
|
|
|
assert hello.string == 'Hello'
|
2014-07-05 18:51:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_case_neq():
|
2014-08-30 18:36:06 +00:00
|
|
|
addr = EN.lookup('Hello')
|
2014-09-10 18:58:30 +00:00
|
|
|
assert EN.lookup('hello').string != addr.string
|
2014-07-05 18:51:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_punct_neq():
|
2014-08-30 18:36:06 +00:00
|
|
|
addr = EN.lookup('Hello')
|
2014-09-10 18:58:30 +00:00
|
|
|
assert EN.lookup('Hello,').string != addr.string
|
2014-07-06 22:02:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_short():
|
2014-08-30 18:36:06 +00:00
|
|
|
addr = EN.lookup('I')
|
|
|
|
assert addr.string == 'I'
|
|
|
|
assert addr.string != 'not'
|