UNPKG

@voice-ping/cognitive-services-speech

Version:

VoicePing Cognitive Services Speech SDK for JavaScript forked from Microsoft

197 lines (195 loc) 7.04 kB
"use strict"; // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. Object.defineProperty(exports, "__esModule", { value: true }); /** * Defines result of speech recognition. * @class RecognitionResultCustom */ var RecognitionResultCustom = /** @class */ (function () { /** * Creates and initializes an instance of this class. * @constructor * @param {string} resultId - The result id. * @param {ResultReason} reason - The reason. * @param {string} text - The recognized text. * @param {number} duration - The duration. * @param {number} offset - The offset into the stream. * @param {string} language - Primary Language detected, if provided. * @param {string} languageDetectionConfidence - Primary Language confidence ("Unknown," "Low," "Medium," "High"...), if provided. * @param {string} errorDetails - Error details, if provided. * @param {string} json - Additional Json, if provided. * @param {PropertyCollection} properties - Additional properties, if provided. * @param {string} requestId - requestId for DEBUG. */ function RecognitionResultCustom(resultId, reason, text, duration, offset, language, languageDetectionConfidence, errorDetails, json, properties, requestId) { this.privResultId = resultId; this.privReason = reason; this.privText = text; this.privDuration = duration; this.privOffset = offset; this.privLanguage = language; this.privLanguageDetectionConfidence = languageDetectionConfidence; this.privErrorDetails = errorDetails; this.privJson = json; this.privProperties = properties; this.privRequestId = requestId; } Object.defineProperty(RecognitionResultCustom.prototype, "resultId", { /** * Specifies the result identifier. * @member RecognitionResult.prototype.resultId * @function * @public * @returns {string} Specifies the result identifier. */ get: function () { return this.privResultId; }, enumerable: true, configurable: true }); Object.defineProperty(RecognitionResultCustom.prototype, "reason", { /** * Specifies status of the result. * @member RecognitionResult.prototype.reason * @function * @public * @returns {ResultReason} Specifies status of the result. */ get: function () { return this.privReason; }, enumerable: true, configurable: true }); Object.defineProperty(RecognitionResultCustom.prototype, "text", { /** * Presents the recognized text in the result. * @member RecognitionResult.prototype.text * @function * @public * @returns {string} Presents the recognized text in the result. */ get: function () { return this.privText; }, enumerable: true, configurable: true }); Object.defineProperty(RecognitionResultCustom.prototype, "duration", { /** * Duration of recognized speech in 100 nano second incements. * @member RecognitionResult.prototype.duration * @function * @public * @returns {number} Duration of recognized speech in 100 nano second incements. */ get: function () { return this.privDuration; }, enumerable: true, configurable: true }); Object.defineProperty(RecognitionResultCustom.prototype, "offset", { /** * Offset of recognized speech in 100 nano second incements. * @member RecognitionResult.prototype.offset * @function * @public * @returns {number} Offset of recognized speech in 100 nano second incements. */ get: function () { return this.privOffset; }, enumerable: true, configurable: true }); Object.defineProperty(RecognitionResultCustom.prototype, "language", { /** * Primary Language detected. * @member RecognitionResult.prototype.language * @function * @public * @returns {string} language detected. */ get: function () { return this.privLanguage; }, enumerable: true, configurable: true }); Object.defineProperty(RecognitionResultCustom.prototype, "languageDetectionConfidence", { /** * Primary Language detection confidence (Unknown, Low, Medium, High). * @member RecognitionResult.prototype.languageDetectionConfidence * @function * @public * @returns {string} detection confidence strength. */ get: function () { return this.privLanguageDetectionConfidence; }, enumerable: true, configurable: true }); Object.defineProperty(RecognitionResultCustom.prototype, "errorDetails", { /** * In case of an unsuccessful recognition, provides details of the occurred error. * @member RecognitionResult.prototype.errorDetails * @function * @public * @returns {string} a brief description of an error. */ get: function () { return this.privErrorDetails; }, enumerable: true, configurable: true }); Object.defineProperty(RecognitionResultCustom.prototype, "json", { /** * A string containing Json serialized recognition result as it was received from the service. * @member RecognitionResult.prototype.json * @function * @private * @returns {string} Json serialized representation of the result. */ get: function () { return this.privJson; }, enumerable: true, configurable: true }); Object.defineProperty(RecognitionResultCustom.prototype, "properties", { /** * The set of properties exposed in the result. * @member RecognitionResult.prototype.properties * @function * @public * @returns {PropertyCollection} The set of properties exposed in the result. */ get: function () { return this.privProperties; }, enumerable: true, configurable: true }); Object.defineProperty(RecognitionResultCustom.prototype, "requestId", { /** * requestId for DEBUG. * @member RecognitionResult.prototype.requestId * @function * @private * @returns {string} requestId */ get: function () { return this.privRequestId; }, enumerable: true, configurable: true }); return RecognitionResultCustom; }()); exports.RecognitionResultCustom = RecognitionResultCustom; //# sourceMappingURL=RecognitionResultCustom.js.map