How does this look? A collegue actually already had a fix for this it seems, just not merged yet
>>> from llama_index.text_splitter import SentenceSplitter
>>> text = """Well, Prince, so Genoa and Lucca are now just family estates of the Buonapartes.\n But I warn you, if you don’t tell me that this means war, if you still try to defend the infamies and horrors perpetrated by that Antichrist—I really believe he is Antichrist—I will have nothing more to do with you and you are no longer my friend, no longer my ‘faithful slave,’ as you call yourself! But how do you do? I see I have frightened you—sit down and tell me all the news."""
>>> splits = SentenceSplitter(chunk_size=25, chunk_overlap=0).split_text(text)
>>> splits
['Well, Prince, so Genoa and Lucca are now just family estates of the Buonapartes.', 'But I warn you, if you don’t tell me that this means war, if you still try to defend the', 'infamies and horrors perpetrated by that Antichrist—I really believe he is Antichrist—I will have nothing', 'more to do with you and you are no longer my friend, no longer my ‘faithful slave,', '’ as you call yourself! But how do you do?', 'I see I have frightened you—sit down and tell me all the news.']
>>> splits = SentenceSplitter(chunk_size=50, chunk_overlap=0).split_text(text)
>>> splits
['Well, Prince, so Genoa and Lucca are now just family estates of the Buonapartes.\n But I warn you, if you don’t tell me that this means war,', 'if you still try to defend the infamies and horrors perpetrated by that Antichrist—I really believe he is Antichrist—I will have nothing more to do with you and you are no longer my friend,', 'no longer my ‘faithful slave,’ as you call yourself! But how do you do? I see I have frightened you—sit down and tell me all the news.']
>>>