sandai-react
Version:
React components and utilities for the Sandai 3D AI Characters.
22 lines • 1.06 kB
TypeScript
export interface SentenceResult {
text: string;
isComplete: boolean;
}
export declare const endsWithSentenceMark: (s: string) => boolean;
/**
* @param rawText Text to split by sentence.
* @param onlyReturnLastIfComplete If set to true, only the last sentence is returned
* and only if it is considered complete.
* @param onlyReturnConfirmedSentences If true, only sentences that are confirmed
* complete by the presence of a following sentence are returned. The final
* sentence is dropped, as it may still be incomplete in streaming scenarios.
*
* Example:
* "Hello. I am a Wolf. Wan Wan." → ["Hello.", "I am a Wolf."]
*
* This is useful when processing streaming or incremental text where sentence
* boundaries may appear complete temporarily but are not yet final.
* @returns Promise<SentenceResult[]>
*/
export declare const splitIntoSentences: (rawText: string, onlyReturnLastIfComplete?: boolean, onlyReturnConfirmedSentences?: boolean) => Promise<SentenceResult[]>;
//# sourceMappingURL=sentence-splitter.d.ts.map