From 6d350fb8bcdbe00722a22e2a77ce14f7d93f5118 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Mon, 1 Jul 2024 16:04:24 -0700 Subject: [PATCH] revert: text split --- src/lib/utils/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/utils/index.ts b/src/lib/utils/index.ts index af3ab9a01..d80fcc799 100644 --- a/src/lib/utils/index.ts +++ b/src/lib/utils/index.ts @@ -525,7 +525,7 @@ export const extractSentences = (text) => { }); // Split the modified text into sentences based on common punctuation marks, avoiding these blocks - let sentences = text.match(/[^.?!]+[.!?]+[\])'"`’”]*|.+/g); + let sentences = text.split(/(?<=[.!?])\s+/); // Restore code blocks and process sentences sentences = sentences.map((sentence) => {