Skip to content

Commit 2346edb

Browse files
authored
Updated alignment and dynamic dictionary sections
1 parent 5fb571a commit 2346edb

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

articles/cognitive-services/Translator/reference/v3-0-translate.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ manager: nitinme
99
ms.service: cognitive-services
1010
ms.subservice: translator-text
1111
ms.topic: reference
12-
ms.date: 03/20/2020
12+
ms.date: 04/07/2020
1313
ms.author: swmachan
1414
---
1515

@@ -450,6 +450,14 @@ The response is:
450450

451451
### Obtain alignment information
452452

453+
Alignment is returned as a string value of the following format for every word of the source. The information for each word is separated by a space, including for non-space-separated languages (scripts) like Chinese:
454+
455+
[[SourceTextStartIndex]:[SourceTextEndIndex][TgtTextStartIndex]:[TgtTextEndIndex]] *
456+
457+
Example alignment string: "0:0-7:10 1:2-11:20 3:4-0:3 3:4-4:6 5:5-21:21".
458+
459+
In other words, the colon separates start and end index, the dash separates the languages, and space separates the words. One word may align with zero, one, or multiple words in the other language, and the aligned words may be non-contiguous. When no alignment information is available, the Alignment element will be empty. The method returns no error in that case.
460+
453461
To receive alignment information, specify `includeAlignment=true` on the query string.
454462

455463
```curl
@@ -480,8 +488,10 @@ Obtaining alignment information is an experimental feature that we have enabled
480488
* Alignment is not available for text in HTML format i.e., textType=html
481489
* Alignment is only returned for a subset of the language pairs:
482490
- from English to any other language;
483-
- from any other language to English except for Chinese Simplified, Chinese Traditional, and Latvian to English;
491+
- from any other language to English except for Chinese Simplified to English;
484492
- from Japanese to Korean or from Korean to Japanese.
493+
- from Japanese to Chinese Simplified and Chinese Simplified to Japanese.
494+
- from Chinese Simplified to Chinese Traditional and Chinese Traditional to Chinese Simplified.
485495
* You will not receive alignment if the sentence is a canned translation. Example of a canned translation is "This is a test", "I love you" and other high frequency sentences.
486496
* Alignment is not available when you apply any of the approaches to prevent translation as described [here](../prevent-translation.md)
487497

@@ -511,7 +521,7 @@ The response is:
511521

512522
### Translate with dynamic dictionary
513523

514-
If you already know the translation you want to apply to a word or a phrase, you can supply it as markup within the request. The dynamic dictionary is only safe for compound nouns like proper names and product names.
524+
If you already know the translation you want to apply to a word or a phrase, you can supply it as markup within the request. The dynamic dictionary is only safe for proper nouns such as personal names and product names.
515525

516526
The markup to supply uses the following syntax.
517527

0 commit comments

Comments
 (0)