Un-xfail passing tests and tidy up

This commit is contained in:
Ines Montani 2019-03-10 18:42:16 +01:00
parent 27dd820753
commit 67e38690d4
2 changed files with 0 additions and 5 deletions

View File

@ -69,7 +69,6 @@ def test_doc_retokenize_retokenizer_attrs(en_tokenizer):
assert doc[4].ent_type_ == "ORG" assert doc[4].ent_type_ == "ORG"
@pytest.mark.xfail
def test_doc_retokenize_lex_attrs(en_tokenizer): def test_doc_retokenize_lex_attrs(en_tokenizer):
"""Test that lexical attributes can be changed (see #2390).""" """Test that lexical attributes can be changed (see #2390)."""
doc = en_tokenizer("WKRO played beach boys songs") doc = en_tokenizer("WKRO played beach boys songs")

View File

@ -1,25 +1,21 @@
# coding: utf8 # coding: utf8
from __future__ import unicode_literals from __future__ import unicode_literals
import pytest
from spacy.lang.en import English from spacy.lang.en import English
from spacy.tokens import Doc from spacy.tokens import Doc
from spacy.pipeline import EntityRuler, EntityRecognizer from spacy.pipeline import EntityRuler, EntityRecognizer
@pytest.mark.xfail
def test_issue3345(): def test_issue3345():
"""Test case where preset entity crosses sentence boundary.""" """Test case where preset entity crosses sentence boundary."""
nlp = English() nlp = English()
doc = Doc(nlp.vocab, words=["I", "live", "in", "New", "York"]) doc = Doc(nlp.vocab, words=["I", "live", "in", "New", "York"])
doc[4].is_sent_start = True doc[4].is_sent_start = True
ruler = EntityRuler(nlp, patterns=[{"label": "GPE", "pattern": "New York"}]) ruler = EntityRuler(nlp, patterns=[{"label": "GPE", "pattern": "New York"}])
ner = EntityRecognizer(doc.vocab) ner = EntityRecognizer(doc.vocab)
# Add the OUT action. I wouldn't have thought this would be necessary... # Add the OUT action. I wouldn't have thought this would be necessary...
ner.moves.add_action(5, "") ner.moves.add_action(5, "")
ner.add_label("GPE") ner.add_label("GPE")
doc = ruler(doc) doc = ruler(doc)
# Get into the state just before "New" # Get into the state just before "New"
state = ner.moves.init_batch([doc])[0] state = ner.moves.init_batch([doc])[0]