2019-04-02 13:05:31 +00:00
|
|
|
# coding: utf8
|
2019-04-03 11:50:33 +00:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
2019-04-02 11:06:37 +00:00
|
|
|
import pytest
|
|
|
|
|
|
|
|
from spacy.lang.en import English
|
|
|
|
|
|
|
|
|
2019-04-09 09:40:19 +00:00
|
|
|
@pytest.mark.xfail(reason="default suffix rules avoid one upper-case letter before dot")
|
2019-04-02 11:06:37 +00:00
|
|
|
def test_issue3449():
|
|
|
|
nlp = English()
|
2019-04-09 09:40:19 +00:00
|
|
|
nlp.add_pipe(nlp.create_pipe("sentencizer"))
|
2019-04-02 11:06:37 +00: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 09:40:19 +00:00
|
|
|
assert t1[5].text == "I"
|
|
|
|
assert t2[5].text == "I"
|
|
|
|
assert t3[5].text == "I"
|