1 |
- {"ast":null,"code":"\"use strict\";\n\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.NoMatchDetails = void 0;\nconst Exports_js_1 = require(\"../../src/common.speech/Exports.js\");\nconst Exports_js_2 = require(\"./Exports.js\");\n/**\n * Contains detailed information for NoMatch recognition results.\n * @class NoMatchDetails\n */\nclass NoMatchDetails {\n /**\n * Creates and initializes an instance of this class.\n * @constructor\n * @param {NoMatchReason} reason - The no-match reason.\n */\n constructor(reason) {\n this.privReason = reason;\n }\n /**\n * Creates an instance of NoMatchDetails object for the NoMatch SpeechRecognitionResults.\n * @member NoMatchDetails.fromResult\n * @function\n * @public\n * @param {SpeechRecognitionResult | IntentRecognitionResult | TranslationRecognitionResult}\n * result - The recognition result that was not recognized.\n * @returns {NoMatchDetails} The no match details object being created.\n */\n static fromResult(result) {\n const simpleSpeech = Exports_js_1.SimpleSpeechPhrase.fromJSON(result.json);\n let reason = Exports_js_2.NoMatchReason.NotRecognized;\n switch (simpleSpeech.RecognitionStatus) {\n case Exports_js_1.RecognitionStatus.BabbleTimeout:\n reason = Exports_js_2.NoMatchReason.InitialBabbleTimeout;\n break;\n case Exports_js_1.RecognitionStatus.InitialSilenceTimeout:\n reason = Exports_js_2.NoMatchReason.InitialSilenceTimeout;\n break;\n default:\n reason = Exports_js_2.NoMatchReason.NotRecognized;\n break;\n }\n return new NoMatchDetails(reason);\n }\n /**\n * The reason the recognition was canceled.\n * @member NoMatchDetails.prototype.reason\n * @function\n * @public\n * @returns {NoMatchReason} Specifies the reason canceled.\n */\n get reason() {\n return this.privReason;\n }\n}\nexports.NoMatchDetails = NoMatchDetails;","map":{"version":3,"names":["Object","defineProperty","exports","value","NoMatchDetails","Exports_js_1","require","Exports_js_2","constructor","reason","privReason","fromResult","result","simpleSpeech","SimpleSpeechPhrase","fromJSON","json","NoMatchReason","NotRecognized","RecognitionStatus","BabbleTimeout","InitialBabbleTimeout","InitialSilenceTimeout"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/sdk/NoMatchDetails.js"],"sourcesContent":["\"use strict\";\n// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NoMatchDetails = void 0;\nconst Exports_js_1 = require(\"../../src/common.speech/Exports.js\");\nconst Exports_js_2 = require(\"./Exports.js\");\n/**\n * Contains detailed information for NoMatch recognition results.\n * @class NoMatchDetails\n */\nclass NoMatchDetails {\n /**\n * Creates and initializes an instance of this class.\n * @constructor\n * @param {NoMatchReason} reason - The no-match reason.\n */\n constructor(reason) {\n this.privReason = reason;\n }\n /**\n * Creates an instance of NoMatchDetails object for the NoMatch SpeechRecognitionResults.\n * @member NoMatchDetails.fromResult\n * @function\n * @public\n * @param {SpeechRecognitionResult | IntentRecognitionResult | TranslationRecognitionResult}\n * result - The recognition result that was not recognized.\n * @returns {NoMatchDetails} The no match details object being created.\n */\n static fromResult(result) {\n const simpleSpeech = Exports_js_1.SimpleSpeechPhrase.fromJSON(result.json);\n let reason = Exports_js_2.NoMatchReason.NotRecognized;\n switch (simpleSpeech.RecognitionStatus) {\n case Exports_js_1.RecognitionStatus.BabbleTimeout:\n reason = Exports_js_2.NoMatchReason.InitialBabbleTimeout;\n break;\n case Exports_js_1.RecognitionStatus.InitialSilenceTimeout:\n reason = Exports_js_2.NoMatchReason.InitialSilenceTimeout;\n break;\n default:\n reason = Exports_js_2.NoMatchReason.NotRecognized;\n break;\n }\n return new NoMatchDetails(reason);\n }\n /**\n * The reason the recognition was canceled.\n * @member NoMatchDetails.prototype.reason\n * @function\n * @public\n * @returns {NoMatchReason} Specifies the reason canceled.\n */\n get reason() {\n return this.privReason;\n }\n}\nexports.NoMatchDetails = NoMatchDetails;\n\n"],"mappings":"AAAA,YAAY;;AACZ;AACA;AACAA,MAAM,CAACC,cAAc,CAACC,OAAO,EAAE,YAAY,EAAE;EAAEC,KAAK,EAAE;AAAK,CAAC,CAAC;AAC7DD,OAAO,CAACE,cAAc,GAAG,KAAK,CAAC;AAC/B,MAAMC,YAAY,GAAGC,OAAO,CAAC,oCAAoC,CAAC;AAClE,MAAMC,YAAY,GAAGD,OAAO,CAAC,cAAc,CAAC;AAC5C;AACA;AACA;AACA;AACA,MAAMF,cAAc,CAAC;EACjB;AACJ;AACA;AACA;AACA;EACII,WAAWA,CAACC,MAAM,EAAE;IAChB,IAAI,CAACC,UAAU,GAAGD,MAAM;EAC5B;EACA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACI,OAAOE,UAAUA,CAACC,MAAM,EAAE;IACtB,MAAMC,YAAY,GAAGR,YAAY,CAACS,kBAAkB,CAACC,QAAQ,CAACH,MAAM,CAACI,IAAI,CAAC;IAC1E,IAAIP,MAAM,GAAGF,YAAY,CAACU,aAAa,CAACC,aAAa;IACrD,QAAQL,YAAY,CAACM,iBAAiB;MAClC,KAAKd,YAAY,CAACc,iBAAiB,CAACC,aAAa;QAC7CX,MAAM,GAAGF,YAAY,CAACU,aAAa,CAACI,oBAAoB;QACxD;MACJ,KAAKhB,YAAY,CAACc,iBAAiB,CAACG,qBAAqB;QACrDb,MAAM,GAAGF,YAAY,CAACU,aAAa,CAACK,qBAAqB;QACzD;MACJ;QACIb,MAAM,GAAGF,YAAY,CAACU,aAAa,CAACC,aAAa;QACjD;IACR;IACA,OAAO,IAAId,cAAc,CAACK,MAAM,CAAC;EACrC;EACA;AACJ;AACA;AACA;AACA;AACA;AACA;EACI,IAAIA,MAAMA,CAAA,EAAG;IACT,OAAO,IAAI,CAACC,UAAU;EAC1B;AACJ;AACAR,OAAO,CAACE,cAAc,GAAGA,cAAc","ignoreList":[]},"metadata":{},"sourceType":"script","externalDependencies":[]}
|