@voice-ping/cognitive-services-speech
Version:
VoicePing Cognitive Services Speech SDK for JavaScript forked from Microsoft
1 lines • 1.96 kB
Source Map (JSON)
{"version":3,"sources":["src/common.speech/ServiceMessages/SpeechHypothesis.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGxD,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,gBAAgB,CAAC;CACtC;AAED,qBAAa,gBAAiB,YAAW,iBAAiB;IACtD,OAAO,CAAC,oBAAoB,CAAoB;IAEhD,OAAO;WAIO,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB;IAItD,IAAW,IAAI,IAAI,MAAM,CAExB;IAED,IAAW,MAAM,IAAI,MAAM,CAE1B;IAED,IAAW,QAAQ,IAAI,MAAM,CAE5B;IAED,IAAW,QAAQ,IAAI,MAAM,CAE5B;IAED,IAAW,2BAA2B,IAAI,MAAM,CAE/C;CACJ","file":"SpeechHypothesis.d.ts","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\n\nimport { IPrimaryLanguage } from \"./SimpleSpeechPhrase\";\n\n// speech.hypothesis\nexport interface ISpeechHypothesis {\n Text: string;\n Offset: number;\n Duration: number;\n PrimaryLanguage?: IPrimaryLanguage;\n}\n\nexport class SpeechHypothesis implements ISpeechHypothesis {\n private privSpeechHypothesis: ISpeechHypothesis;\n\n private constructor(json: string) {\n this.privSpeechHypothesis = JSON.parse(json);\n }\n\n public static fromJSON(json: string): SpeechHypothesis {\n return new SpeechHypothesis(json);\n }\n\n public get Text(): string {\n return this.privSpeechHypothesis.Text;\n }\n\n public get Offset(): number {\n return this.privSpeechHypothesis.Offset;\n }\n\n public get Duration(): number {\n return this.privSpeechHypothesis.Duration;\n }\n\n public get Language(): string {\n return this.privSpeechHypothesis.PrimaryLanguage === undefined ? undefined : this.privSpeechHypothesis.PrimaryLanguage.Language;\n }\n\n public get LanguageDetectionConfidence(): string {\n return this.privSpeechHypothesis.PrimaryLanguage === undefined ? undefined : this.privSpeechHypothesis.PrimaryLanguage.Confidence;\n }\n}\n"]}