Quote Modal UI and fix doc (#432)

This commit is contained in:
Archer
2023-10-25 20:13:32 +08:00
committed by GitHub
parent f2fb0aedfd
commit 008d0af010
6 changed files with 14 additions and 12 deletions

View File

@@ -21,13 +21,13 @@ export function replaceVariable(text: string, obj: Record<string, string | numbe
* maxLen > overlapLen
*/
export const splitText2Chunks = ({ text = '', maxLen }: { text: string; maxLen: number }) => {
const overlapLen = Math.floor(maxLen * 0.2); // Overlap length
const overlapLen = Math.floor(maxLen * 0.15); // Overlap length
const tempMarker = 'SPLIT_HERE_SPLIT_HERE';
const stepReg: Record<number, RegExp> = {
0: /(\n\n)/g,
1: /([\n])/g,
2: /([。]|\.\s)/g,
2: /[。]|(?!<[^a-zA-Z])\.\s/g,
3: /([]|!\s|\?\s)/g,
4: /([]|;\s)/g,
5: /([]|,\s)/g