Alphabetizer


The «Alphabetizer» service is designed for getting text strings in alphabetical order. The service receives an arbitrary text or a sequence of characters at the entrance, in which 1 line = 1 unit for alphabetical ordering, and the service will put the input text in alphabetical order by lines. It will also allow you to prioritize characters when sorting or select an alphabet.

 

Access to the service via the API

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

  • text — arbitrary input text.
  • ignoreCharacters — characters to be ignored when ordering.
  • entryDivider — divider, according to which are allocated entries that need to be order.
    • newline;
    • space;
    • comma.
  • alphabet — alphabet name. For example, Belarusian, English, Greek and etc.
  • custom — the user’s own alphabet (if necessary).
  • sorting — direction of ordering.
    • a-z — from lowest to highest;
    • z-a — from highest to lowest.
  • caseSensitive — marker for case sensitive alphabetical ordering.
  • removeDuplicates — marker for removing duplicates from the list while alphabetical ordering.
  • reverseDictionary — marker for alphabetical ordering taking into account the read right-to-left (on the principle of building a reverse dictionary).
  • alignRight — marker for result right alignment.

Example of AJAX-request:

$.ajax({
   type: “POST”,
   url: “https://corpus.by/Alphabetizer/api.php”,
   data:{
      “text”: “Радок з вялікай літары.
радок з маленькай літары.
Радок, які паўтараецца.
Радок, які паўтараецца.”,

      “ignoreCharacters”: “‘ʼ’‘′-̀́””,
      “entryDivider”: “newline”,
      “alphabet”: “Belarusian”,
      “custom”: “”,
      “caseSensitive”: 1,
      “removeDuplicates”: 1,
      “reverseDictionary”: 0,
      “alignRight”: 0
   },
   success: function(msg){ },
   error: function() { }
});

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

  • text — input text.
  • result — resulting alphabetically ordered list.

For example, the following reply will be formed on the above listed AJAX-request:

[
   {
      “text”: “Радок з вялікай літары.
радок з маленькай літары.
Радок, які паўтараецца.
Радок, які паўтараецца.”,

      “result”: “<p>Радок з вялікай літары.<br>Радок, які паўтараецца.<br>радок з маленькай літары.</p>”
   }
]

 

Links to sources

Service page: https://corpus.by/Alphabetizer/?lang=en

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