anylang
Version:
A translator's kit that uses the free APIs of Google Translate, Yandex, Bing, ChatGPT, and other LLMs
21 lines (20 loc) • 640 B
TypeScript
/**
* This code taken from https://github.com/zlargon/google-tts/blob/42bae63cf406c3cf20521e0cf36cbc5d9b9dce31/src/splitLongText.ts
* This code is under MIT license (2016 Leon Huang)
*/
interface Option {
maxLength?: number;
splitPunct?: string;
}
/**
* split the long text to short texts
* Time Complexity: O(n)
*
* @param {string} text
* @param {object?} option
* @param {number?} option.maxLength default is 200
* @param {string?} option.splitPunct default is ''
* @returns {string[]} short text list
*/
export declare const splitLongText: (text: string, { maxLength, splitPunct }?: Option) => string[];
export {};