 APPENDIX C:  Generalized Pseudo-Code for Latin --> Ethiopic Translation


 When programming for applications for Ethiopic script consideration must be
 made for the presence of the user.  During the ascii interpretation from any
 input source there will be updating made to a character as its form number is
 determined from subsequent characters.  We identify and discuss two scenarios
 where a computer is called upon to perform the interface between Latin-Ascii
 and Ethiopic.
 
 The first case is document composition, or the active entry and interpretation
 of Ethiopic from Ascii.  If a user is keying in a document or chatting with a
 friend with an Ethiopic version of Unix "talk", considerable aesthetic appeal
 is found by the user when he or she is rewarded with an Ethiopic character for
 each keystroke.  

 With the convention presented in this document it is the sadis or 6th form 
 Ethiopic character that is represented with a single letter from the Latin
 alphabet.  Hence after one keystrike a vowel or sadis consonant character is 
 sent to the screen.  If the user then strikes a vowel (lowercase) the last
 character, if it was a consonant, is deleted from the screen and is replaced
 with the appropriate form represented by the vowel.  If a vowel is not struck,
 then the new character is sent to the screen and becomes the next candidate
 in the entry cycle available for updating. 

 The basic rules for updating the last character entered are :

 1)  only consonants may be updated by lowercase vowels and the letter "W". 
 2)  vowels will have their screen address modified by the number 2. 
 3)  the consonants h, s, and S will have their screen address modified by
     the number 2 (and 3 for e) and remain consonants.  Thus they remain
     updatable for form number by a following vowel.
 4)  a character is sent to the screen after each update, replacing the
     original.

 The standard entry synopsis is depicted in the illustration below.

 Active Entry Logical Flow For Latin Conversion into Ethiopic :
   _____
  |     |
  |    \|/
  |  read new;
  |  determine new type; 
  |  if edit flag  ------->  update last address with new;
  |     |                    new = updated last;
  |     |                    back-delete over last screen char;
  |     |          <-------  continue
  |     |
  |  if number   --------->  check if number is 2 and last is h,
  |     |                             s, S, or vowel, OR number
 /|\    |                             is 3 and last is e;
  |     |          <-------  If not true continue (number is displayed);
  |     |                    If true :
  |    \|/                      update last address with new;
  |     |                       new = updated last;
  |     |                       back-delete over last screen char;
  |     |          <-------  continue
  |     |
  |  display new;
  |  last = new;
  |_____|


 The edit flag can be set only when the new character (or updated character 
 in the cases of h2, s2 and S2) is recognized as a consonant.  In the case
 of vowels and consonants with 2nd or 3rd forms, the numbers 2 and 3 will act
 to modify the previous address.  

 The second case occurs when the user is not involved with the ascii to Ethiopic
 conversion.  For the translation of a text file, for instance, it is not 
 necessary to follow the same steps as it would be for keyed entry.  In fact it
 would be inefficient to do so.  The same rules follow as for active entry
 except that we do not display the character each time it is updated.  Rather,
 after an update has occurred, the reading cycle starts over, the updated
 character now becoming the last.  Rule 4 becomes:

 4) An Ethiopic character is only sent to output after it has been entirely
    identified.

 The following illustration is given to aid in the description of this process.

 File Read-In Logical Flow For Latin Conversion into Ethiopic : 
   _____ _____________________________/_____________________________
  |     |                             \                             |
  |    \|/                                                         /|\
  |  last = new;                                                    |
  |  read new;                                                      |
  |  determine new type;                                            |
  |  if edit flag  ------->  update last address with new;          |
  |     |                    new = updated last;                    |
  |     |                    break.  -------------------->----------|
  |     |                                                           |
  |  if number   --------->  check if number is 2 and last is h,    |
  |     |                          s, S, or vowel, OR number        |
  |     |                          is 3 and last is e;              |  
 /|\    |          <-------  If not true continue;                 /|\
  |     |                    If true :                              |
  |     |                       update last address with new;       |
  |    \|/                      new = updated last;                 |
  |     |                       break.  ---------------->-----------|
  |     |
  |     |
  |  display last;
  |_____|


 The generic form code below presents the logic sequences that would follow in
 machine translation described in the above for arbitrary input and output
 streams.  Specifics on character addressing and the association of characters
 with addresses is left out in this elementary presentation.  The logic shown is
 given for clarity, its form is reducible in application.  Fully function C
 language routines are available from the authors that perform both kinds of
 Ascii to Ethiopic interfacing.
 
 Pseudo Code for SERA-101*  Machine Translation :
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 BEGIN LOOP :
 {
 
  last = new;   
  new  = read_char(file); 

 [ Determine new's character type : vowel, consonant, number, or punctuation ]
 
   
  if (new = vowel) 
     then 
        if (edit = 1  AND new is lowercase)        // last = consonant
           then 
                new = last + last + form#_of_new;   // update consonant to form
                edit = 0;                           // of new
                [restart loop OR delete last and continue] 
        end if 
  end if 


  if (new = "W")
     then
        new = last + form#_of_new;  
        if (last has 12 forms)
           then
               sadis = 1;         // will be edited to form 8-12 in next cycle
           else
               read_char(new);   // 8 forms only, following "a" read & discarded
           end if
           [restart loop OR delete last and continue] 
  end if


  if (new = number) 
     then 
        if ( (new = "2" AND last = "h","s", "S", or vowel)   OR 
                    (new = "3" AND last = "e")         )
           then
               new = last + address_change_to_2nd_form;
               if (last NOT = "a") edit = 1;
               [restart loop OR delete last and continue] 
        end if
  end if


 // Printing to the Screen or to An Output File is Done Below

  out_put(last);                   // or out_put(new) if delete last was used

  if (new = vowel && edit = 0)
     then
           [restart loop] 
  end if

  if (new = consonant)
     then
          edit = 1; 
     else    
          edit = 0;                // new was a number or punctuation
  end if                          //  and will not be edited next cycle

 } END LOOP, REPEAT LOOP
        

 * SERA-101 :  System for Ethiopic Representation in Ascii for 101 Keyboards.
               A more formal name for "System 6" used in previous sections.

