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