Language Identifier


«Language Identifier» service is designed to determine the language applied to the input of text. At the moment, the service recognizes 5 languages: Belarusian, Russian, Ukrainian, English and German.

 

Access to the service via the API

To access the service «Language Identifier» via the API, you should send a AJAX-request (type: POST) to the address https://corpus.by/LanguageIdentifier/api.php. With an input array data the following parameters are passed:

  • text — arbitrary input text of at least 80 characters size.

Example of AJAX-request:

$.ajax({
   type: “POST”,
   url: “https://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) { },
   error: function() { }
});

The server returns a JSON-array with the following parameters:

  • text — input text.
  • result — language code.

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”
   }
]

 

Links to sources

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

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