microsoft-cognitiveservices-speech-sdk
Version:
Microsoft Cognitive Services Speech SDK for JavaScript
1 lines • 2.06 kB
Source Map (JSON)
{"version":3,"sources":["src/common.speech/ServiceMessages/IntentResponse.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,eAAe;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,aAAa,CAAC;IACjC,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,aAAa;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,cAAe,YAAW,eAAe;IAClD,OAAO,CAAC,kBAAkB,CAAkB;IAE5C,OAAO;WAQO,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc;IAIpD,IAAW,KAAK,IAAI,MAAM,CAEzB;IAED,IAAW,gBAAgB,IAAI,aAAa,CAE3C;IAED,IAAW,QAAQ,IAAI,aAAa,EAAE,CAErC;CACJ","file":"IntentResponse.d.ts","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT license.\r\n// response\r\n\r\nexport interface IIntentResponse {\r\n query?: string;\r\n topScoringIntent?: ISingleIntent;\r\n entities?: IIntentEntity[];\r\n}\r\n\r\nexport interface IIntentEntity {\r\n entity: string;\r\n type: string;\r\n startIndex: number;\r\n endIndex: number;\r\n score: number;\r\n}\r\n\r\nexport interface ISingleIntent {\r\n intent: string;\r\n score: number;\r\n}\r\n\r\nexport class IntentResponse implements IIntentResponse {\r\n private privIntentResponse: IIntentResponse;\r\n\r\n private constructor(json: string) {\r\n if (json === \"\") {\r\n this.privIntentResponse = {};\r\n } else {\r\n this.privIntentResponse = JSON.parse(json) as IIntentResponse;\r\n }\r\n }\r\n\r\n public static fromJSON(json: string): IntentResponse {\r\n return new IntentResponse(json);\r\n }\r\n\r\n public get query(): string {\r\n return this.privIntentResponse.query;\r\n }\r\n\r\n public get topScoringIntent(): ISingleIntent {\r\n return this.privIntentResponse.topScoringIntent;\r\n }\r\n\r\n public get entities(): IIntentEntity[] {\r\n return this.privIntentResponse.entities;\r\n }\r\n}\r\n"]}