We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 26ab412 commit 33be544Copy full SHA for 33be544
src/core/utils/splitTextIntoSegments.ts
@@ -25,7 +25,7 @@ const toHalfWidthAndCleanSpace = (str: string): string => {
25
export const splitTextIntoSegments = (text: string, maxChars: number = 100): string[] => {
26
text = toHalfWidthAndCleanSpace(text);
27
28
- const sentences = text.split(/(?<=[!.;?])/g);
+ const sentences = text.match(/[^.!;?]+[.!;?]+/g) || [];
29
const segments: string[] = [];
30
let currentSegment = '';
31
0 commit comments