Selaa lähdekoodia

revert: text split

Timothy J. Baek 10 kuukautta sitten
vanhempi
commit
6d350fb8bc
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  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) => {