{"id":5997,"date":"2017-10-12T13:23:23","date_gmt":"2017-10-12T10:23:23","guid":{"rendered":"http:\/\/ssrlab.by\/?p=5997"},"modified":"2020-12-15T12:50:49","modified_gmt":"2020-12-15T09:50:49","slug":"generatar-transkryptsyj-praz-api","status":"publish","type":"post","link":"https:\/\/ssrlab.by\/en\/5997","title":{"rendered":"Transcription Generator Via Api"},"content":{"rendered":"<p>Service \u00ab<a href=\"https:\/\/corpus.by\/TranscriptionGeneratorViaApi\/?lang=en\"><strong>Transcription Generator Via Api<\/strong><\/a>\u00bb is designed for graphic recording of the sound of words, but its feature is operation through the API, which makes it possible to use the service in external software products. In this description, attention will be paid to the last feature. The algorithm for generating transcriptions and its functionality are described in more detail in the help to the \u00ab<a href=\"http:\/\/corpus.by\/TranscriptionGenerator\/?lang=en\" target=\"_blank\" rel=\"noopener noreferrer\">Transcription Generator<\/a>\u00bb service.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Basic terms and concepts<\/strong><\/p>\n<p><strong>API<\/strong> (<strong>a<\/strong>pplication <strong>p<\/strong>rogramming <strong>i<\/strong>nterface) is a set of ready-made classes, procedures, functions, structures and constants that an application (library, service) or operating system provides for use in external software products. This is a software integration tool. The API defines the functionality that the program provides (module, library), while the API allows you to abstract from exactly how this functionality is implemented.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Model, algorithm<\/strong><\/p>\n<p>To get the transcription of an arbitrary word of the Belarusian language, you need to send an AJAX-request of the POST type to <a href=\"http:\/\/corpus.by\/TranscriptionGenerator\/api.php\">http:\/\/corpus.by\/TranscriptionGenerator\/api.php<\/a>. Through the array of <strong><em>data<\/em><\/strong>\u00a0parameters, the text to be transcribed (the <strong><em>text<\/em><\/strong>\u00a0parameter) and the target transcription formats (<strong><em>tts<\/em><\/strong>, <strong><em>cyr<\/em><\/strong>, <strong><em>ipa<\/em><\/strong>, <strong><em>lat<\/em><\/strong>, <strong><em>xsampa<\/em><\/strong>\u00a0parameters) are transmitted. To get a transcription in a specific format, you need to give the corresponding parameter the value &#8220;1&#8221;, otherwise &#8211; the value &#8220;0&#8221;.<\/p>\n<p>An example of an AJAX request:<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"font-family: 'courier new', courier, monospace;\">$.ajax({<br \/>\n<\/span><span style=\"font-family: 'courier new', courier, monospace;\">\u00a0 type: &#8220;POST&#8221;,<br \/>\n<\/span><span style=\"font-family: 'courier new', courier, monospace;\">\u00a0 url: &#8220;http:\/\/corpus.by\/TranscriptionGenerator\/api.php&#8221;,<br \/>\n<\/span><span style=\"font-family: 'courier new', courier, monospace;\">\u00a0 data:{<br \/>\n<\/span><span style=\"font-family: 'courier new', courier, monospace;\">\u00a0\u00a0\u00a0 &#8220;text&#8221;: &#8220;\u0430\u0440\u0444\u0430\u044d\u043f\u0456\u044f&#8221;,<br \/>\n<\/span><span style=\"font-family: 'courier new', courier, monospace;\">\u00a0\u00a0\u00a0 &#8220;tts&#8221;: 0,<br \/>\n<\/span><span style=\"font-family: 'courier new', courier, monospace;\">\u00a0\u00a0\u00a0 &#8220;cyr&#8221;: 1,<br \/>\n<\/span><span style=\"font-family: 'courier new', courier, monospace;\">\u00a0\u00a0\u00a0 &#8220;ipa&#8221;: 1,<br \/>\n<\/span><span style=\"font-family: 'courier new', courier, monospace;\">\u00a0\u00a0\u00a0 &#8220;lat&#8221;: 0,<br \/>\n<\/span><span style=\"font-family: 'courier new', courier, monospace;\">\u00a0\u00a0\u00a0 &#8220;xsampa&#8221;: 0<br \/>\n<\/span><span style=\"font-family: 'courier new', courier, monospace;\">\u00a0 }<br \/>\n<\/span><span style=\"font-family: 'courier new', courier, monospace;\">\u00a0 success: function(msg){\u00a0 }<br \/>\n<\/span><span style=\"font-family: 'courier new', courier, monospace;\">});<\/span><\/p>\n<p>The server returns a JSON array with input text and effective transcriptions. For example, using the above AJAX request, the following response will be generated:<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"font-family: 'courier new', courier, monospace;\">[<br \/>\n<\/span><span style=\"font-family: 'courier new', courier, monospace;\">\u00a0 {<br \/>\n<\/span><span style=\"font-family: 'courier new', courier, monospace;\">\u00a0\u00a0\u00a0 &#8220;text&#8221;: &#8220;\u0430\u0440\u0444\u0430\u044d\u043f\u0456\u044f&#8221;,<br \/>\n<\/span><span style=\"font-family: 'courier new', courier, monospace;\">\u00a0\u00a0\u00a0 &#8220;cyr&#8221;: &#8220;[\u0430\u0440\u0444\u0430\u044d\u0301\u043f&#8217;\u0456\u0439\u0430]&#8221;,<br \/>\n<\/span><span style=\"font-family: 'courier new', courier, monospace;\">\u00a0\u00a0\u00a0 &#8220;ipa&#8221;: &#8220;[arfa\u02c8\u025bp\u02b2ija]&#8221;<br \/>\n<\/span><span style=\"font-family: 'courier new', courier, monospace;\">\u00a0 }<br \/>\n<\/span><span style=\"font-family: 'courier new', courier, monospace;\">]<\/span><\/p>\n<p>The array elements have the following fields:<\/p>\n<p><em>text<\/em>\u00a0\u2014 the input text transmitted in the AJAX request by the user;<br \/>\n<em>tts<\/em>\u00a0\u2014 transcription in speech synthesizer format;<br \/>\n<em>cyr<\/em>\u00a0\u2014 transcription in the national format;<br \/>\n<em>ipa<\/em>\u00a0\u2014 transcription in the format of the International phonetic alphabet;<br \/>\n<em>lat<\/em>\u00a0\u2014 transcription in the format of a simplified international phonetic alphabet;<br \/>\n<em>xsampa<\/em>\u00a0\u2014 is a transcription in the format of the Extended phonetic alphabet of speech assessment methods.<\/p>\n<p>Note: the resulting array has only one required field: text. All other fields are optional and will be reflected in the final array only when they were claimed.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Links to sources<\/strong><\/p>\n<p>An example of using this API is an Internet service \u00ab<a href=\"https:\/\/corpus.by\/TranscriptionGeneratorViaApi\/\">Transcription Generator Via Api<\/a>\u00bb.<\/p>","protected":false},"excerpt":{"rendered":"<p>Service \u00abTranscription Generator Via Api\u00bb is designed for graphic recording of the sound of words, but its feature is operation through the API, which makes it possible to use the service in external software products. In this description, attention will be paid to the last feature. The algorithm for generating transcriptions and its functionality are [&hellip;]<\/p>\n<a class = \"excerpt\" href=\"https:\/\/ssrlab.by\/en\/5997\">Read more...<\/a>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[],"_links":{"self":[{"href":"https:\/\/ssrlab.by\/en\/wp-json\/wp\/v2\/posts\/5997"}],"collection":[{"href":"https:\/\/ssrlab.by\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ssrlab.by\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ssrlab.by\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ssrlab.by\/en\/wp-json\/wp\/v2\/comments?post=5997"}],"version-history":[{"count":13,"href":"https:\/\/ssrlab.by\/en\/wp-json\/wp\/v2\/posts\/5997\/revisions"}],"predecessor-version":[{"id":8542,"href":"https:\/\/ssrlab.by\/en\/wp-json\/wp\/v2\/posts\/5997\/revisions\/8542"}],"wp:attachment":[{"href":"https:\/\/ssrlab.by\/en\/wp-json\/wp\/v2\/media?parent=5997"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ssrlab.by\/en\/wp-json\/wp\/v2\/categories?post=5997"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ssrlab.by\/en\/wp-json\/wp\/v2\/tags?post=5997"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}