spaCy/tests/test_vocab.py

35 lines
628 B
Python
Raw Normal View History

from __future__ import unicode_literals
import pytest
from spacy.en import English
@pytest.fixture
def EN():
return English()
def test_neq(EN):
addr = EN.vocab['Hello']
2015-01-22 18:08:25 +03:00
assert EN.vocab['bye'].orth != addr.orth
def test_eq(EN):
addr = EN.vocab['Hello']
2015-01-22 18:08:25 +03:00
assert EN.vocab['Hello'].orth == addr.orth
def test_case_neq(EN):
addr = EN.vocab['Hello']
2015-01-22 18:08:25 +03:00
assert EN.vocab['hello'].orth != addr.orth
def test_punct_neq(EN):
addr = EN.vocab['Hello']
2015-01-22 18:08:25 +03:00
assert EN.vocab['Hello,'].orth != addr.orth
2014-12-26 06:26:27 +03:00
def test_shape_attr(EN):
example = EN.vocab['example']
2015-01-22 18:08:25 +03:00
assert example.orth != example.shape