string-segmenter
Version:
Split a string in to sentences. Supports multiple languages.
13 lines (11 loc) • 477 B
text/typescript
/**
* Split a string into sentences, respecting common abbreviations.
*/
declare function splitBySentence(rawInput: string, locale?: Intl.LocalesArgument): Generator<Intl.SegmentData>;
/**
* Clear the segmenter cache. `splitBySentence` stores an instance of
* `Intl.Segmenter` for each locale it's called with. Use this function to free
* up that memory, if needed.
*/
declare const clearSegmenterCache: () => undefined;
export { clearSegmenterCache, splitBySentence };