Jelajahi Sumber

revert: text split

Timothy J. Baek 10 bulan lalu
induk
melakukan
6d350fb8bc
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  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
 	// 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
 	// Restore code blocks and process sentences
 	sentences = sentences.map((sentence) => {
 	sentences = sentences.map((sentence) => {