Skip to content

Commit

Permalink
Update splitTextIntoSegments.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
mushan0x0 authored Dec 29, 2023
1 parent 001d79e commit cbba239
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 cbba239

Please sign in to comment.