mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-15 06:09:01 +03:00
15 lines
322 B
Python
15 lines
322 B
Python
'''Test vocab.set_vector also adds the word to the vocab.'''
|
|
from __future__ import unicode_literals
|
|
from ...vocab import Vocab
|
|
|
|
import numpy
|
|
|
|
|
|
def test_issue1807():
|
|
vocab = Vocab()
|
|
arr = numpy.ones((50,), dtype='f')
|
|
assert 'hello' not in vocab
|
|
vocab.set_vector('hello', arr)
|
|
assert 'hello' in vocab
|
|
|