Skip to content

Commit

Permalink
Adding Definition for Microsoft Translation service (#23231)
Browse files Browse the repository at this point in the history
* 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 <mimat@microsoft.com>
Co-authored-by: Catalina Peralta <catalinaperaltah@hotmail.com>

* 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 <mimat@microsoft.com>
Co-authored-by: Catalina Peralta <catalinaperaltah@hotmail.com>
  • Loading branch information
3 people authored Apr 3, 2023
1 parent 06dbe26 commit 9f3ae9d
Show file tree
Hide file tree
Showing 31 changed files with 3,494 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cSpell.json
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,16 @@
"workflowruns",
"workflowtasks"
]
},
{
"filename": "**/specification/translation/data-plane/**/*.json",
"words": [
"autodetection",
"breaksentence",
"mosca",
"Transliterable",
"translitered"
]
}
],
"enableFiletypes": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"title": "Find Sentence Boundaries",
"operationId": "FindSentenceBoundaries",
"parameters": {
"X-ClientTraceId": "svun",
"language": "en",
"script": "Latn",
"api-version": "3.0",
"requestBody": [
{
"text": "How are you? I am fine. What did you do today?"
}
]
},
"responses": {
"200": {
"body": [
{
"sentLen": [
13,
11,
22
]
}
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"title": "Find Sentence Boundaries",
"operationId": "FindSentenceBoundaries",
"parameters": {
"api-version": "3.0",
"requestBody": [
{
"text": "How are you? I am fine. What did you do today?"
}
]
},
"responses": {
"200": {
"body": [
{
"detectedLanguage": {
"language": "en",
"score": 1.0
},
"sentLen": [
13,
11,
22
]
}
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"title": "Gets the set of languages currently supported by other operations of the Translator.",
"operationId": "GetLanguages",
"parameters": {
"X-ClientTraceId": "kayfnugjec",
"scope": "translation,transliteration,dictionary",
"Accept-Language": "en",
"If-None-Match": "fpnhruttllvc",
"api-version": "3.0"
},
"responses": {
"200": {
"body": {
"translation": {
"en": {
"name": "English",
"nativeName": "English",
"dir": "ltr"
},
"es": {
"name": "Spanish",
"nativeName": "Español",
"dir": "ltr"
}
},
"transliteration": {
"ar": {
"name": "Arabic",
"nativeName": "العربية",
"scripts": [
{
"code": "Arab",
"name": "Arabic",
"nativeName": "العربية",
"dir": "rtl",
"toScripts": [
{
"code": "Latn",
"name": "Latin",
"nativeName": "اللاتينية",
"dir": "ltr"
}
]
},
{
"code": "Latn",
"name": "Latin",
"nativeName": "اللاتينية",
"dir": "ltr",
"toScripts": [
{
"code": "Arab",
"name": "Arabic",
"nativeName": "العربية",
"dir": "rtl"
}
]
}
]
}
},
"dictionary": {
"cs": {
"name": "Czech",
"nativeName": "Čeština",
"dir": "ltr",
"translations": [
{
"name": "English",
"nativeName": "English",
"dir": "ltr",
"code": "en"
}
]
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"title": "Gets the set of languages currently supported by other operations of the Translator.",
"operationId": "GetLanguages",
"parameters": {
"api-version": "3.0"
},
"responses": {
"200": {
"body": {}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"title": "Lookup Dictionary Entries",
"operationId": "LookupDictionaryEntries",
"parameters": {
"X-ClientTraceId": "yqst",
"from": "en",
"to": "es",
"api-version": "3.0",
"requestBody": [
{
"text": "fly"
}
]
},
"responses": {
"200": {
"body": [
{
"normalizedSource": "fly",
"displaySource": "fly",
"translations": [
{
"normalizedTarget": "volar",
"displayTarget": "volar",
"posTag": "VERB",
"confidence": 0.4081,
"prefixWord": "",
"backTranslations": [
{
"normalizedText": "fly",
"displayText": "fly",
"numExamples": 15,
"frequencyCount": 4637
},
{
"normalizedText": "flying",
"displayText": "flying",
"numExamples": 15,
"frequencyCount": 1365
},
{
"normalizedText": "blow",
"displayText": "blow",
"numExamples": 15,
"frequencyCount": 503
},
{
"normalizedText": "flight",
"displayText": "flight",
"numExamples": 15,
"frequencyCount": 135
}
]
},
{
"normalizedTarget": "mosca",
"displayTarget": "mosca",
"posTag": "NOUN",
"confidence": 0.2668,
"prefixWord": "",
"backTranslations": [
{
"normalizedText": "fly",
"displayText": "fly",
"numExamples": 15,
"frequencyCount": 1697
},
{
"normalizedText": "flyweight",
"displayText": "flyweight",
"numExamples": 0,
"frequencyCount": 48
},
{
"normalizedText": "flies",
"displayText": "flies",
"numExamples": 9,
"frequencyCount": 34
}
]
}
]
}
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"title": "Lookup Dictionary Entries",
"operationId": "LookupDictionaryEntries",
"parameters": {
"from": "en",
"to": "es",
"api-version": "3.0",
"requestBody": [
{
"text": "fly"
}
]
},
"responses": {
"200": {
"body": [
{
"normalizedSource": "fly",
"displaySource": "fly",
"translations": [
{
"normalizedTarget": "volar",
"displayTarget": "volar",
"posTag": "VERB",
"confidence": 0.4081,
"prefixWord": "",
"backTranslations": [
{
"normalizedText": "fly",
"displayText": "fly",
"numExamples": 15,
"frequencyCount": 4637
},
{
"normalizedText": "flying",
"displayText": "flying",
"numExamples": 15,
"frequencyCount": 1365
},
{
"normalizedText": "blow",
"displayText": "blow",
"numExamples": 15,
"frequencyCount": 503
},
{
"normalizedText": "flight",
"displayText": "flight",
"numExamples": 15,
"frequencyCount": 135
}
]
},
{
"normalizedTarget": "mosca",
"displayTarget": "mosca",
"posTag": "NOUN",
"confidence": 0.2668,
"prefixWord": "",
"backTranslations": [
{
"normalizedText": "fly",
"displayText": "fly",
"numExamples": 15,
"frequencyCount": 1697
},
{
"normalizedText": "flyweight",
"displayText": "flyweight",
"numExamples": 0,
"frequencyCount": 48
},
{
"normalizedText": "flies",
"displayText": "flies",
"numExamples": 9,
"frequencyCount": 34
}
]
}
]
}
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"title": "Lookup Dictionary Examples",
"operationId": "LookupDictionaryExamples",
"parameters": {
"X-ClientTraceId": "vykwwekvcncclrmsyjhbok",
"from": "en",
"to": "es",
"api-version": "3.0",
"requestBody": [
{
"text": "fly",
"translation": "volar"
}
]
},
"responses": {
"200": {
"body": [
{
"normalizedSource": "fly",
"normalizedTarget": "volar",
"examples": [
{
"sourcePrefix": "They need machines to ",
"sourceTerm": "fly",
"sourceSuffix": ".",
"targetPrefix": "Necesitan máquinas para ",
"targetTerm": "volar",
"targetSuffix": "."
},
{
"sourcePrefix": "That should really ",
"sourceTerm": "fly",
"sourceSuffix": ".",
"targetPrefix": "Eso realmente debe ",
"targetTerm": "volar",
"targetSuffix": "."
}
]
}
]
}
}
}
Loading

0 comments on commit 9f3ae9d

Please sign in to comment.