spaCy/tests/test_vocab.py

35 lines
673 B
Python
Raw Normal View History

from __future__ import unicode_literals
from spacy.en import EN
def test_neq():
addr = EN.lookup('Hello')
2014-09-10 18:58:30 +00:00
assert EN.lookup('bye').string != addr.string
def test_eq():
addr = EN.lookup('Hello')
2014-09-10 18:58:30 +00:00
assert EN.lookup('Hello').string == addr.string
def test_round_trip():
hello = EN.lookup('Hello')
assert hello.string == 'Hello'
def test_case_neq():
addr = EN.lookup('Hello')
2014-09-10 18:58:30 +00:00
assert EN.lookup('hello').string != addr.string
def test_punct_neq():
addr = EN.lookup('Hello')
2014-09-10 18:58:30 +00:00
assert EN.lookup('Hello,').string != addr.string
def test_short():
addr = EN.lookup('I')
assert addr.string == 'I'
assert addr.string != 'not'