From ef875627411c5b2f6ad099a5451afd96e193482f Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sat, 19 Aug 2017 20:35:16 +0200 Subject: [PATCH] Restore vectors test utils --- spacy/tests/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacy/tests/util.py b/spacy/tests/util.py index 56aeb5223..2f474a926 100644 --- a/spacy/tests/util.py +++ b/spacy/tests/util.py @@ -79,9 +79,9 @@ def add_vecs_to_vocab(vocab, vectors): """Add list of vector tuples to given vocab. All vectors need to have the same length. Format: [("text", [1, 2, 3])]""" length = len(vectors[0][1]) - vocab.resize_vectors(length) + vocab.clear_vectors(length) for word, vec in vectors: - vocab[word].vector = vec + vocab.set_vector(word, vec) return vocab