mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-11 17:56:30 +03:00
Set unique vector names in tests
This commit is contained in:
parent
bf06d9d537
commit
139428c20f
|
@ -187,7 +187,7 @@ def test_issue1799():
|
|||
|
||||
def test_issue1807():
|
||||
"""Test vocab.set_vector also adds the word to the vocab."""
|
||||
vocab = Vocab()
|
||||
vocab = Vocab(vectors_name="test_issue1807")
|
||||
assert "hello" not in vocab
|
||||
vocab.set_vector("hello", numpy.ones((50,), dtype="f"))
|
||||
assert "hello" in vocab
|
||||
|
|
|
@ -184,7 +184,7 @@ def test_issue2833(en_vocab):
|
|||
def test_issue2871():
|
||||
"""Test that vectors recover the correct key for spaCy reserved words."""
|
||||
words = ["dog", "cat", "SUFFIX"]
|
||||
vocab = Vocab()
|
||||
vocab = Vocab(vectors_name="test_issue2871")
|
||||
vocab.vectors.resize(shape=(3, 10))
|
||||
vector_data = numpy.zeros((3, 10), dtype="f")
|
||||
for word in words:
|
||||
|
|
|
@ -259,7 +259,7 @@ def test_vectors_doc_doc_similarity(vocab, text1, text2):
|
|||
|
||||
|
||||
def test_vocab_add_vector():
|
||||
vocab = Vocab()
|
||||
vocab = Vocab(vectors_name="test_vocab_add_vector")
|
||||
data = numpy.ndarray((5, 3), dtype="f")
|
||||
data[0] = 1.0
|
||||
data[1] = 2.0
|
||||
|
@ -272,7 +272,7 @@ def test_vocab_add_vector():
|
|||
|
||||
|
||||
def test_vocab_prune_vectors():
|
||||
vocab = Vocab()
|
||||
vocab = Vocab(vectors_name="test_vocab_prune_vectors")
|
||||
_ = vocab["cat"] # noqa: F841
|
||||
_ = vocab["dog"] # noqa: F841
|
||||
_ = vocab["kitten"] # noqa: F841
|
||||
|
|
Loading…
Reference in New Issue
Block a user