Language Identifier


«Language Identifier» service is designed to determine the language applied to the input of text.

 

Access to the service via the API

To have an access to the service, «Language Identifier» through the API, you should send a POST request to the AJAX-address http://corpus.by/LanguageIdentifier/api.php. With data array, the arbitrary input text (parameter text) is transmitted.

The elements of the input array data have the following parameters:

  • text — arbitrary input text of 80 characters size.

Example of AJAX-request:

$.ajax({
   type: “POST”,
   url: “http://corpus.by/LanguageIdentifier/api.php“,
   data:{
      “text”: “Had I the heavens’ embroidered cloths,
Enwrought with golden and silver light,
The blue and the dim and the dark cloths
Of night and light and the half-light,
I would spread the cloths under your feet:
But I, being poor, have only my dreams;
I have spread my dreams under your feet;
Tread softly because you tread on my dreams.”

   }
   success: function(msg){ }
});

The server returns a JSON-array with the input text (text parameter) and a specific language code (result parameter). For example, the following reply will be formed on the above listed AJAX-request:

[
   {
      “text”: “Had I the heavens’ embroidered cloths,
Enwrought with golden and silver light,
The blue and the dim and the dark cloths
Of night and light and the half-light,
I would spread the cloths under your feet:
But I, being poor, have only my dreams;
I have spread my dreams under your feet;
Tread softly because you tread on my dreams.”,

      “result”: “en”
   }
]

An example of using this API — web-service “Language Identifier via API» (http://corpus.by/LanguageIdentifierViaApi/).

 

Links to sources

Service web-page: http://corpus.by/LanguageIdentifier/?lang=be

Калі Вы знайшлі ў тэксце памылку правапісу, калі ласка, выдзеліце гэты тэкст і націсніце Ctrl+Enter.