Add test for vector resizing, re Issue #544

This commit is contained in:
Matthew Honnibal 2016-10-21 17:07:21 +02:00
parent 016cd5ab01
commit e7af75e0a9

View File

@ -0,0 +1,12 @@
import numpy
import spacy.en
def test_add_vector():
vocab = spacy.en.English.Defaults.create_vocab()
vocab.resize_vectors(10)
lex = vocab[u'Hello']
lex.vector = numpy.ndarray((10,), dtype='float32')
lex = vocab[u'Hello']
assert lex.vector.shape == (10,)