diff --git a/spacy/tests/vocab/test_add_vectors.py b/spacy/tests/vocab/test_add_vectors.py new file mode 100644 index 000000000..b2bd812cf --- /dev/null +++ b/spacy/tests/vocab/test_add_vectors.py @@ -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,)