Skip to content

Commit 7597f51

Browse files
MikeyMCZMichal Maternacatalinaperalta
authored andcommitted
Adding Definition for Microsoft Translation service (Azure#23231)
* Adding translator API definition (#1) * Adding translator API definition * Fixing PR comments, part 1 * Fixes and python * Add versions * fix PR comments * fix operation definition * Enable all operations and dotnet * Fixes for languages API * Double clients and new auth method * PR comment fix * Switch to custom operations * Removing the APIM client * Adding emitters * Update api-version * Updates to models * Attempt to fix the api-version * Fixing API version * Fix dictionaries. * Fix the models * Models fixes * Removing detect, fix breaksentence * Adding examples * Fixing languages endpoint * Updating generation --------- Co-authored-by: Michal Materna <[email protected]> Co-authored-by: Catalina Peralta <[email protected]> * Fix the packages names * Update model names * Move files * Switch to knowValues * Reuse transliteration text models * Migrate to TSP * Updating TS files to satisfy pipeline * Adding autorest * Adding swagger file * Adding examples * Fixing path to examples * Speel check fix * Updating name of TS exporter * Updating openapi.json * Linting, spell check fixes * Fix spelling * Test removing generators * Fixing BS example * Fixing model generation * Update examples * Prettier * Generate new openapi.json * adding azure-resource-provider-folder config * Suppress warning * Remove sdk-for-net-track2 * Changing the name of the folder as per PR comment --------- Co-authored-by: Michal Materna <[email protected]> Co-authored-by: Catalina Peralta <[email protected]>
1 parent 934caa6 commit 7597f51

31 files changed

+3494
-0
lines changed

cSpell.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -907,6 +907,16 @@
907907
"workflowruns",
908908
"workflowtasks"
909909
]
910+
},
911+
{
912+
"filename": "**/specification/translation/data-plane/**/*.json",
913+
"words": [
914+
"autodetection",
915+
"breaksentence",
916+
"mosca",
917+
"Transliterable",
918+
"translitered"
919+
]
910920
}
911921
],
912922
"enableFiletypes": [
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"title": "Find Sentence Boundaries",
3+
"operationId": "FindSentenceBoundaries",
4+
"parameters": {
5+
"X-ClientTraceId": "svun",
6+
"language": "en",
7+
"script": "Latn",
8+
"api-version": "3.0",
9+
"requestBody": [
10+
{
11+
"text": "How are you? I am fine. What did you do today?"
12+
}
13+
]
14+
},
15+
"responses": {
16+
"200": {
17+
"body": [
18+
{
19+
"sentLen": [
20+
13,
21+
11,
22+
22
23+
]
24+
}
25+
]
26+
}
27+
}
28+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"title": "Find Sentence Boundaries",
3+
"operationId": "FindSentenceBoundaries",
4+
"parameters": {
5+
"api-version": "3.0",
6+
"requestBody": [
7+
{
8+
"text": "How are you? I am fine. What did you do today?"
9+
}
10+
]
11+
},
12+
"responses": {
13+
"200": {
14+
"body": [
15+
{
16+
"detectedLanguage": {
17+
"language": "en",
18+
"score": 1.0
19+
},
20+
"sentLen": [
21+
13,
22+
11,
23+
22
24+
]
25+
}
26+
]
27+
}
28+
}
29+
}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
{
2+
"title": "Gets the set of languages currently supported by other operations of the Translator.",
3+
"operationId": "GetLanguages",
4+
"parameters": {
5+
"X-ClientTraceId": "kayfnugjec",
6+
"scope": "translation,transliteration,dictionary",
7+
"Accept-Language": "en",
8+
"If-None-Match": "fpnhruttllvc",
9+
"api-version": "3.0"
10+
},
11+
"responses": {
12+
"200": {
13+
"body": {
14+
"translation": {
15+
"en": {
16+
"name": "English",
17+
"nativeName": "English",
18+
"dir": "ltr"
19+
},
20+
"es": {
21+
"name": "Spanish",
22+
"nativeName": "Español",
23+
"dir": "ltr"
24+
}
25+
},
26+
"transliteration": {
27+
"ar": {
28+
"name": "Arabic",
29+
"nativeName": "العربية",
30+
"scripts": [
31+
{
32+
"code": "Arab",
33+
"name": "Arabic",
34+
"nativeName": "العربية",
35+
"dir": "rtl",
36+
"toScripts": [
37+
{
38+
"code": "Latn",
39+
"name": "Latin",
40+
"nativeName": "اللاتينية",
41+
"dir": "ltr"
42+
}
43+
]
44+
},
45+
{
46+
"code": "Latn",
47+
"name": "Latin",
48+
"nativeName": "اللاتينية",
49+
"dir": "ltr",
50+
"toScripts": [
51+
{
52+
"code": "Arab",
53+
"name": "Arabic",
54+
"nativeName": "العربية",
55+
"dir": "rtl"
56+
}
57+
]
58+
}
59+
]
60+
}
61+
},
62+
"dictionary": {
63+
"cs": {
64+
"name": "Czech",
65+
"nativeName": "Čeština",
66+
"dir": "ltr",
67+
"translations": [
68+
{
69+
"name": "English",
70+
"nativeName": "English",
71+
"dir": "ltr",
72+
"code": "en"
73+
}
74+
]
75+
}
76+
}
77+
}
78+
}
79+
}
80+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"title": "Gets the set of languages currently supported by other operations of the Translator.",
3+
"operationId": "GetLanguages",
4+
"parameters": {
5+
"api-version": "3.0"
6+
},
7+
"responses": {
8+
"200": {
9+
"body": {}
10+
}
11+
}
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
{
2+
"title": "Lookup Dictionary Entries",
3+
"operationId": "LookupDictionaryEntries",
4+
"parameters": {
5+
"X-ClientTraceId": "yqst",
6+
"from": "en",
7+
"to": "es",
8+
"api-version": "3.0",
9+
"requestBody": [
10+
{
11+
"text": "fly"
12+
}
13+
]
14+
},
15+
"responses": {
16+
"200": {
17+
"body": [
18+
{
19+
"normalizedSource": "fly",
20+
"displaySource": "fly",
21+
"translations": [
22+
{
23+
"normalizedTarget": "volar",
24+
"displayTarget": "volar",
25+
"posTag": "VERB",
26+
"confidence": 0.4081,
27+
"prefixWord": "",
28+
"backTranslations": [
29+
{
30+
"normalizedText": "fly",
31+
"displayText": "fly",
32+
"numExamples": 15,
33+
"frequencyCount": 4637
34+
},
35+
{
36+
"normalizedText": "flying",
37+
"displayText": "flying",
38+
"numExamples": 15,
39+
"frequencyCount": 1365
40+
},
41+
{
42+
"normalizedText": "blow",
43+
"displayText": "blow",
44+
"numExamples": 15,
45+
"frequencyCount": 503
46+
},
47+
{
48+
"normalizedText": "flight",
49+
"displayText": "flight",
50+
"numExamples": 15,
51+
"frequencyCount": 135
52+
}
53+
]
54+
},
55+
{
56+
"normalizedTarget": "mosca",
57+
"displayTarget": "mosca",
58+
"posTag": "NOUN",
59+
"confidence": 0.2668,
60+
"prefixWord": "",
61+
"backTranslations": [
62+
{
63+
"normalizedText": "fly",
64+
"displayText": "fly",
65+
"numExamples": 15,
66+
"frequencyCount": 1697
67+
},
68+
{
69+
"normalizedText": "flyweight",
70+
"displayText": "flyweight",
71+
"numExamples": 0,
72+
"frequencyCount": 48
73+
},
74+
{
75+
"normalizedText": "flies",
76+
"displayText": "flies",
77+
"numExamples": 9,
78+
"frequencyCount": 34
79+
}
80+
]
81+
}
82+
]
83+
}
84+
]
85+
}
86+
}
87+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
"title": "Lookup Dictionary Entries",
3+
"operationId": "LookupDictionaryEntries",
4+
"parameters": {
5+
"from": "en",
6+
"to": "es",
7+
"api-version": "3.0",
8+
"requestBody": [
9+
{
10+
"text": "fly"
11+
}
12+
]
13+
},
14+
"responses": {
15+
"200": {
16+
"body": [
17+
{
18+
"normalizedSource": "fly",
19+
"displaySource": "fly",
20+
"translations": [
21+
{
22+
"normalizedTarget": "volar",
23+
"displayTarget": "volar",
24+
"posTag": "VERB",
25+
"confidence": 0.4081,
26+
"prefixWord": "",
27+
"backTranslations": [
28+
{
29+
"normalizedText": "fly",
30+
"displayText": "fly",
31+
"numExamples": 15,
32+
"frequencyCount": 4637
33+
},
34+
{
35+
"normalizedText": "flying",
36+
"displayText": "flying",
37+
"numExamples": 15,
38+
"frequencyCount": 1365
39+
},
40+
{
41+
"normalizedText": "blow",
42+
"displayText": "blow",
43+
"numExamples": 15,
44+
"frequencyCount": 503
45+
},
46+
{
47+
"normalizedText": "flight",
48+
"displayText": "flight",
49+
"numExamples": 15,
50+
"frequencyCount": 135
51+
}
52+
]
53+
},
54+
{
55+
"normalizedTarget": "mosca",
56+
"displayTarget": "mosca",
57+
"posTag": "NOUN",
58+
"confidence": 0.2668,
59+
"prefixWord": "",
60+
"backTranslations": [
61+
{
62+
"normalizedText": "fly",
63+
"displayText": "fly",
64+
"numExamples": 15,
65+
"frequencyCount": 1697
66+
},
67+
{
68+
"normalizedText": "flyweight",
69+
"displayText": "flyweight",
70+
"numExamples": 0,
71+
"frequencyCount": 48
72+
},
73+
{
74+
"normalizedText": "flies",
75+
"displayText": "flies",
76+
"numExamples": 9,
77+
"frequencyCount": 34
78+
}
79+
]
80+
}
81+
]
82+
}
83+
]
84+
}
85+
}
86+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"title": "Lookup Dictionary Examples",
3+
"operationId": "LookupDictionaryExamples",
4+
"parameters": {
5+
"X-ClientTraceId": "vykwwekvcncclrmsyjhbok",
6+
"from": "en",
7+
"to": "es",
8+
"api-version": "3.0",
9+
"requestBody": [
10+
{
11+
"text": "fly",
12+
"translation": "volar"
13+
}
14+
]
15+
},
16+
"responses": {
17+
"200": {
18+
"body": [
19+
{
20+
"normalizedSource": "fly",
21+
"normalizedTarget": "volar",
22+
"examples": [
23+
{
24+
"sourcePrefix": "They need machines to ",
25+
"sourceTerm": "fly",
26+
"sourceSuffix": ".",
27+
"targetPrefix": "Necesitan máquinas para ",
28+
"targetTerm": "volar",
29+
"targetSuffix": "."
30+
},
31+
{
32+
"sourcePrefix": "That should really ",
33+
"sourceTerm": "fly",
34+
"sourceSuffix": ".",
35+
"targetPrefix": "Eso realmente debe ",
36+
"targetTerm": "volar",
37+
"targetSuffix": "."
38+
}
39+
]
40+
}
41+
]
42+
}
43+
}
44+
}

0 commit comments

Comments
 (0)