From 7d432b7e391e508fab9d376d9920108c8b044ac9 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Fri, 30 Jan 2015 16:45:45 +1100 Subject: [PATCH] * Add tests for vector-space model --- tests/test_vec.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/test_vec.py diff --git a/tests/test_vec.py b/tests/test_vec.py new file mode 100644 index 000000000..be214f379 --- /dev/null +++ b/tests/test_vec.py @@ -0,0 +1,19 @@ +from __future__ import unicode_literals + +from spacy.en import English + +import pytest + +@pytest.fixture +def EN(): + return English() + +def test_vec(EN): + hype = EN.vocab['hype'] + assert hype.orth_ == 'hype' + assert 0.08 >= hype.repvec[0] > 0.07 + +def test_capitalized(EN): + hype = EN.vocab['Hype'] + assert hype.orth_ == 'Hype' + assert 0.08 >= hype.repvec[0] > 0.07