/// import Stream from 'stream'; import { Ast, SchemaRetriever } from 'thingtalk'; import * as I18n from '../../i18n'; import { EntityMap } from '../../utils/entity-utils'; export interface MTurkParaphraseExample { id: string; synthetic_id: string; target_code: string; paraphrase: string; synthetic: string; context?: string; preprocessed?: string; target_preprocessed?: string; context_preprocessed?: string; } export interface Statistics { good: number; no_idea: number; values: number; quoting: number; manual: number; } declare class ParaphraseValidator { private _locale; private _timezone; private _schemas; private _tokenizer; private _noIdea; private _counter; id: string; target_code: string; paraphrase: string; synthetic: string; context: string | undefined; target_preprocessed: string[]; context_preprocessed: string[]; preprocessed: string[]; entities: EntityMap; ast: Ast.Input | undefined; private _debug; constructor(schemaRetriever: SchemaRetriever, langPack: I18n.LanguagePack, tokenizer: I18n.BaseTokenizer, locale: string, timezone: string, row: MTurkParaphraseExample, counter: Statistics, debug: boolean); clean(): Promise; isValid(): boolean; isNoIdea(): boolean; checkValues(): boolean; } declare type ValidationCountMap = Map; interface ParaphraseValidatorFilterOptions { locale: string; timezone: string; debug: boolean; validationCounts?: ValidationCountMap; validationThreshold?: number; } declare class ParaphraseValidatorFilter extends Stream.Transform { private _schemas; private _locale; private _timezone; private _langPack; private _tokenizer; private _counter; private _debug; private _validationCounts; private _validationThreshold; constructor(schemaRetriever: SchemaRetriever, options: ParaphraseValidatorFilterOptions); private _validate; _transform(row: MTurkParaphraseExample, encoding: BufferEncoding, callback: (err: Error | null, res?: MTurkParaphraseExample | null) => void): void; _flush(callback: () => void): void; } export { ParaphraseValidator, ParaphraseValidatorFilter };