2014-07-05 18:51:42 +00:00
|
|
|
from __future__ import unicode_literals
|
2014-12-23 00:40:32 +00:00
|
|
|
import pytest
|
2014-07-05 18:51:42 +00:00
|
|
|
|
2014-12-23 00:40:32 +00:00
|
|
|
from spacy.en import English
|
2014-07-05 18:51:42 +00:00
|
|
|
|
|
|
|
|
2014-12-23 00:40:32 +00:00
|
|
|
@pytest.fixture
|
|
|
|
def EN():
|
|
|
|
return English()
|
2014-07-05 18:51:42 +00:00
|
|
|
|
|
|
|
|
2014-12-23 00:40:32 +00:00
|
|
|
def test_neq(EN):
|
|
|
|
addr = EN.vocab['Hello']
|
2015-01-14 13:33:16 +00:00
|
|
|
assert EN.vocab['bye'].sic != addr.sic
|
2014-07-05 18:51:42 +00:00
|
|
|
|
|
|
|
|
2014-12-23 00:40:32 +00:00
|
|
|
def test_eq(EN):
|
|
|
|
addr = EN.vocab['Hello']
|
2015-01-14 13:33:16 +00:00
|
|
|
assert EN.vocab['Hello'].sic == addr.sic
|
2014-07-05 18:51:42 +00:00
|
|
|
|
|
|
|
|
2014-12-23 00:40:32 +00:00
|
|
|
def test_case_neq(EN):
|
|
|
|
addr = EN.vocab['Hello']
|
2015-01-14 13:33:16 +00:00
|
|
|
assert EN.vocab['hello'].sic != addr.sic
|
2014-12-23 00:40:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_punct_neq(EN):
|
|
|
|
addr = EN.vocab['Hello']
|
2015-01-14 13:33:16 +00:00
|
|
|
assert EN.vocab['Hello,'].sic != addr.sic
|
2014-12-26 03:26:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_shape_attr(EN):
|
|
|
|
example = EN.vocab['example']
|
2015-01-14 13:33:16 +00:00
|
|
|
assert example.sic != example.shape
|