使用 GetLexicon 操作 - Amazon Polly
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

使用 GetLexicon 操作

Amazon Polly 提供了 GetLexicon API 操作,以检索您存储在账户特定区域中的发音词典的内容。

以下 get-lexicon Amazon CLI 命令检索 example 词典的内容。

aws polly get-lexicon \ --name example

如果您的账户中还没有存储词典,您可以使用 PutLexicon 操作来存储。有关更多信息,请参阅使用 PutLexicon 操作

以下为示例响应。除了词典内容之外,响应还会返回元数据,例如应用词典的语言代码、词典中定义的词素数量、资源的亚马逊资源名称 (ARN) 以及词典的大小(字节)。该 LastModified 值是 Unix 时间戳。

{ "Lexicon": { "Content": "lexicon content in plain text PLS format", "Name": "example" }, "LexiconAttributes": { "LanguageCode": "en-US", "LastModified": 1474222543.989, "Alphabet": "ipa", "LexemesCount": 1, "LexiconArn": "arn:aws:polly:us-east-2:account-id:lexicon/example", "Size": 495 } }

GetLexicon API 的其他代码示例