spaCy/spacy/tests/regression/test_issue3449.py

22 lines
667 B
Python
Raw Normal View History

2019-04-02 16:05:31 +03:00
# coding: utf8
2019-04-03 14:50:33 +03:00
from __future__ import unicode_literals
2019-04-02 14:06:37 +03:00
import pytest
from spacy.lang.en import English
2019-04-09 12:40:19 +03:00
@pytest.mark.xfail(reason="default suffix rules avoid one upper-case letter before dot")
2019-04-02 14:06:37 +03:00
def test_issue3449():
nlp = English()
2019-04-09 12:40:19 +03:00
nlp.add_pipe(nlp.create_pipe("sentencizer"))
2019-04-02 14:06:37 +03:00
text1 = "He gave the ball to I. Do you want to go to the movies with I?"
text2 = "He gave the ball to I. Do you want to go to the movies with I?"
text3 = "He gave the ball to I.\nDo you want to go to the movies with I?"
t1 = nlp(text1)
t2 = nlp(text2)
t3 = nlp(text3)
2019-04-09 12:40:19 +03:00
assert t1[5].text == "I"
assert t2[5].text == "I"
assert t3[5].text == "I"