Kokoro: chunk generation, add pre-process func

#3412
This commit is contained in:
Cohee
2025-03-12 21:35:09 +02:00
parent e65b72ea41
commit 1b817cd897
2 changed files with 52 additions and 22 deletions

View File

@ -1015,6 +1015,10 @@ export function splitRecursive(input, length, delimiters = ['\n\n', '\n', ' ', '
return result;
}
export function splitSentences(input, length) {
var pattRegex = new RegExp(`^[\\s\\S]{${Math.floor(length / 2)},${length}}[.!?,]{1}|^[\\s\\S]{1,${length}}$|^[\\s\\S]{1,${length}}`);
}
/**
* Checks if a string is a valid data URL.
* @param {string} str The string to check.