Skip to content

Commit

Permalink
Revert "Update splitTextIntoSegments.ts"
Browse files Browse the repository at this point in the history
This reverts commit cbba239.
  • Loading branch information
mushan0x0 committed Dec 29, 2023
1 parent cbba239 commit 26ab412
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/utils/splitTextIntoSegments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const toHalfWidthAndCleanSpace = (str: string): string => {
export const splitTextIntoSegments = (text: string, maxChars: number = 100): string[] => {
text = toHalfWidthAndCleanSpace(text);

const sentences = text.split(/([!.;?])/g);
const sentences = text.split(/(?<=[!.;?])/g);
const segments: string[] = [];
let currentSegment = '';

Expand Down

0 comments on commit 26ab412

Please sign in to comment.