UNPKG

@voice-ping/cognitive-services-speech

Version:

VoicePing Cognitive Services Speech SDK for JavaScript forked from Microsoft

1 lines 2.55 kB
{"version":3,"sources":["src/common.speech/ServiceMessages/SimpleSpeechPhrase.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAG/C,MAAM,WAAW,mBAAmB;IAChC,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,gBAAgB,CAAC;CACtC;AAED,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,qBAAa,kBAAmB,YAAW,mBAAmB;IAC1D,OAAO,CAAC,sBAAsB,CAAsB;IAEpD,OAAO;WAKO,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB;IAIxD,IAAW,iBAAiB,IAAI,iBAAiB,CAEhD;IAED,IAAW,WAAW,IAAI,MAAM,CAE/B;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":"SimpleSpeechPhrase.d.ts","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\n\nimport { RecognitionStatus } from \"../Exports\";\n\n// speech.phrase\nexport interface ISimpleSpeechPhrase {\n RecognitionStatus: RecognitionStatus;\n DisplayText: string;\n Offset?: number;\n Duration?: number;\n PrimaryLanguage?: IPrimaryLanguage;\n}\n\nexport interface IPrimaryLanguage {\n Language: string;\n Confidence: string;\n}\n\nexport class SimpleSpeechPhrase implements ISimpleSpeechPhrase {\n private privSimpleSpeechPhrase: ISimpleSpeechPhrase;\n\n private constructor(json: string) {\n this.privSimpleSpeechPhrase = JSON.parse(json);\n this.privSimpleSpeechPhrase.RecognitionStatus = (RecognitionStatus as any)[this.privSimpleSpeechPhrase.RecognitionStatus];\n }\n\n public static fromJSON(json: string): SimpleSpeechPhrase {\n return new SimpleSpeechPhrase(json);\n }\n\n public get RecognitionStatus(): RecognitionStatus {\n return this.privSimpleSpeechPhrase.RecognitionStatus;\n }\n\n public get DisplayText(): string {\n return this.privSimpleSpeechPhrase.DisplayText;\n }\n\n public get Offset(): number {\n return this.privSimpleSpeechPhrase.Offset;\n }\n\n public get Duration(): number {\n return this.privSimpleSpeechPhrase.Duration;\n }\n\n public get Language(): string {\n return this.privSimpleSpeechPhrase.PrimaryLanguage === undefined ? undefined : this.privSimpleSpeechPhrase.PrimaryLanguage.Language;\n }\n\n public get LanguageDetectionConfidence(): string {\n return this.privSimpleSpeechPhrase.PrimaryLanguage === undefined ? undefined : this.privSimpleSpeechPhrase.PrimaryLanguage.Confidence;\n }\n}\n"]}