This commit is contained in:
Timothy J. Baek
2024-06-12 21:18:53 -07:00
parent bdd2ac0015
commit d6fd2a8228
8 changed files with 371 additions and 140 deletions

View File

@@ -436,7 +436,7 @@ export const removeEmojis = (str) => {
export const extractSentences = (text) => {
// Split the paragraph into sentences based on common punctuation marks
const sentences = text.split(/(?<=[.!?])/);
const sentences = text.split(/(?<=[.!?])\s+/);
return sentences
.map((sentence) => removeEmojis(sentence.trim()))