فهرست منبع

revert: text split

Timothy J. Baek 10 ماه پیش
والد
کامیت
6d350fb8bc
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      src/lib/utils/index.ts

+ 1 - 1
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) => {