2017-01-12 17:09:49 +03:00
|
|
|
# coding: utf-8
|
|
|
|
from __future__ import unicode_literals
|
2016-10-21 18:07:21 +03:00
|
|
|
|
2017-01-12 17:09:49 +03:00
|
|
|
import numpy
|
|
|
|
import pytest
|
2016-10-21 18:07:21 +03:00
|
|
|
|
|
|
|
|
2017-05-28 14:03:16 +03:00
|
|
|
@pytest.mark.xfail
|
2017-01-12 17:09:49 +03:00
|
|
|
@pytest.mark.parametrize('text', ["Hello"])
|
|
|
|
def test_vocab_add_vector(en_vocab, text):
|
|
|
|
en_vocab.resize_vectors(10)
|
|
|
|
lex = en_vocab[text]
|
2016-10-21 18:07:21 +03:00
|
|
|
lex.vector = numpy.ndarray((10,), dtype='float32')
|
2017-01-12 17:09:49 +03:00
|
|
|
lex = en_vocab[text]
|
2016-10-21 18:07:21 +03:00
|
|
|
assert lex.vector.shape == (10,)
|