spaCy/tests/vocab/test_vocab.py

28 lines
579 B
Python
Raw Normal View History

from __future__ import unicode_literals
import pytest
def test_neq(en_vocab):
addr = en_vocab['Hello']
assert en_vocab['bye'].orth != addr.orth
def test_eq(en_vocab):
addr = en_vocab['Hello']
assert en_vocab['Hello'].orth == addr.orth
def test_case_neq(en_vocab):
addr = en_vocab['Hello']
assert en_vocab['hello'].orth != addr.orth
def test_punct_neq(en_vocab):
addr = en_vocab['Hello']
assert en_vocab['Hello,'].orth != addr.orth
def test_shape_attr(en_vocab):
example = en_vocab['example']
2015-01-22 18:08:25 +03:00
assert example.orth != example.shape