mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-27 18:36:36 +03:00
13 lines
281 B
Python
13 lines
281 B
Python
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,)
|