Specify Translation Options
The Translate function of the API supports numerous parameters that affect the output. Word Alignment Words in written English (written in Latin script) are separated by spaces. This isn't always the case, though, in several other languages, more especially, scripts. For example, translating "Smart Services" from en (English) to zh (Simplified Chinese) produces the result " 智能服 务 ", and it's difficult to understand the relationship between the characters in the source text and the corresponding characters in the translation. To resolve this problem, you can specify the includeAlignment parameter with a value of true in your call to produce the result. Sentence Length When deciding how best to display a translation in a user interface, for instance, it may be helpful to know the translation's length (i.e., character count). By making the includeSentenceLength argument true, you can obtain this data. Profanity Filtering Profanity can occasionally be foun...