2014-07-05 22:51:42 +04:00
|
|
|
from __future__ import unicode_literals
|
2014-12-23 03:40:32 +03:00
|
|
|
import pytest
|
2014-07-05 22:51:42 +04:00
|
|
|
|
2014-12-23 03:40:32 +03:00
|
|
|
from spacy.en import English
|
2014-07-05 22:51:42 +04:00
|
|
|
|
|
|
|
|
2014-12-23 03:40:32 +03:00
|
|
|
@pytest.fixture
|
|
|
|
def EN():
|
|
|
|
return English()
|
2014-07-05 22:51:42 +04:00
|
|
|
|
|
|
|
|
2014-12-23 03:40:32 +03:00
|
|
|
def test_neq(EN):
|
|
|
|
addr = EN.vocab['Hello']
|
2015-01-22 18:08:25 +03:00
|
|
|
assert EN.vocab['bye'].orth != addr.orth
|
2014-07-05 22:51:42 +04:00
|
|
|
|
|
|
|
|
2014-12-23 03:40:32 +03:00
|
|
|
def test_eq(EN):
|
|
|
|
addr = EN.vocab['Hello']
|
2015-01-22 18:08:25 +03:00
|
|
|
assert EN.vocab['Hello'].orth == addr.orth
|
2014-07-05 22:51:42 +04:00
|
|
|
|
|
|
|
|
2014-12-23 03:40:32 +03:00
|
|
|
def test_case_neq(EN):
|
|
|
|
addr = EN.vocab['Hello']
|
2015-01-22 18:08:25 +03:00
|
|
|
assert EN.vocab['hello'].orth != addr.orth
|
2014-12-23 03:40:32 +03:00
|
|
|
|
|
|
|
|
|
|
|
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
|