IVI: Sorting and Processing

IVI

Sorting and Processing

Sorting

Command: SOrt

Purpose: Arrange the corefile lines or records in lexical order

Format: SO <digit>|<number>|<number>|<number>

Parameters: As well as the four explicit parameters, all of them optional, there is a fifth, the (column) position of the cursor in the current corefile.

<digit> is either 0 or 1 which specify ascending and descending order respectively.

The order of the lines is determined by the sort-key. In TEXT view, the sort-key begins at the cursor and extends for n characters, where n is the key-length specified by the second parameter. If the key-length is negative, the sort-key runs from the cursor backwards (i.e. right- to-left).

In either of RECORD views, the position of the cursor selects a specific field of a record, and the sort-key is the corresponding field in every record.

The last two parameters define the range of lines over which the sort will proceed. They are often omitted, or they may be replaced by * symbols, with the same interpretation as for the SAve command.

Examples:

SO |5|*|* - sort the starred block in ascending order with key of length 5.

SO 1|-8 - sort the entire corefile in descending order. Sort-keys are compared from right to left with a key-length of 8.

Note: if a column of words is aligned by the right-hand end, this "reverse sort" brings together words with a similar ending:

      walked
      edited
       spoke
    speaking
     walking
     editing
       speak
        walk
      speaks
       walks
       edits
        edit


Word and Sentence Length

This operation was provided for a class of humanities students exploring the use of computers to extract information from literary texts.

Operation: Length tables

Purpose: Construct word and sentence length tables for the text in the corefile

Default Key: <ESC> N

Operation Number: 105

The operation scans the text in the current corefile starting at the cursor and continuing to the end. Word and sentence length tables are appended to corefile 7.


Return to IVI Reference Manual


Last revision: February 27, 2002.