2017-01-12 14:09:49 +00:00
|
|
|
# coding: utf-8
|
|
|
|
from __future__ import unicode_literals
|
2016-10-21 15:07:21 +00:00
|
|
|
|
2017-01-12 14:09:49 +00:00
|
|
|
import numpy
|
|
|
|
import pytest
|
2016-10-21 15:07:21 +00:00
|
|
|
|
|
|
|
|
2017-01-12 14:09:49 +00: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 15:07:21 +00:00
|
|
|
lex.vector = numpy.ndarray((10,), dtype='float32')
|
2017-01-12 14:09:49 +00:00
|
|
|
lex = en_vocab[text]
|
2016-10-21 15:07:21 +00:00
|
|
|
assert lex.vector.shape == (10,)
|