From 788657f06260f593db38868ffe27eb2ee330ee9d Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sat, 15 Oct 2016 14:12:18 +0200 Subject: [PATCH] Ensure words are added to vocab before test, so that the lexicon is updated correctly. --- spacy/tests/website/conftest.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spacy/tests/website/conftest.py b/spacy/tests/website/conftest.py index e2c64cfd7..7cde89b9d 100644 --- a/spacy/tests/website/conftest.py +++ b/spacy/tests/website/conftest.py @@ -10,9 +10,11 @@ def nlp(): data_dir = os.environ.get('SPACY_DATA') else: data_dir = None - return English(data_dir=data_dir) + return English(path=data_dir) @pytest.fixture() def doc(nlp): + for word in ['Hello', ',', 'world', '.', 'Here', 'are', 'two', 'sentences', '.']: + _ = nlp.vocab[word] return nlp('Hello, world. Here are two sentences.')