Я пытаюсь прочитать вики-страницу, собрать и перечислить все предложения.
#read the wiki page
import wikipedia
eliz = wikipedia.page("Elizabeth II")
fullText2=eliz.content
m = re.split('(?<!\w\.\w.)(?<![A-Z][a-z]\.)(?<=\.|\?)(\s|[A-Z].*)',fullText2)
docs=[]
for i in m:
print (i)
docs.append(i)
Но, похоже, разбивать предложения некорректно: например я получаю это по отпечаткам в целом !:
"Elizabeth received private tuition in constitutional history from Henry Marten, Vice-Provost of Eton College, and learned French from a succession of native-speaking governesses. A Girl Guides company, the 1st Buckingham Palace Company, was formed specifically so she could socialise with girls her own age. Later, she was enrolled as a Sea Ranger.In 1939, Elizabeth's parents toured Canada and the United States. As in 1927, when her parents had toured Australia and New Zealand, Elizabeth remained in Britain, since her father thought her too young to undertake public tours. Elizabeth "looked tearful" as her parents departed. They corresponded regularly, and she and her parents made the first royal transatlantic telephone call on 18 May."
«Элизабет получила частные уроки конституционной истории от Генри Мартена ...» в приведенном выше тексте. для некоторых предложений он работает правильно, но для некоторых других, таких как предыдущий абзац, код не работает.





Можете ли вы опубликовать ожидаемый результат?