locked
Machine Translation Not Preserving White Space RRS feed

  • Question

  • I am using the Microsoft API to translate some text from English to Spanish.  In the source text, I have a tag as follows:

    <br id="0">Example <br id="1">

    There is a blank space after the text and before the second tag. When I look at the translated text that comes back, I see that the blank space after the text has been removed, as follows:

    <br id="0">Ejemplo<br id="1">

    Is there a reason that the blank space was removed?  Is there a way to preserve the blank spaces?

    This is the API that I am using:

    <TranslateArrayRequest><AppId/><From>EN</From><Texts><string xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays">

     

    Is there a different API that I should try.  I have multiple sentences that I need translated, so I do not want to make a separate call per sentence.

    Thanks,

    Saul Rotblatt

    Thursday, September 24, 2015 8:19 AM

Answers

  • Hi Saul,

    the API offers no option to change the white space behavior. The only promise is that the word boundaries are treated according to the target language conventions.

    The behavior is the same between Translate() and TranslateArray().

    Chris Wendt
    Microsoft Translator

    Sunday, September 27, 2015 8:44 PM