refac: tts split
This commit is contained in:
@@ -894,8 +894,8 @@ export const extractSentences = (text: string) => {
|
|||||||
return placeholder;
|
return placeholder;
|
||||||
});
|
});
|
||||||
|
|
||||||
// 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 or newlines, avoiding these blocks
|
||||||
let sentences = text.split(/(?<=[.!?])\s+/);
|
let sentences = text.split(/(?<=[.!?])\s+|\n+/);
|
||||||
|
|
||||||
// Restore code blocks and process sentences
|
// Restore code blocks and process sentences
|
||||||
sentences = sentences.map((sentence) => {
|
sentences = sentences.map((sentence) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user