@langchain/community
Version:
Third-party integrations for LangChain.js
1 lines • 1.74 kB
Source Map (JSON)
{"version":3,"file":"srt.d.cts","names":["TextLoader","SRTLoader","Blob","Promise"],"sources":["../../../src/document_loaders/fs/srt.d.ts"],"sourcesContent":["import { TextLoader } from \"@langchain/classic/document_loaders/fs/text\";\n/**\n * A class that extends the `TextLoader` class. It represents a document\n * loader that loads documents from SRT (SubRip) subtitle files. It has a\n * constructor that takes a `filePathOrBlob` parameter representing the\n * path to the SRT file or a `Blob` object. The `parse()` method is\n * implemented to parse the SRT file and extract the text content of each\n * subtitle.\n * @example\n * ```typescript\n * const loader = new SRTLoader(\"path/to/file.srt\");\n * const docs = await loader.load();\n * console.log({ docs });\n * ```\n */\nexport declare class SRTLoader extends TextLoader {\n constructor(filePathOrBlob: string | Blob);\n /**\n * A protected method that takes a `raw` string as a parameter and returns\n * a promise that resolves to an array of strings. It parses the raw SRT\n * string using the `SRTParser2` class from the `srt-parser-2` module. It\n * retrieves the subtitle objects from the parsed SRT data and extracts\n * the text content from each subtitle object. It filters out any empty\n * text content and joins the non-empty text content with a space\n * separator.\n * @param raw The raw SRT string to be parsed.\n * @returns A promise that resolves to an array of strings representing the text content of each subtitle.\n */\n protected parse(raw: string): Promise<string[]>;\n}\n//# sourceMappingURL=srt.d.ts.map"],"mappings":";;;;;;AAeA;;;;AAAiD;;;;;;;;cAA5BC,SAAAA,SAAkBD,UAAAA;uCACEE;;;;;;;;;;;;gCAYPC"}