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.TranslationHypothesis = void 0;\nconst Contracts_js_1 = require(\"../../sdk/Contracts.js\");\nconst TranslationStatus_js_1 = require(\"../TranslationStatus.js\");\nclass TranslationHypothesis {\n constructor(hypothesis) {\n this.privTranslationHypothesis = hypothesis;\n this.privTranslationHypothesis.Translation.TranslationStatus = TranslationStatus_js_1.TranslationStatus[this.privTranslationHypothesis.Translation.TranslationStatus];\n }\n static fromJSON(json) {\n return new TranslationHypothesis(JSON.parse(json));\n }\n static fromTranslationResponse(translationHypothesis) {\n Contracts_js_1.Contracts.throwIfNullOrUndefined(translationHypothesis, \"translationHypothesis\");\n const hypothesis = translationHypothesis.SpeechHypothesis;\n translationHypothesis.SpeechHypothesis = undefined;\n hypothesis.Translation = translationHypothesis;\n return new TranslationHypothesis(hypothesis);\n }\n get Duration() {\n return this.privTranslationHypothesis.Duration;\n }\n get Offset() {\n return this.privTranslationHypothesis.Offset;\n }\n get Text() {\n return this.privTranslationHypothesis.Text;\n }\n get Translation() {\n return this.privTranslationHypothesis.Translation;\n }\n get Language() {\n var _this$privTranslation;\n return (_this$privTranslation = this.privTranslationHypothesis.PrimaryLanguage) === null || _this$privTranslation === void 0 ? void 0 : _this$privTranslation.Language;\n }\n}\nexports.TranslationHypothesis = TranslationHypothesis;","map":{"version":3,"names":["Object","defineProperty","exports","value","TranslationHypothesis","Contracts_js_1","require","TranslationStatus_js_1","constructor","hypothesis","privTranslationHypothesis","Translation","TranslationStatus","fromJSON","json","JSON","parse","fromTranslationResponse","translationHypothesis","Contracts","throwIfNullOrUndefined","SpeechHypothesis","undefined","Duration","Offset","Text","Language","_this$privTranslation","PrimaryLanguage"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/common.speech/ServiceMessages/TranslationHypothesis.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.TranslationHypothesis = void 0;\nconst Contracts_js_1 = require(\"../../sdk/Contracts.js\");\nconst TranslationStatus_js_1 = require(\"../TranslationStatus.js\");\nclass TranslationHypothesis {\n constructor(hypothesis) {\n this.privTranslationHypothesis = hypothesis;\n this.privTranslationHypothesis.Translation.TranslationStatus = TranslationStatus_js_1.TranslationStatus[this.privTranslationHypothesis.Translation.TranslationStatus];\n }\n static fromJSON(json) {\n return new TranslationHypothesis(JSON.parse(json));\n }\n static fromTranslationResponse(translationHypothesis) {\n Contracts_js_1.Contracts.throwIfNullOrUndefined(translationHypothesis, \"translationHypothesis\");\n const hypothesis = translationHypothesis.SpeechHypothesis;\n translationHypothesis.SpeechHypothesis = undefined;\n hypothesis.Translation = translationHypothesis;\n return new TranslationHypothesis(hypothesis);\n }\n get Duration() {\n return this.privTranslationHypothesis.Duration;\n }\n get Offset() {\n return this.privTranslationHypothesis.Offset;\n }\n get Text() {\n return this.privTranslationHypothesis.Text;\n }\n get Translation() {\n return this.privTranslationHypothesis.Translation;\n }\n get Language() {\n return this.privTranslationHypothesis.PrimaryLanguage?.Language;\n }\n}\nexports.TranslationHypothesis = TranslationHypothesis;\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,qBAAqB,GAAG,KAAK,CAAC;AACtC,MAAMC,cAAc,GAAGC,OAAO,CAAC,wBAAwB,CAAC;AACxD,MAAMC,sBAAsB,GAAGD,OAAO,CAAC,yBAAyB,CAAC;AACjE,MAAMF,qBAAqB,CAAC;EACxBI,WAAWA,CAACC,UAAU,EAAE;IACpB,IAAI,CAACC,yBAAyB,GAAGD,UAAU;IAC3C,IAAI,CAACC,yBAAyB,CAACC,WAAW,CAACC,iBAAiB,GAAGL,sBAAsB,CAACK,iBAAiB,CAAC,IAAI,CAACF,yBAAyB,CAACC,WAAW,CAACC,iBAAiB,CAAC;EACzK;EACA,OAAOC,QAAQA,CAACC,IAAI,EAAE;IAClB,OAAO,IAAIV,qBAAqB,CAACW,IAAI,CAACC,KAAK,CAACF,IAAI,CAAC,CAAC;EACtD;EACA,OAAOG,uBAAuBA,CAACC,qBAAqB,EAAE;IAClDb,cAAc,CAACc,SAAS,CAACC,sBAAsB,CAACF,qBAAqB,EAAE,uBAAuB,CAAC;IAC/F,MAAMT,UAAU,GAAGS,qBAAqB,CAACG,gBAAgB;IACzDH,qBAAqB,CAACG,gBAAgB,GAAGC,SAAS;IAClDb,UAAU,CAACE,WAAW,GAAGO,qBAAqB;IAC9C,OAAO,IAAId,qBAAqB,CAACK,UAAU,CAAC;EAChD;EACA,IAAIc,QAAQA,CAAA,EAAG;IACX,OAAO,IAAI,CAACb,yBAAyB,CAACa,QAAQ;EAClD;EACA,IAAIC,MAAMA,CAAA,EAAG;IACT,OAAO,IAAI,CAACd,yBAAyB,CAACc,MAAM;EAChD;EACA,IAAIC,IAAIA,CAAA,EAAG;IACP,OAAO,IAAI,CAACf,yBAAyB,CAACe,IAAI;EAC9C;EACA,IAAId,WAAWA,CAAA,EAAG;IACd,OAAO,IAAI,CAACD,yBAAyB,CAACC,WAAW;EACrD;EACA,IAAIe,QAAQA,CAAA,EAAG;IAAA,IAAAC,qBAAA;IACX,QAAAA,qBAAA,GAAO,IAAI,CAACjB,yBAAyB,CAACkB,eAAe,cAAAD,qBAAA,uBAA9CA,qBAAA,CAAgDD,QAAQ;EACnE;AACJ;AACAxB,OAAO,CAACE,qBAAqB,GAAGA,qBAAqB","ignoreList":[]},"metadata":{},"sourceType":"script","externalDependencies":[]}
|