Skip to content

Commit

Permalink
Update splitTextIntoSegments.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
mushan0x0 committed Dec 29, 2023
1 parent 26ab412 commit 05ca048
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 05ca048

Please sign in to comment.