Keyboard Layout Converter


Service «Keyboard Layout Converter» is designed to translate text that was typed in the English keyboard layout to the text of the Belarusian-language layout. Input for service is a text written in the English layout. After processing the text the user receives analogous input text written symbols of Belarusian layout on the output.

 

Basic terms and concepts

Keyboard layout — agreement on the correlation of typographical characters (letters, numbers, punctuation marks and so on) of written language to the computer keyboard keys of a typewriter or other device by which the text is entered. Defines several layout correspondences between the keys and the values that are entered with them:

  • mechanical layout  —shape, size and relative position of the keys on the keyboard;
  • visual layout — key labeling;
  • functional layout — values that you enter with a single or combined pressing. It is provided with at least two components:
    • Hardware keyboard layout — matching the scan code (ID) and the physical keys. It is constant for a given keyboard;
    • software layout — matching scan codes and character codes (and control codes) transmitted program (and, usually, shown on the screen in the form of letters of the alphabet It is usually meant by the layout.).

 

Practical Value

Service helps to quickly correct the inappropriate use of layout, the user can prevent the inadvertent.

 

Description Of The User Interface

The custom service interface is shown in Figure 1.

Малюнак 1. Графічны інтэрфейс сэрвісу «Канвертар раскладкі клавіятуры»

Figure 1. Service graphical interface “Keyboard Layout Converter”

  • text input field typed with enabled Latin layout;
  • key “Convert to Belarusian layout”, which starts the conversion and makes it possible to obtain results.
  • output field that displays the summary text, converted to the Belarusian layout.

 

User Guide For Work With The Service

  1. On the Tools page, enter text in the input field that requires translation into the Belarusian layout.
  2. Press the “Convert to the Belarusian keyboard layout.”
  3. View converted text in the output window (see Figure 1).

 

Access To The Service Via The API

To get the text converted to a different layout, you must send a POST request to the AJAX-address http://corpus.by/KeyboardLayoutConverter/api.php. After the array data parameters transmitted an arbitrary input text (text parameter), the keyboard layout, according to which the printed text (inp parameter) and the keyboard layout, which need to convert text (outp parameter).

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

  • text — an arbitrary input text.
  • inp — keyboard layout, according to which the text is printed:
    • be — Belarusian keyboard layout;
    • en — English keyboard layout;
    • ru — Russian keyboard layout.
  • outp — keyboard layout to which you want to convert the text:
    • be — Belarusian keyboard layout;
    • en — English keyboard layout;
    • ru — Russian keyboard layout.

Example of AJAX-request:

$.ajax({
   type: “POST”,
   url: “http://corpus.by/KeyboardLayoutConverter/api.php”,
   data:{
      “text”: “Ckjdf/”,
      “inp”: “en”,
      “outp”: “be”
}
success: function(msg){ }
});

The server returns JSON-array of the input text (text parameter) and scoring converted text (result parameter). For example, the following reply will be formed on the above-listed AJAX-request:

[
   {
      “text”: “Ckjdf/”,
      “result”: “Слова.”
   }

]

An example of using this API — Web-service “converter keyboard via API» (http://corpus.by/KeyboardLayoutConverterViaApi/).

If you have found a spelling error, please, notify us by selecting that text and pressing Ctrl+Enter.