UNPKG

microsoft-cognitiveservices-speech-sdk

Version:
1 lines 3.59 kB
{"version":3,"sources":["src/sdk/TranslationRecognitionResult.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEvG;;;GAGG;AACH,qBAAa,4BAA6B,SAAQ,uBAAuB;IACrE,OAAO,CAAC,gBAAgB,CAAe;IAEvC;;;;;;;;;;;;;;OAcG;gBACgB,YAAY,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,YAAY,EACpE,IAAI,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EACpE,2BAA2B,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,EAC3D,IAAI,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,kBAAkB;WAMnD,2BAA2B,CAAC,MAAM,EAAE,uBAAuB,GAAG,4BAA4B;IAIxG;;;;;;;;;OASG;IACH,IAAW,YAAY,IAAI,YAAY,CAEtC;CACJ","file":"TranslationRecognitionResult.d.ts","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT license.\r\n\r\nimport { PropertyCollection, ResultReason, SpeechRecognitionResult, Translations } from \"./Exports.js\";\r\n\r\n/**\r\n * Translation text result.\r\n * @class TranslationRecognitionResult\r\n */\r\nexport class TranslationRecognitionResult extends SpeechRecognitionResult {\r\n private privTranslations: Translations;\r\n\r\n /**\r\n * Creates and initializes an instance of this class.\r\n * @constructor\r\n * @param {Translations} translations - The translations.\r\n * @param {string} resultId - The result id.\r\n * @param {ResultReason} reason - The reason.\r\n * @param {string} text - The recognized text.\r\n * @param {number} duration - The duration.\r\n * @param {number} offset - The offset into the stream.\r\n * @param {string} language - Primary Language detected, if provided.\r\n * @param {string} languageDetectionConfidence - Primary Language confidence (\"Unknown,\" \"Low,\" \"Medium,\" \"High\"...), if provided.\r\n * @param {string} errorDetails - Error details, if provided.\r\n * @param {string} json - Additional Json, if provided.\r\n * @param {PropertyCollection} properties - Additional properties, if provided.\r\n */\r\n public constructor(translations: Translations, resultId?: string, reason?: ResultReason,\r\n text?: string, duration?: number, offset?: number, language?: string,\r\n languageDetectionConfidence?: string, errorDetails?: string,\r\n json?: string, properties?: PropertyCollection) {\r\n super(resultId, reason, text, duration, offset, language, languageDetectionConfidence, undefined, errorDetails, json, properties);\r\n\r\n this.privTranslations = translations;\r\n }\r\n\r\n public static fromSpeechRecognitionResult(result: SpeechRecognitionResult): TranslationRecognitionResult {\r\n return new TranslationRecognitionResult(undefined, result.resultId, result.reason, result.text, result.duration, result.offset, result.language, result.languageDetectionConfidence, result.errorDetails, result.json, result.properties);\r\n }\r\n\r\n /**\r\n * Presents the translation results. Each item in the dictionary represents\r\n * a translation result in one of target languages, where the key is the name\r\n * of the target language, in BCP-47 format, and the value is the translation\r\n * text in the specified language.\r\n * @member TranslationRecognitionResult.prototype.translations\r\n * @function\r\n * @public\r\n * @returns {Translations} the current translation map that holds all translations requested.\r\n */\r\n public get translations(): Translations {\r\n return this.privTranslations;\r\n }\r\n}\r\n"]}