How do you use the Dynamic Dictionary feature of the Microsoft Translator Text API with json as input? The linked documentation is very unclear.
I am following this example from Microsoft's gitHub page.
Combining the instructions here with the python examples with the following input
text = "Instant dictionary: word <mstrans:dictionary translation=\"wordomatic\">word or phrase</mstrans:dictionary> is a dictionary entry."
gives the following output:
[
{
"translations": [
{
"text": "Instant Dictionary Word wordomatic ist ein Wörterbucheintrag.",
"to": "de"
}
]
}
]
So that answers this question.
However, somehow everything before the tagged word is not translated.
Also, translating text = "Instant dictionary: word"
returns:
{"translations": [{"text": "Instant Dictionary: Word","to": "de"}]}
Whereas translating text = "Instant dictionary word"
returns:
{"translations": [{"text": "Instant Wörterbuchwort","to": "de"}]}
This leads to the question: How do these words and characters change what the API returns?