{"version":3,"sources":["src/sdk/NoMatchDetails.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,4BAA4B,EAAE,MAAM,cAAc,CAAC;AAEpG;;;GAGG;AACH,qBAAa,cAAc;IACvB,OAAO,CAAC,UAAU,CAAgB;IAElC;;;;OAIG;IACH,OAAO;IAIP;;;;;;;;OAQG;WACW,UAAU,CAAC,MAAM,EAAE,uBAAuB,GAAG,4BAA4B,GAAG,cAAc;IAmBxG;;;;;;OAMG;IACH,IAAW,MAAM,IAAI,aAAa,CAEjC;CACJ","file":"NoMatchDetails.d.ts","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT license.\r\n\r\nimport { RecognitionStatus, SimpleSpeechPhrase } from \"../../src/common.speech/Exports.js\";\r\nimport { NoMatchReason, SpeechRecognitionResult, TranslationRecognitionResult } from \"./Exports.js\";\r\n\r\n/**\r\n * Contains detailed information for NoMatch recognition results.\r\n * @class NoMatchDetails\r\n */\r\nexport class NoMatchDetails {\r\n    private privReason: NoMatchReason;\r\n\r\n    /**\r\n     * Creates and initializes an instance of this class.\r\n     * @constructor\r\n     * @param {NoMatchReason} reason - The no-match reason.\r\n     */\r\n    private constructor(reason: NoMatchReason) {\r\n        this.privReason = reason;\r\n    }\r\n\r\n    /**\r\n     * Creates an instance of NoMatchDetails object for the NoMatch SpeechRecognitionResults.\r\n     * @member NoMatchDetails.fromResult\r\n     * @function\r\n     * @public\r\n     * @param {SpeechRecognitionResult | TranslationRecognitionResult}\r\n     * result - The recognition result that was not recognized.\r\n     * @returns {NoMatchDetails} The no match details object being created.\r\n     */\r\n    public static fromResult(result: SpeechRecognitionResult | TranslationRecognitionResult): NoMatchDetails {\r\n        const simpleSpeech: SimpleSpeechPhrase = SimpleSpeechPhrase.fromJSON(result.json, 0); // Offset fixups are already done.\r\n\r\n        let reason: NoMatchReason = NoMatchReason.NotRecognized;\r\n\r\n        switch (simpleSpeech.RecognitionStatus) {\r\n            case RecognitionStatus.BabbleTimeout:\r\n                reason = NoMatchReason.InitialBabbleTimeout;\r\n                break;\r\n            case RecognitionStatus.InitialSilenceTimeout:\r\n                reason = NoMatchReason.InitialSilenceTimeout;\r\n                break;\r\n            default:\r\n                reason = NoMatchReason.NotRecognized;\r\n                break;\r\n        }\r\n        return new NoMatchDetails(reason);\r\n    }\r\n\r\n    /**\r\n     * The reason the recognition was canceled.\r\n     * @member NoMatchDetails.prototype.reason\r\n     * @function\r\n     * @public\r\n     * @returns {NoMatchReason} Specifies the reason canceled.\r\n     */\r\n    public get reason(): NoMatchReason {\r\n        return this.privReason;\r\n    }\r\n}\r\n"]}