如何使用动态字典How to use a dynamic dictionary

若已知道要应用于某个单词或短语的翻译,可以在请求中将其作为标记提供。If you already know the translation you want to apply to a word or a phrase, you can supply it as markup within the request. 动态字典仅适用于复合名词,例如专有名称和产品名称。The dynamic dictionary is safe only for compound nouns like proper names and product names.

语法:Syntax:

<mstrans:dictionary translation="translation of phrase">phrase</mstrans:dictionary><mstrans:dictionary translation="translation of phrase">phrase</mstrans:dictionary>

要求:Requirements:

  • FromTo 语言必须包含英语和另一种受支持的语言。The From and To languages must include English and another supported language.
  • 你必须在 API 翻译请求中包含 From 参数,而不是使用自动检测功能。You must include the From parameter in your API translation request instead of using the autodetect feature.

示例:en-de:Example: en-de:

源输入:The word <mstrans:dictionary translation=\"wordomatic\">word or phrase</mstrans:dictionary> is a dictionary entry.Source input: The word <mstrans:dictionary translation=\"wordomatic\">word or phrase</mstrans:dictionary> is a dictionary entry.

目标输出:Das Wort "wordomatic" ist ein Wörterbucheintrag.Target output: Das Wort "wordomatic" ist ein Wörterbucheintrag.

无论使用还是不使用 HTML 模式,此功能都以相同的方式工作。This feature works the same way with and without HTML mode.

请谨慎使用此功能。Use the feature sparingly. 对翻译进行自定义时,较好的方法是使用自定义翻译器。A better way to customize translation is by using Custom Translator. 自定义翻译工具能够充分利用上下文和统计概率。Custom Translator makes full use of context and statistical probabilities. 如果必须或能够创建在上下文中显示工作或短语的训练数据,则会得到更好的结果。If you have or can create training data that shows your work or phrase in context, you get much better results. 可以在 https://aka.ms/CustomTranslator 中找到有关自定义翻译的详细信息。You can find more information about Custom Translator at https://aka.ms/CustomTranslator.