spaCy/spacy/tests/regression/test_issue309.py

15 lines
392 B
Python
Raw Normal View History

2017-01-11 22:52:13 +00:00
# coding: utf-8
from __future__ import unicode_literals
from ..util import get_doc
def test_issue309(en_tokenizer):
2017-01-11 22:52:13 +00:00
"""Test Issue #309: SBD fails on empty string"""
tokens = en_tokenizer(" ")
doc = get_doc(tokens.vocab, [t.text for t in tokens], heads=[0], deps=['ROOT'])
doc.is_parsed = True
assert len(doc) == 1
sents = list(doc.sents)
assert len(sents) == 1