gpt4 book ai didi

translation - 谷歌翻译工具包 - 如何排除部分文本被处理

转载 作者:行者123 更新时间:2023-12-04 18:01:52 29 4
gpt4 key购买 nike

有谁知道是否有可能将文本的某些部分排除在谷歌翻译工具包的处理之外?

这个工具的一大优势是它可以建议已经在另一个上下文中翻译过的句子的翻译。但是,如果在文本中添加了任何额外的脚注和/或备注,则不会将其识别为匹配项。我正在寻找将此类文本括在“括号”中的可能性,在括号内它将被忽略。

例如,下面的两个字符串应该被识别为相同的:

"This is one continuous sentence."
"This is {this text will be ignored}one continuous sentence."

并翻译成德语:

"Dies ist ein zusammenhängender Satz."
"Dies is {this text will be ignored}ein zusammenhängender Satz."

如果需要,我可以对此类插入进行编号并将其内容放入其他段落中,例如:

"This is one continuous sentence."
"This is {1}one continuous sentence."
"{1 this text will be ignored}

非常感谢,马塞尔

最佳答案

引自Google Translate FAQ ...

How do I tell Cloud Translation API to NOT translate something?

You can use the following HTML tags:

<span translate="no"> </span>
<span class="notranslate"> </span>

This functionality requires the source text to be submitted in HTML.

如果它“不适合您”,可能的原因是您请求的是文本翻译而不是 HTML 翻译。如果您只需要文本翻译,那么将您的计划文本包装在 HTML 标签中(使用如上所述的 <span> 标签),然后在翻译后展开。

关于translation - 谷歌翻译工具包 - 如何排除部分文本被处理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33942733/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com