Service «Transcription Generator Via Api» 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 «Transcription Generator» service.
Basic terms and concepts
API (application programming interface) 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.
Model, algorithm
To get the transcription of an arbitrary word of the Belarusian language, you need to send an AJAX-request of the POST type to http://corpus.by/TranscriptionGenerator/api.php. Through the array of data parameters, the text to be transcribed (the text parameter) and the target transcription formats (tts, cyr, ipa, lat, xsampa parameters) are transmitted. To get a transcription in a specific format, you need to give the corresponding parameter the value “1”, otherwise – the value “0”.
An example of an AJAX request:
$.ajax({
type: “POST”,
url: “http://corpus.by/TranscriptionGenerator/api.php”,
data:{
“text”: “арфаэпія”,
“tts”: 0,
“cyr”: 1,
“ipa”: 1,
“lat”: 0,
“xsampa”: 0
}
success: function(msg){ }
});
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:
[
{
“text”: “арфаэпія”,
“cyr”: “[арфаэ́п’ійа]”,
“ipa”: “[arfaˈɛpʲija]”
}
]
The array elements have the following fields:
text — the input text transmitted in the AJAX request by the user;
tts — transcription in speech synthesizer format;
cyr — transcription in the national format;
ipa — transcription in the format of the International phonetic alphabet;
lat — transcription in the format of a simplified international phonetic alphabet;
xsampa — is a transcription in the format of the Extended phonetic alphabet of speech assessment methods.
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.
Links to sources
An example of using this API is an Internet service «Transcription Generator Via Api».