spaCy/tests/tokens/test_vec.py

19 lines
374 B
Python
Raw Normal View History

2015-01-30 08:45:45 +03:00
from __future__ import unicode_literals
from spacy.en import English
import pytest
2015-09-22 03:23:11 +03:00
@pytest.mark.models
2015-01-30 08:45:45 +03:00
def test_vec(EN):
hype = EN.vocab['hype']
assert hype.orth_ == 'hype'
2015-09-22 03:23:11 +03:00
assert 0.08 >= hype.vector[0] > 0.07
2015-01-30 08:45:45 +03:00
2015-04-19 22:39:18 +03:00
2015-09-22 03:23:11 +03:00
@pytest.mark.models
2015-01-30 08:45:45 +03:00
def test_capitalized(EN):
hype = EN.vocab['Hype']
assert hype.orth_ == 'Hype'
2015-09-22 03:23:11 +03:00
assert 0.08 >= hype.vector[0] > 0.07