small fixes

This commit is contained in:
svlandeg 2020-06-18 14:01:19 +02:00
parent 0c6f1f3891
commit 01f9ae774c
2 changed files with 7 additions and 1 deletions

View File

@ -1,5 +1,7 @@
from collections import defaultdict from collections import defaultdict
import pytest
from spacy.pipeline.defaults import default_ner from spacy.pipeline.defaults import default_ner
from spacy.pipeline import EntityRecognizer from spacy.pipeline import EntityRecognizer
@ -7,6 +9,8 @@ from spacy.lang.en import English
from spacy.tokens import Span from spacy.tokens import Span
# skipped after removing Beam stuff during the Example/GoldParse refactor
@pytest.mark.skip
def test_issue4313(): def test_issue4313():
""" This should not crash or exit with some strange error code """ """ This should not crash or exit with some strange error code """
beam_width = 16 beam_width = 16

View File

@ -1,9 +1,11 @@
import pytest import pytest
from spacy.gold import Example
@pytest.mark.parametrize( @pytest.mark.parametrize(
"text,words", [("A'B C", ["A", "'", "B", "C"]), ("A-B", ["A-B"])] "text,words", [("A'B C", ["A", "'", "B", "C"]), ("A-B", ["A-B"])]
) )
def test_gold_misaligned(en_tokenizer, text, words): def test_gold_misaligned(en_tokenizer, text, words):
doc = en_tokenizer(text) doc = en_tokenizer(text)
GoldParse(doc, words=words) Example.from_dict(doc, {"words": words})