[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

xpl enigma & translation program



from Morris Krok

 essence@xxxxxxxx

 I have just been analysing Valmond Ghyoot's translation program. A tedious
section deals with changing each capitalized letter of the alphabet with a
symbol, so that any word that is capitalized will have its translation dealt
in the same manner. This aspect of the program is rather long because he
treats a capitalized letter from two aspect with a space before it and
without the space..

 What I want to know is the way to be able to simplify this part of the
program by being able to search for any capitalized letter without the need
to state them separately (52 times). There are wildcard XyWrite functions
for searching for a letter, a number, any character, any separator so why
not for a capitalized letter or is there any other way.

 For those gurus who wish analyze his program because of his unorthodox
approach in writing it, and also it is a feather in the cap of XyWrite if it
had translation capabilities, I am attaching his entire program translat.zip
and also my shortened version of it translat.ars. It was written for XyWrite
3. I could not get it working in Xy4. He loads a file that runs a program
within his program labelled translat.sgt but it is a mystery how this works.
Also when the program is called up in the unexpanded version there is an
error message on the prompt line - invalid formatting command. With all this
the program functions successfully.

In case there is a problem opening translat.zip. I have also attached his
version of the program translat.hrd and translat.txt (an explanation of the
program) and translat.sgt (from my understanding of programming holds a
mystery).

 Rene I downloaded Wordfast and added it to the templates in Microsoft Word.
 >From my understanding of this program it is a translation aid. One of its 13
buttons refers to a dictionary and another to a glossary. In which program
or directory would one place the dictionary. Although it has only a template
status, it appears a rather complex program. Nevertheless I think an XPL
expert should be able to write a program that creates the identical sized
space beneath a one line sentence or a paragraph containing numerous lines.

 A programmer who is capable of making those wonderful little changes that
make all the difference may rightly say, "my genius can only be measured in
inspired bits of seemingly innocuous innovations".

Attachment: translat.zip
Description: Zip compressed data

Attachment: TRANSLAT.ARS
Description: Binary data

Attachment: TRANSLAT.HRD
Description: Binary data

®UFSTANDARD¯®LM0¯®RM78¯®PL285MM¯ ®MDBU¯TRANSLATION ASSISTANCE PROGRAMME : ENGLISH TO AFRIKAANS®MDNM¯  ®SZ8PT¯August 31, 1987®SZ12PT¯
                                      
®IP0,4¯®FS1

---------------------------

¯
1. The programme runs only under XyWRITE version 3 and later versions. ®FN1 If you use
Displaywrite, see the comment at the end of this document.¯ It is relatively slow.
Translating a 2,5k file takes approximately fifteen minutes on an Olivetti M24 (8086 processor
running at 8 Mhz). An 80k file takes approximately 3 hours. Let it run overnight when translating
a long file.                                   
                                       ®IP0,7¯
2. Do the following in order to translate a file from English into Afrikaans: 
                                        
  a. Load XyWrite 3                             
  b. Put the translation disk in Drive A:                  
  c. Call the file you want translated and then run the translator as follows:         
                       
    ®MDNM¯                                  
®IP7,7¯
®MDBO¯®MDNM¯                                  
®MDBO¯run a:translat.eta®MDNM¯               ®MDBO¯ 
      ®MDNM¯    
®MDBO¯®MDNM¯®MDNM¯                                
                                    
On a hard disk copy the entire disk to a directory and then:      
                                    
                     ®MDBO¯              
                     run translat.hrd        
                     ®MDNM¯            
                                    ®IP¯
3. The programme works as follows:                                
     
                                       ®IP4,4¯
The file to be translated is stored as "TRANSLAT.AFR", all nine windows are cleared and
the file is called back again. (Note that the programme uses all nine windows. Text in windows
other than the current window will be lost unless you store them before running the translation
programme. The programme also uses its own specialised savegets, which will overwrite yours. In
the interests of speed, the display is also modified. These changes may be reset by simply running
your own STARTUP.INT file again after translation has been completed.)              
   

The screen is set to expanded mode, in order to show all hidden XyWRITE commands.         
                       
                                      
Words are separated from symbols such as carriage returns, commas, fullstops, brackets and embedded
XyWRITE commands.             
                                      
The dictionary files are loaded (from drive A: on a floppy system) and translation is done on a word
for word basis, using the CHANGE INVISIBLE (CI) command.                     
         
                                       ®PG¯
After the translation is completed, symbols such as commas, fullstops, brackets and XyWRITE commands
are shifted back to where they were.     
                                      
Most translated words are now in lower case. Upper case is restored where applicable and the file
is stored on the default drive as "TRANSLAT.AFR". 
                                     ®IP0,4¯
4. Since the programme translates mostly on a word-for-word basis, the grammar of the resulting
translation is usually poor, depending on the style and content of the original.         
             
                                        
5. Alternative translated words are sometimes given and are separated by #. For example,
®MDBO¯accounting®MDNM¯ would be translated as
®MDBO¯boekhouding#rekeningkunde®MDNM¯. 
                                        
6. Verbs are often placed at the end of sentences in Afrikaans. In order to give the user the
final choice, some verbs are translated where they occur within a sentence, but are
®MDUL¯duplicated®MDNM¯ ®MDNM¯at the end of the sentence. Delete the
misplaced word when you edit the translated file.           
                                        
7. The programme will perform 40 translations before renewal is necessary.  

8. A customization service is available. This includes modifying the existing dictionaries
according to your requirements, or creating new dictionaries for translation from any language to
one or more other languages. Enquiries should be addressed to:                 
                                       ®IP4,4¯
Valmond Ghyoot        Telephone (012) 429 4457 mornings       
P.O. Box 167              (011) 953 3442 afternoons      
1745 Rant en Dal                              
South Africa         August 31, 1987                
                                      
*******************************************************************  

                                       
®MDBU¯INSTRUCTIONS FOR MODIFYING THE DICTIONARIES®MDNM¯            
   
                                       
The programme file is called translat.eta (floppy disk version - translat.hrd on a hard disk). You
should not modify this file.        
                                           
The two DISP files set the display to achieve greater speed.                   
       
                                       
The English to Afrikaans dictionaries may be modified. They are:     
                                       
  Trandict.eac ÄÄ> Place phrases unique to your subject area here   
  Trandict.ea0 ÄÄ> Place other specialised words and phrases here   
  Trandict.ea1 ¿                              
  Trandict.ea2 ³                              
  Trandict.ea3 ³                              
  Trandict.ea4 ÃÄÄÄÄ> These dictionaries contain common words       
  Trandict.ea5 ³                              
  Trandict.ea6 ³                              
  Trandict.ea7 Ù                              
  Trandict.eav ÄÄ> This dictionary contains verbs that are duplicated 
           at the end of a sentence when they are replaced.  
                                       
The programme assumes that these dictionary files are in Drive A: on a floppy system.       
                                        
                                       
Within any dictionary file, an English word or its translated equivalent may be changed by simply
calling the file and editing it normally from within XyWRITE. Take care not to disturb the
programme instructions, spaces, slashes (/), the marker (­) at the start of each Afrikaans
word, or the marker () that separates alternative Afrikaans words. The dictionary files are sorted
in alphabetic sequence. Take care not to disturb this.                      
            
                                       
The following are examples of translation instructions, using the CI (change invisible command): 
                           
                                       
®MDBO¯BC ci / ®MDNM¯abbreviated®MDBO¯ /
®MDNM¯®MDBO¯­®MDNM¯afgekort®MDBO¯ /®MDNM¯
®MDBO¯BC ci / ®MDNM¯abilities®MDBO¯ /
®MDNM¯®MDBO¯­®MDNM¯vermoe?ns®MDBO¯ /®MDNM¯
ÀÄÄÂÄÄÄÙ                       
         
  ³       Do not disturb spaces, slashes (®MDBO¯/®MDNM¯) or marker
(®MDBO¯­®MDNM¯)       
                                       
  Do not disturb these programme instructions and spaces. They       
  appear only in TRANDICT.EAC and TRANDICT.EA0 . The other dictionaries   
  contain words, slashes (®MDBO¯/®MDNM¯) spaces and
(®MDBO¯­®MDNM¯) only, as in the following    
  examples:                                 
                                       
®MDNM¯abbreviated®MDBO¯ /
®MDNM¯®MDBO¯­®MDNM¯afgekort®MDBO¯ /®MDNM¯
®MDNM¯abilities®MDBO¯ /
®MDNM¯®MDBO¯­®MDNM¯vermoe?ns®MDBO¯ /®MDNM¯
                                     
If an English word translates into an Afrikaans phrase, the instructions appears as follows:   
                       
                                     
failing ®MDBO¯/
®MDNM¯®MDBO¯­®MDNM¯te®MDBO¯®MDNM¯®MDBO¯
­®MDNM¯misluk®MDBO¯ /®MDNM¯
                                     
When an alternative Afrikaans word is given, the instruction appears as follows:
ÄÄÄÄÄÄÄÄÄÄ¿                
         
                                     
familiar ®MDBO¯/®MDNM¯
®MDBO¯­®MDNM¯vertroud®MDBO¯®MDNM¯bekend
®MDBO¯/®MDNM¯
                                     
      ³    ÀÄÄÄÄÄÄÄÄÄ> This marker is replaced by ®MDBO¯#®MDNM¯ in the    
      ³          completed translation.          
      ³                               
      ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ> This marker is removed from the      
                completed translation.          
                                     
                                     
All the dictionary files may be changed or expanded. In order to add new words to a dictionary,
copy any line downwards as many times as needed and then insert or overtype your own words, taking
care not to disturb the syntax of the command.                          
                                     
®MDBO¯TRANDICT.EAC®MDNM¯ runs before the other dictionaries. It is the most
specialized, and is used to customize the translation process for your particular application.
Include your own specialised words, or even phrases, with their translated equivalents here. Your
specialised translation will then replace the more general translations contained in Dictionaries 0
to 7.  
                                     
®MDBO¯TRANDICT.EA0®MDNM¯ runs next. It contains exceptions which would be
translated incorrectly by the standard dictionaries.                  
                                     
®MDBO¯TRANDICT.EA1 through TRANDICT.EA7®MDNM¯ contain common words, sorted
alphabetically and then divided between the 7 dictionaries. When adding words to these
dictionaries, the alphabetic arrangement must be observed, otherwise the new words will not be used
by the programme.                 
                                     
®MDBO¯TRANDICT.EAV®MDNM¯ contains certain verbs that should probably occur at
the end of the sentence in Afrikaans. Should you add words to this file, delete these words from
the relevant common word dictionary (dictionaries 1 through 7). If this is not done, the verb will
not be placed at the end of a sentence.                              


                                     
******************************************************************* 
                                     
®MDBU¯INSTRUCTIONS FOR DISPLAYWRITE USERS®MDNM¯                
   
                                     
Displaywrite files may be converted to and from XyWrite format by using the XyWrite-provided D2X.EXE
and X2D.EXE files. Formatting will be preserved.                         
      
                                     
TO CONVERT TO XYWRITE:                          
                                     
At the MSDOS prompt, type:                        
              D2X yourfilename                
                                     
TO CONVERT BACK TO DISPLAYWRITE:                     
                                     
At the MSDOS prompt, type:                        
              D2X yourfilename                
                                     
*******************************************************************   

Attachment: TRANSLAT.SGT
Description: Binary data