import * as Tp from 'thingpedia'; import { EntityMap } from '../utils/entity-utils'; import { ParseOptions, PredictionResult, GenerationResult, ExactMatcher } from './types'; export interface CacheInterface { get(tokens: string[], entities: EntityMap, contextCode: string[] | undefined, options: ParseOptions): Promise; set(result: PredictionResult, contextCode: string[] | undefined, options: ParseOptions): Promise; } export interface LocalParserOptions { id?: string; minibatchSize?: number; maxLatency?: number; cacheInterface?: CacheInterface; } export default class LocalParserClient { private _locale; private _langPack; private _tokenizer; private _predictor; private _platform; private _exactmatcher; private _tpClient; private _cacheInterface?; constructor(modeldir: string, locale: string, platform: Tp.BasePlatform | undefined, exactmatcher: ExactMatcher | undefined, tpClient?: Tp.BaseClient | null, options?: LocalParserOptions); start(): Promise; stop(): Promise; private _startExactMatcher; private _applyPostHeuristics; sendUtterance(utterance: string, contextCode: string[] | undefined, contextEntities: EntityMap | undefined, options?: ParseOptions): Promise; generateUtterance(contextCode: string[], contextEntities: EntityMap, targetAct: string[]): Promise; }