mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-27 10:26:35 +03:00
db55577c45
* Remove unicode declarations * Remove Python 3.5 and 2.7 from CI * Don't require pathlib * Replace compat helpers * Remove OrderedDict * Use f-strings * Set Cython compiler language level * Fix typo * Re-add OrderedDict for Table * Update setup.cfg * Revert CONTRIBUTING.md * Revert lookups.md * Revert top-level.md * Small adjustments and docs [ci skip]
22 lines
624 B
Python
22 lines
624 B
Python
from spacy.lang.en import English
|
|
import pytest
|
|
|
|
|
|
@pytest.mark.filterwarnings("ignore::UserWarning")
|
|
def test_issue3880():
|
|
"""Test that `nlp.pipe()` works when an empty string ends the batch.
|
|
|
|
Fixed in v7.0.5 of Thinc.
|
|
"""
|
|
texts = ["hello", "world", "", ""]
|
|
nlp = English()
|
|
nlp.add_pipe(nlp.create_pipe("parser"))
|
|
nlp.add_pipe(nlp.create_pipe("ner"))
|
|
nlp.add_pipe(nlp.create_pipe("tagger"))
|
|
nlp.get_pipe("parser").add_label("dep")
|
|
nlp.get_pipe("ner").add_label("PERSON")
|
|
nlp.get_pipe("tagger").add_label("NN")
|
|
nlp.begin_training()
|
|
for doc in nlp.pipe(texts):
|
|
pass
|