/// import Stream from 'stream'; import * as FlagUtils from './flags'; export declare type SentenceFlags = FlagUtils.SentenceFlags; export interface SentenceExample { id: string; flags: FlagUtils.SentenceFlags; raw?: string; context?: string; preprocessed: string; target_code: string | string[]; predictions?: string[][]; prediction?: string; type?: string; utterance?: string; } declare class DatasetStringifier extends Stream.Transform { constructor(); _transform(ex: SentenceExample, encoding: BufferEncoding, callback: (err?: Error | null, buffer?: string) => void): void; _flush(callback: (err: Error | null) => void): void; } interface DatasetParserOptions { offset?: number; contextual?: boolean; preserveId?: boolean; overrideFlags?: string; parseMultiplePrograms?: boolean; } declare class DatasetParser extends Stream.Transform { private _n; private _offset; private _contextual; private _preserveId; private _overrideFlags; private _parseMultiplePrograms; constructor(options?: DatasetParserOptions); _transform(line: string, encoding: BufferEncoding, callback: (err?: Error | null, res?: SentenceExample) => void): void; _flush(callback: () => void): void; } export interface DialogueTurn { context: string | null; agent: string | null; agent_target: string | null; agent_timestamp?: Date; intermediate_context: string | null; user: string; user_target: string; user_timestamp?: Date; vote?: string; comment?: string; } export interface DialogueExample { id: string; comment?: string; turns: DialogueTurn[]; } declare class DialogueSerializer extends Stream.Transform { private _annotations; constructor(options?: { annotations: boolean; }); private _pushMany; private _prefixLines; _transform(dlg: DialogueExample, encoding: BufferEncoding, callback: (err?: Error | null) => void): void; _flush(callback: (err?: Error | null) => void): void; } export declare type ParsedDialogue = DialogueTurn[] & { id: string; }; declare class DialogueParser extends Stream.Transform { private _buffer; private _i; private _id; private _keySequence; private _ignoreErrors; constructor({ withAnnotations, invertTurns, ignoreErrors }?: { withAnnotations?: boolean | undefined; invertTurns?: boolean | undefined; ignoreErrors?: boolean | undefined; }); _transform(line: string, encoding: BufferEncoding, callback: (err?: Error | null, data?: DialogueTurn[]) => void): void; _flush(callback: (err?: Error | null, data?: DialogueTurn[]) => void): void; } export { DatasetParser, DatasetStringifier, DialogueParser, DialogueSerializer, };