Microsoft Translator API-notranslate裁剪前导空间吗? [英] Microsoft Translator API - notranslate trimming leading space?

查看:103
本文介绍了Microsoft Translator API-notranslate裁剪前导空间吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这里从旧的MSDN论坛中提出问题,因为它似乎仍然开放.

Moving a question from the old MSDN forum here as it appears to be still open.

这是已知错误,还是出于任何原因而故意?

Is this a known bug, or intentional for any reason?

是否有针对此问题的解决方法,以便API不会去除空格?

Are there any workarounds for this issue so that the API does not strip white spaces?

更多示例:

推荐答案

翻译器修剪前导和尾随空格,并将任何其他空白压缩为单个空格.这是设计使然.译者需要自由移动单词以形成新组成的句子,并且不知道该如何处理多余的空白. 一种解决方法是在翻译之前修剪代码,然后根据上下文恢复修剪后的片段.

Translator trims leading and trailing space, and compresses any other white space to a single space. This is by design. Translator needs to move the words around freely to form the newly composed sentence, and wouldn't know what to do with the extra white space. A workaround would be to trim in your code before translation, and then restore the trimmed off pieces afterwards, depending on the context.

这篇关于Microsoft Translator API-notranslate裁剪前导空间吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆