{"version":3,"sources":["src/sdk/PronunciationAssessmentResult.ts"],"names":[],"mappings":"AAIA,OAAO,EAEH,iBAAiB,EACpB,MAAM,WAAW,CAAC;AAEnB;;;;GAIG;AACH,qBAAa,6BAA6B;IACtC,OAAO,CAAC,YAAY,CAAM;IAE1B,OAAO;IAMP;;;;;;;OAOG;WACW,UAAU,CAAC,MAAM,EAAE,iBAAiB,GAAG,6BAA6B;IAOlF;;;;;;OAMG;IACH,IAAW,YAAY,IAAI,GAAG,CAE7B;IAED;;;;;;;OAOG;IACH,IAAW,aAAa,IAAI,MAAM,CAEjC;IAED;;;;;;;OAOG;IACH,IAAW,kBAAkB,IAAI,MAAM,CAEtC;IAED;;;;;;OAMG;IACH,IAAW,iBAAiB,IAAI,MAAM,CAErC;IAED;;;;;;OAMG;IACH,IAAW,YAAY,IAAI,MAAM,CAEhC;CACJ","file":"PronunciationAssessmentResult.d.ts","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT license.\r\n\r\nimport {Contracts} from \"./Contracts\";\r\nimport {\r\n    PropertyId,\r\n    RecognitionResult\r\n} from \"./Exports\";\r\n\r\n/**\r\n * Pronunciation assessment results.\r\n * @class PronunciationAssessmentResult\r\n * Added in version 1.15.0.\r\n */\r\nexport class PronunciationAssessmentResult {\r\n    private privPronJson: any;\r\n\r\n    private constructor(jsonString: string) {\r\n        const j = JSON.parse(jsonString);\r\n        Contracts.throwIfNullOrUndefined(j.NBest[0], \"NBest\");\r\n        this.privPronJson = j.NBest[0];\r\n    }\r\n\r\n    /**\r\n     * @member PronunciationAssessmentResult.fromResult\r\n     * @function\r\n     * @public\r\n     * @param {RecognitionResult} result The recognition result.\r\n     * @return {PronunciationAssessmentConfig} Instance of PronunciationAssessmentConfig\r\n     * @summary Creates an instance of the PronunciationAssessmentResult from recognition result.\r\n     */\r\n    public static fromResult(result: RecognitionResult): PronunciationAssessmentResult {\r\n        Contracts.throwIfNullOrUndefined(result, \"result\");\r\n        const json: string = result.properties.getProperty(PropertyId.SpeechServiceResponse_JsonResult);\r\n        Contracts.throwIfNullOrUndefined(json, \"json\");\r\n        return new PronunciationAssessmentResult(json);\r\n    }\r\n\r\n    /**\r\n     * Gets the detail result of pronunciation assessment.\r\n     * @member PronunciationAssessmentConfig.prototype.detailResult\r\n     * @function\r\n     * @public\r\n     * @returns {any} detail result.\r\n     */\r\n    public get detailResult(): any {\r\n        return this.privPronJson;\r\n    }\r\n\r\n    /**\r\n     * The score indicating the pronunciation accuracy of the given speech, which indicates\r\n     * how closely the phonemes match a native speaker's pronunciation.\r\n     * @member PronunciationAssessmentResult.prototype.accuracyScore\r\n     * @function\r\n     * @public\r\n     * @returns {number} Accuracy score.\r\n     */\r\n    public get accuracyScore(): number {\r\n        return this.detailResult.PronunciationAssessment.AccuracyScore;\r\n    }\r\n\r\n    /**\r\n     * The overall score indicating the pronunciation quality of the given speech.\r\n     * This is calculated from AccuracyScore, FluencyScore and CompletenessScore with weight.\r\n     * @member PronunciationAssessmentResult.prototype.pronunciationScore\r\n     * @function\r\n     * @public\r\n     * @returns {number} Pronunciation score.\r\n     */\r\n    public get pronunciationScore(): number {\r\n        return this.detailResult.PronunciationAssessment.PronScore;\r\n    }\r\n\r\n    /**\r\n     * The score indicating the completeness of the given speech by calculating the ratio of pronounced words towards entire input.\r\n     * @member PronunciationAssessmentResult.prototype.completenessScore\r\n     * @function\r\n     * @public\r\n     * @returns {number} Completeness score.\r\n     */\r\n    public get completenessScore(): number {\r\n        return this.detailResult.PronunciationAssessment.CompletenessScore;\r\n    }\r\n\r\n    /**\r\n     * The score indicating the fluency of the given speech.\r\n     * @member PronunciationAssessmentResult.prototype.fluencyScore\r\n     * @function\r\n     * @public\r\n     * @returns {number} Fluency score.\r\n     */\r\n    public get fluencyScore(): number {\r\n        return this.detailResult.PronunciationAssessment.FluencyScore;\r\n    }\r\n}\r\n"]}