Text Translator 0.2,  1990 Graham Steel


1  Nomenclature

Txlat  is  a utility designed to perform a simple  word  for  word 
translation  from German (or any other language whose alphabet  is 
supported on the Atari ST) into English. It is designed for use by 
people  like  myself  who have never  studied  German.  It  cannot 
produce  as  good a translation as a person who has  studied  some 
German.  Imagine that you know no German,  but you have a piece of 
German  text and a German to English dictionary:  you  could  work 
through the text word by word and translate each one in turn. This 
is what Txlat does.  It makes no attempt to rearrange words  where 
the rules of grammar differ between English and German (it  cannot 
distinguish between,  say,  nouns and verbs).  It deals with  each 
word in isolation:  where the meaning of a word is dependent  upon 
its context, the context is ignored.

I  wrote Txlat in order to translate the documentation for  German 
Public  Domain programs into English.  I think that this  kind  of 
source  file is reasonable for brute force  translation:  not  too 
vast a vocabulary;  not too many tenses.  I suspect that it  would 
not be so useful for translating literature.  It works on straight 
text files.  It may also work on some word processor files: I have 
tried  it  on a First Word file and it seemed ok,  but  watch  for 
alphabetic characters embedded in control sequences - they will be 
interpreted as words!

Txlat comprises this documentation, two programs, and a German 
to  English dictionary;  all as disk files.  The author  maintains 
copyright to the programs and this accompanying documentation, but 
not the supplied dictionary. The programs and documentation may be 
copied  freely  but not sold,  other than for  reasonable  service 
charges such as may be made by a Public Domain Library. You can do 
what you like with the dictionary.


1.1  Disclaimer

The  author  does  not  guarantee  the  accuracy  of  either   the 
dictionary or the operation of the programs,  and will not be held 
responsible  for  any  matter  arising  from  a   misunderstanding 
resulting from a mistranslation performed by the programs. You are 
advised  to  maintain back-up copies of all files  on  disks  used 
during the operation of these programs (as is the case with use of 
any  computer program).  The author accepts no responsibility  for 
the  loss of any data occurring during the use of either of  these 
programs.


1.2  Credits

The  original  Txlat was developed by Graham Steel in  August  and 
September 1990,  and the current version in November 1990,  on  an 
Atari  STE.  The source code is written in 'C' and compiled  using 
the  Sozobon  compiler.  The  German  to  English  dictionary  was 
prepared  with  the  aid of the Collins  Pocket  Reference  German 
Dictionary ( 1989 William Collins Sons & Company,  Limited). This 
documentation  was prepared using First Word ( 1985 GST  Holdings 
Limited).


2  Using TXLAT

2.1  Components of TXLAT

Txlat comprises of the following:

     txlat.ttp: The main program that performs the translation.
     addtodic.ttp: A utility to merge a new list of words into the 
     main dictionary.
     german.dic: A German to English dictionary.
     txlat.doc: This documentation, in First Word format.
     txlat.txt: This documentation as a text file.


2.2  Overview of operation

In order to perform a translation,  the computer needs to be  able 
to  access txlat.ttp,  german.dic,  and the file to be  translated 
(let  us  call it sample.txt).  Txlat creates  a  translated  file 
(sample.eng)  and  a  list of words that it  could  not  translate 
because they were not in the dictionary (new.dic).  You may prefer 
to perform translations with txlat.ttp and sample.txt on different 
disks.  The dictionary can be held on the Txlat disk, or, if Txlat 
is  being  run  from  a  shell,  in  any  directory  in  the  PATH 
environmental variable.  The files sample.eng and new.dic will  be 
created on the latter disk.

Txlat can be run from either the GEM desktop or from a shell  such 
as Gulam.

Having  run  Txlat,  you  can proceed in any  of  at  least  three 
directions:
     1.   Accept  the  resulting  sample.txt  (although  you  will 
          probably want to use a text editor to tidy it up).
     2.   Using  a  reference German to English dictionary  and  a 
          text editor,  add translations to the file new.dic.  Run 
          the  addtodic  utility,  and then re-run Txlat  (on  the 
          original    sample.txt,    not    the    half-translated 
          sample.eng).
     3.   Using  a  text  editor,   change  some  of  the  English 
          translations   in  german.dic  (eg,   because   it   has 
          mistranslated  words).  You  can use a  text  editor  to 
          delete  words from german.dic.  You can also use a  text 
          editor  to add words directly to german.dic,  but it  is 
          preferable  to  add words to new.dic  and  run  addtodic 
          instead.  Then  re-run  Txlat (again,  on  the  original 
          sample.txt).

Txlat can be used to translate from other languages (eg,  French). 
You   will  need  to  create  a  French  to   English   dictionary 
(french.dic),  and  specify the language as French  when  invoking 
txlat.ttp.


2.3  Invoking Txlat

Txlat will work in any screen resolution,  although the display in 
low-res will be truncated, so medium or high-res is better.

Txlat.ttp is a TTP (Tos Takes Parameters) program.  If you  double 
click from the desktop, you must enter the language (optional) and 
the name of the file to be translated into the TTP dialogue box:

     [-french] sample.txt
     ---------------------------

where the square brackets indicate that the parameter is  optional 
(the default language is German). If you start Txlat from a shell, 
the parameters must be supplied in the usual manner:

     txlat [-french] sample.txt

You  can  specify a full or partial path name  for  sample.txt  if 
necessary. For example, double click on txlat.ttp and specify

     -danish b:\docs\sample.txt
     ---------------------------

The dictionary (german.dic,  french.dic or whatever) may reside on 
either the current drive (in the current working directory) or (if 
you are using a shell such as Gulam) in any directory specified in 
the PATH environment variable.  Txlat looks in the current working 
directory first.

Txlat gives a running commentary of what it is doing, typically:

     TXLAT 0.2 (Text Translator),  1990 Graham Steel 
     Reading dictionary ... Done 
     Sorting ... Done 
     500 words in dictionary, filled 0% of available RAM 
     Translated  1081 words, failed on   119 words 
     Re-reading new words ... Done 
     Sorting ... Done 
     Rewriting new words ... 55 distinct new words 

     Press 'Q' to exit 

Txlat works by reading the dictionary into RAM,  and then  reading 
the  input  file (eg,  sample.txt) word by word and  creating  the 
output file (eg, sample.eng) word by word. The statistic
     500 words in dictionary, filled 0% of available RAM 
gives you an idea of how far you can extend the dictionary. My STE 
has 2.5Mb of RAM,  and you can see that my current dictionary uses 
less than 1% of the free RAM. If you run short of RAM, try running 
Txlat without any desktop accessories, RAM disks, etc.

The  count  of  words  translated  and  words  failed  is  updated 
continually  as the translation progresses.  Txlat  considers  any 
sequence of alphabetic characters to be a word,  and in the  above 
example it found 1200 words (1081 + 119).

As  the  translation  progresses,  the words  that  could  not  be 
translated are written to a temporary disk file (and also  written 
untranslated to the output file sample.eng).  In the example,  119 
words  are written to this file.  However,  many of these will  be 
duplicates.  After  the translation is finished;  the program  re-
reads the temporary file, sorts the words into alphabetical order, 
and  writes  them  out  to  the  file  new.dic,   eliminating  the 
duplicates. In the example, there were only 55 unknown words after 
eliminating the duplicates.

The  "Press 'Q' to exit"  instruction  is  provided  so  that  the 
display  does  not disappear immediately when Txlat is  being  run 
from the desktop.


2.4  Updating the dictionary: AddToDic

Normally,  when  translating  a file,  Txlat will  create  a  file 
new.dic containing the words that it did not recognise.  The words 
are listed in alphabetical order,  one per line.  It is a straight 
forward text file, so you can edit it with any text editor. If you 
are  not familiar with German,  you will need a German to  English 
dictionary  (or  whatever  source language  you  were  translating 
from).

Load new.dic into a text editor in order to examine the  contents. 
Some  of  the words you will not want  to  translate;  eg,  proper 
nouns.  You  should delete the lines containing  these  words;  or 
alternatively, type the word again, exactly as is, to the right of 
itself.

Each  entry in new.dic must occupy one line.  In order to add  the 
entries to the dictionary,  each line must adhere to the following 
format:
     <German word><White space><English translation>
                         <White space><Optional comment>
that is, just as in the file german.dic. You may use lower case or 
upper  case when providing translations in new.dic,  but you  will 
see that when Addtodic recreates a dictionary,  it will use  lower 
case for the German words and English translations.  Comments  can 
be  in any format:  they will be transcribed into the  dictionary, 
but  otherwise  ignored.  Each  English translation  need  not  be 
restricted  to  a single word,  as long as it  contains  no  white 
space. You may like to use underscores where two or more words are 
really  required  for  the translation,  or you may  wish  to  use 
obliques to list two or more possible translations:  both of these 
concepts are used in the supplied german.dic.

Some  words  you  may  fail to find  in  your  German  to  English 
dictionary.  Load  the half-translated .ENG file into your  editor 
and  search for the German words that you  cannot  translate:  the 
context may help you. If it does not, simply delete the lines from 
new.dic.  You  can  half-update the  dictionary,  retranslate  the 
German  file,  and  have another go with the difficult  words  the 
second  time  around.  For every line in the  new.dic  created  by 
Txlat, you must either provide an English translation or delete it 
from  the file.  You can only update the dictionary once  this  is 
done.

To merge the words in the edited new.dic into  german.dic,  simply 
run the program AddToDic.ttp with no parameters.

AddToDic  provides  a  running commentary of  what  it  is  doing, 
typically:

     ADDTODIC 0.2 (Txlat Dictionary Updater),  1990 Graham Steel 
     Reading Dictionary ... Done 
     Reading new words ... Done 
     Sorting ... Done 
     Rewriting dictionary ... 554 words in new dictionary 

     Press 'Q' to exit 

It reads the existing dictionary,  followed by the new words file, 
into  RAM.  It  performs a sort,  and rewrites the  words  to  the 
dictionary,  eliminating any duplicates. In the example above, the 
resulting dictionary contains 554 entries.

You can add words from another file into the dictionary,  provided 
that that file followed the same format as prescribed for new.dic. 
For example, to add the contents of mywords.txt to german.dic, you 
should invoke AddToDic as follows:

     addtodic.ttp mywords.txt

To update a French dictionary you would invoke AddToDic as

     addtodic.ttp -french

And to update a French dictionary with your own file:

     addtodic.ttp -french mywords.txt


2.4.1  Merging Dictionaries

If you have friends who also use Txlat,  you will probably wish to 
merge  the  contents  of your dictionaries.  You can  do  this  by 
running   AddToDic,   using  your  own  dictionary  as  the   base 
dictionary,  and  specifying your friend's dictionary as  the  new 
words file.  However, you must first remove the alphabet from your 
friend's dictionary (and to avoid possible confusion, rename it to 
new.dic). Where there are words common both to your dictionary and 
your friend's dictionary,  AddToDic will eliminate the duplicates: 
the translations in the base dictionary will take precedence  over 
the translations in the new words file.


2.5  Updating the dictionary manually.

The  german.dic  file is a text file:  you may edit  it  manually. 
Typically, you would edit this file to:

     - Remove words from the dictionary
     - Change the English translation for a word

If you find a word in new.dic about which you cannot quite make up 
your   mind;   provide  some  distinctive  translation   for   it, 
remembering that you can edit german.dic to suit at a later date.

You may freely remove unwanted lines from german.dic (but not  the 
alphabet  on  the  first  line!).   You  may  change  the  English 
translations or the comments of entries in german.dic. You may add 
completely new entries to german.dic, or change some German words; 
but  it is better to do this by adding the new entries to  new.dic 
and  running Addtodic.  After reading the dictionary,  and  before 
starting a translation,  Txlat sorts the dictionary to ensure that 
the words are in alphabetical order,  or rather,  ascii order (the 
accented letters will make the job of ordering difficult for human 
beings).  By using Addtodic,  the dictionary will be kept in ascii 
order and Txlat might run a little faster.


3  Creating Dictionaries for other Languages

There is no point in spending tedious hours creating a great  long 
dictionary  full of words that you are never going to  use.  Txlat 
will  tell you just what words you need,  by writing them  to  the 
file  new.dic.  The  initial dictionary for a  new  language;  eg, 
French;  need  be  set  up with just the alphabet  of  the  source 
language.  See the first line in the supplied german.dic.

You must create a file french.dic with the French character set on 
the first and only line of the file.  Enter the standard  alphabet 
A-Z,  and  examine the Atari character set to select the  accented 
characters used by your source language.  If you omit a  necessary 
character, the effect will be that Txlat will treat that character 
as punctuation.  When you realise that you have missed a necessary 
character from the alphabet,  you can edit your file french.dic to 
include it.

Now you can try translating a French text file:

     txlat.ttp -french lemonde.txt

Txlat  will create a file LeMonde.Eng that looks very  similar  to 
the  original LeMonde.txt.  The vocabulary of LeMonde.txt will  be 
sorted  into alphabetical order and written to the  file  new.dic. 
Now  follow section 2.4:  edit new.dic,  run AddToDic.ttp (do  not 
forget the -french parameter),  and you have a French  dictionary! 
Run Txlat a second time to obtain a more satisfactory  translation 
LeMonde.Eng.


4  Limitations

Txlat is very simple,  in that it regards a word as a sequence  of 
alphabetical characters delimited by non-alphabetical  characters. 
It  is  unable to deal with punctuated words or groups  of  words, 
such as the common use of the apostrophe in English.  For example, 
it would regard the English word "isn't" as two words:  "isn"  and 
"t". I am ignorant as to how common the use of such punctuation is 
in other languages;  if you come across it,  you will have to work 
out how best to cope.

Common abbreviations consisting of just a string of letters should 
cause  little problem:  just pick an appropriate translation  when 
the string appears in the file new.dic.

Colloquial words can be translated straight forwardly,  if you can 
recognise  them.  Colloquial phrases will cause  more  difficulty, 
since   Txlat  tries  to  translate  everything  word  for   word; 
literally.

Context dependent words are a definite problem.  Sometimes a  word 
on  its own has little meaning;  but a pair of words,  or  even  a 
bigger  group of words;  has to be translated as a  phrase.  Txlat 
cannot  cope with this:  you will have to make do with  a  literal 
translation.

My  German to English paperback dictionary advertises "over  70000 
translations"  on the back cover.  I do not expect to need such  a 
big vocabulary. Nevertheless, the potential is there to exceed the 
capacity  of your machine with too big a dictionary.  This is  why 
Txlat   announces  the  percentage  of  available  RAM  that   the 
dictionary has occupied as it runs. If it exceeds 100%, Txlat will 
report an error and abort. The solution is to edit your dictionary 
and  delete what you consider to be the least valuable  words.  If 
you  keep  your  dictionary  on  floppy  disk,  the  size  of  the 
dictionary  is obviously also constrained by the capacity  of  the 
disk.

In fact,  AddToDic is more likely to report an error before Txlat, 
since  it reads the comments within the dictionary  whereas  Txlat 
discards these. When this happens, you have a choice:
   - delete some of the words from new.dic.
   - delete some of the words from german.dic.
   - retain the words but delete the comments from either  new.dic 
     or german.dic.


5  Error Messages

5.1  Txlat Errors

The  error  messages are supposed to be  self-explanatory,  but  a 
brief description follows:

     Usage: txlat [-language] sourcefile
     You must specify the file to be translated 
Txlat was not invoked properly. See the syntax in section 2.3.

     Failed to open GERMAN.DIC 
Txlat could not find the dictionary. The specified dictionary must 
reside in the current working directory (or within a directory  in 
the PATH environmental variable when invoking Txlat from a shell).
Check whether you specified the language correctly when using  the 
"-language" option.

     Failed to open SAMPLE.TXT 
Txlat could not find the file to be translated.  Did you spell the 
filename correctly?  Did you specify the correct pathname for  the 
file?

     Cannot allocate RAM for dictionary 
I do not really expect this error to occur.  Txlat determines  the 
amount  of free RAM in the system and tries to reserve it for  the 
dictionary,  but in this case the operation has failed.  Maybe you 
have no free RAM or you have corrupted operating system RAM.

     Dictionary overflow after 500 words 
The dictionary is too big for your machine (it is stored in  RAM). 
Txlat  managed  to  read 500 words (number  will  vary)  from  the 
dictionary:  this  will  give  you  an idea of  by  how  much  the 
capacity  has been exceeded.  You can increase the amount  of  RAM 
available by removing accessories,  RAM disks, etc; or by buying a 
RAM upgrade.  Alternatively you will have to edit your  dictionary 
and remove some words until it will fit into your machine.

     Failed to write to file 
Txlat failed whilst writing the .Eng file.  Your disk may be full, 
or be faulty.

     Word is too long: superkalifragillisticexpialidociou 
Txlat  has an internal limit on the size of word that it can  deal 
with.  In the current version this is 35 characters.  If I  become 
aware  of words longer than this existent within potential  source 
languages,  I will change the limit in a future version. The first 
35  characters of the word that Txlat failed on are  displayed  in 
the message.  You should edit your source file  (eg,  sample.txt), 
change the long word into something shorter, and run Txlat again.

     Translated 1081 words, failed on 119 words 
This is not an error message, just a status message. It means that 
there are some words present in your source file (eg,  sample.txt) 
that are not in your dictionary (eg, german.dic). These words will 
be written to file new.dic. See section 2.4.

     Failed to close SAMPLE.ENG 
     Failed to close NEW.DIC 
Another filing error.  Your disk may be full,  or corrupted.  Sort 
out the problem and re-run Txlat.

     Failed to get word no. 452 
A  filing  error whilst rereading the new words  file.  I  do  not 
really expect this error to occur. I would suspect a corrupt disk.

     New words overflow after 2000 words
After initially writing the unrecognised words in your source file 
to disk,  Txlat reads them back into RAM in order to sort them and 
create  the  file  new.dic in  alphabetical  order.  This  message 
indicates that you have exceeded the capacity of your machine. Try 
removing  accessories,  RAM disks,  etc;  and rerun Txlat.  Buy  a 
memory  upgrade.  Or alternatively,  use an editor to divide  your 
source file into two or more files (eg, sample1.txt, sample2.txt), 
and try translating each file in turn.

     Failed to rewrite NEW.DIC after 50 words 
A  filing error when writing the file new.dic.  Your disk  may  be 
full or corrupt. Sort out the problem and rerun Txlat.

     Failed to close NEW.DIC       
Another filing error whilst writing the file new.dic.  Again, your 
disk may be full or corrupt.




5.2  AddToDic Errors

     Dictionary overflow after 900 words 
     Try stripping comments 
AddToDic tries to read the entire contents of your dictionary  and 
the file new.dic into RAM,  and has exceeded the capacity of  your 
machine. Remove accessories, RAM disks, etc; and try again. Or buy 
a memory upgrade.  Or do as the message says,  and remove comments 
from  the entries in your dictionary and the file  new.dic.  As  a 
last resort,  you could just delete some of the entries in  either 
the dictionary or new.dic.

     Failed to open GERMAN.DIC 
AddToDic could not find the dictionary.  The specified  dictionary 
must  reside  in  the  current  working  directory  (or  within  a 
directory  in  the  PATH  environmental  variable  when   invoking 
AddToDic from a shell).  Check whether you specified the  language 
correctly when using the "-language" option.

     Failed to open NEW.DIC 
AddToDic could not find the new words file. It must be resident in 
the  current working directory (or within a directory in the  PATH 
environmental variable when invoking AddToDic from a shell).

     Cannot allocate RAM for dictionary 
I  do not really expect this error to occur.  AddToDic  determines 
the  amount of free RAM in the system and tries to reserve it  for 
the dictionary,  but in this case the operation has failed.  Maybe 
you have no free RAM or you have corrupted operating system RAM.

     Failed to write new dictionary 
A filing error has occurred immediately Txlat tried to rewrite the 
new dictionary (eg,  german.dic). Your disk may be full, or write-
protected,  or  corrupt.  Sort  out the problem and  run  AddToDic 
again.

     Failed to rewrite GERMAN.DIC after 34 words 
A  filing error has occurred whilst rewriting the new  dictionary. 
Your  disk may be full or corrupt.  Sort out the problem  and  run 
AddToDic again.

     Failed to close GERMAN.DIC 
Yet another filing error whilst rewriting the new dictionary. Your 
disk may be full or corrupt. Sort out the problem and run AddToDic 
again.

     Failed to create backup dictionary 
Before updating the dictionary, AddToDic first makes a backup copy 
(a  file  with the extension .OLD).  This  operation  has  failed, 
probably because the disk is full or write protected. Sort out the 
problem and run AddToDic again.


     German word is too long: superkalifragillisticexpialidociou 
Txlat  (and therefore AddToDic) has an internal limit on the  size 
of word that it can deal with.  In the current version this is  35 
characters.  If I become aware of words longer than this  existent 
within  potential source languages,  I will change the limit in  a 
future version.  The first 35 characters of the word that AddToDic 
failed on are displayed in the message. You must remove this entry 
from new.dic: Txlat will not be able to cope with it anyway.


     English word is too long: superkalifragillisticexpialidociou 
AddToDic has an internal limit on the size of translation that  it 
can deal with. In the current version this is 80 characters, which 
I regard to be more than adequate.  The first 35 characters of the 
word  that AddToDic failed on are displayed in  the  message.  You 
must abbreviate the translation in this entry in new.dic and rerun 
AddToDic.



6  Future Development

In  general,  Txlat translates a file line by line,  so that  each 
line of the output corresponds to the same line within the  input. 
However,  this  process  may  result in a  line  longer  than  the 
original. If a translated file contains lines longer than, say, 80 
characters,  this  may  cause problems for text  editors  or  when 
printing.  Txlat  therefore carries out a very crude  wrapping  of 
lines, specifically, immediately prior to any character not in the 
alphabet.  This  may result in a wrap in undesirable  places;  for 
example,  in  the  middle  of a string  of  digits.  It  would  be 
preferable to wrap on a space or tab,  or failing that,  on a real 
punctuation character.

Txlat  and AddToDic should display error messages on a  new  line. 
The  current versions sometimes display a status line and then  an 
error message on the same line.

Txlat  and  AddToDic  should perform a little  validation  on  the 
dictionary  and  the new words file.  In tests  7.5.15  to  7.5.17 
below, they do not indicate that anything untoward has happened.


7  Testing

The  following  testing  is carried out to  provide  a  reasonable 
degree of assurance in the operation of Txlat:

7.1  Txlat can handle all combinations of parameters

Txlat should work for each of the following invocations:
     txlat.ttp sample.txt 
     txlat.ttp -german sample.txt 
     txlat.ttp -french sample.txt 

7.2  Txlat can handle multiple disk systems

Txlat should work for each of the following invocations:
     txlat.ttp a:\sample.txt 
     txlat.ttp b:\sample.txt  
     txlat.ttp d:\sample.txt 
Set up the Gulam variable PATH to a:\,d:\. Put a copy of txlat.ttp 
on drive a and the dictionary on drive d.  Check that it will  run 
ok.
Put a copy of txlat.ttp on drive d and the dictionary on a.  Check 
that it will run ok.
 

7.3  AddToDic can handle all combinations of parameters

Txlat should work for each of the following invocations:
     addtodic.ttp 
     addtodic.ttp mywords.txt 
     addtodic.ttp b:\mywords.txt 
     addtodic.ttp -french 
     addtodic.ttp -french b:\mywords.txt 

7.4  AddToDic can handle duplicate words

Copy  several entries from german.dic to new.dic.  Duplicate  this 
block  of  entries  within new.dic.  Change some  of  the  English 
translations  and/or  comments.   Run  AddToDic.   Check  the  new 
German.Dic.  There should be exactly the same number of entries as 
there were before, with no duplicates.

7.5  Error handling

7.5.1     Create  an  almost full disk on which to run  Txlat  and 
          AddToDic.  Run  Txlat so that a disk full error  occurs. 
          Verify  that  the  error  is  reported,   and  that  the 
          dictionary and source file are intact.
7.5.2     Run  AddToDic so that a disk full error  occurs.  Verify 
          that  the  error  is reported,  and  that  the  original 
          dictionary and new words file are intact.

7.5.3     Run  Txlat  and  specify  a  non-existent  file  to   be 
          translated.   Check   that  the  appropriate  error   is 
          reported.
7.5.4     Move  or  rename the file  german.dic,  and  run  Txlat. 
          Verify that it reports that it cannot find german.dic.
7.5.5     Run  Txlat,  specifying the language option as  "-urdu". 
          Verify that it reports that it cannot find urdu.dic.
7.5.6     Delete the file new.dic, if it exists, and run AddToDic. 
          Verify  that  it reports that it cannot  find  the  file 
          new.dic.
7.5.7     Move  or rename the file german.dic,  and run  AddToDic. 
          Verify that it reports that it cannot find german.dic.

7.5.8     Set  the  write  protect tag on the disk  to  which  the 
          English  translation is to be written,  and  run  Txlat. 
          Verify   that  it  reports  that  it  failed   to   open 
          sample.eng.
7.5.9     Set  the  write  protect  tag  on  the  disk  containing 
          german.dic  and new.dic.  Run AddToDic.  Verify that  it 
          reports that it failed to rewrite the file german.dic.

7.5.10    Edit the file sample.txt, and plant a word 36 characters 
          long.  Run Txlat and verify that it reports the word  as 
          being too long.

7.5.11    Install   a  RAM  disk  and/or  create   an   artificial 
          dictionary  so  large that insufficient RAM  remains  to 
          hold  the dictionary (words need not be in  alphabetical 
          order for such a dictionary).  Run Txlat and verify that 
          it reports dictionary overflow.
7.5.12    Now  reduce  the  size of the RAM disk or  of  the  file 
          german.dic  bit  by  bit,   running  Txlat,   until  the 
          translation   appears  to  succeed.   Verify   that   no 
          unexpected  errors  occur  (eg,   bombs)  and  that  the 
          translation has indeed been successful.
7.5.13    Install   a  RAM  disk  and/or  create   an   artificial 
          dictionary  so large that there is insufficient  RAM  to 
          hold  the contents of the dictionary  and  new.dic.  Run 
          AddToDic and verify that it reports dictionary overflow. 
          Check that the dictionary has been preserved,  either as 
          german.dic or german.old.
7.5.14    Now  reduce  the  size of the RAM disk or  of  the  file 
          german.dic  or  new.dic bit by  bit,  running  AddToDic, 
          until the dictionary update appears to  succeed.  Verify 
          that no unexpected errors occur (eg, bombs) and that the 
          new  dictionary  contains  all  the  words  provided  in 
          new.dic  (note:  any  duplicate  words  will  have  been 
          eliminated).

7.5.15    Rename some arbitrary file to german.dic (ie,  create an 
          invalid dictionary).  Run Txlat and verify that  nothing 
          unreasonable happens (there should be no bombs,  but you 
          must allow for garbage in, garbage out).
7.5.16    With  the same invalid  dictionary,  run  AddToDic,  and 
          again verify that the behaviour is reasonable.
7.5.17    Now  reinstate  a valid german.dic file  but  create  an 
          invalid  new.dic file.  Run AddToDic.  Verify  that  the 
          behaviour is reasonable.


7.6  AddToDic  gives  precedence to the  dictionary  when  new.dic 
     contains duplicate words.

Create  a  dummy  spanish.dic with an alphabet and  a  few  sample 
translations  in it.  Copy this file to new.dic.  Edit new.dic  to 
remove the alphabet,  and change the English translations. Now run 
AddToDic,  specifying  -Spanish as the language  parameter.  Check 
that  the resulting dictionary contains no  duplicate  words,  and 
that the original dictionary translations appear rather than those 
in new.dic.


7.8  AddToDic is not case sensitive to the dictionary.

Run  Txlat on a German file to obtain a sample  new.dic.  Add  the 
translations to new.dic. Also capitalise some of the German words. 
Now  run  AddToDic  and check that the German  words  and  English 
translations in the resulting dictionary are all in lower case.


7.9  Txlat is not case sensitive to the dictionary.

Run  Txlat  on  a  sample German  file,  and  rename  the  English 
translation to some other filename. Edit German.Dic and capitalise 
some of the German words.  Now run Txlat on the same German  file. 
Check  that the resulting translation is the same as  the  renamed 
one obtained previously.


7.10 Txlat   is  not  dependent  upon  the  dictionary  being   in 
alphabetical order.

Run  Txlat  on  a  sample German  file,  and  rename  the  English 
translation  to some other filename.  Edit German.Dic and  reorder 
the  entries  (ie,  delete  blocks of entries  and  reinsert  them 
elsewhere).  Now run Txlat on the same German file. Check that the 
resulting  translation  is the same as the  renamed  one  obtained 
previously.


Appendix A: Changes between Txlat 0.1 and 0.2.

1.   Txlat no longer requires the entries in the dictionary to  be 
     in lower case.
2.   Txlat no longer requires the entries in the dictionary to  be 
     in  alphabetical  order (although it may run faster  if  they 
     are).
3.   Bugs in AddToDic parameter handling have been fixed:  you may 
     specify alternative languages and new words filenames.
4.   AddToDic  provides cosmetic formatting of the entries in  the 
     dictionary.  
5.   Where new.dic contains words duplicating those already in the 
     dictionary, AddToDic will ensure that those in the dictionary 
     take  precedence.  This  means  that if  you  wish  to  merge 
     dictionaries,  the  words in your base dictionary  will  take 
     precedence  over the ones in the dictionary that you  specify 
     as the new words file.
6.   AddToDic now creates a backup dictionary before attempting to 
     rewrite the updated dictionary.
7.   The original AddToDic used to display the line
          Reading dictionary ... Done
     twice;   one  corresponding  to  the  dictionary,  the  other 
     corresponding to the new words file.  The messages have  been 
     changed to resolve any confusion.
8.   Txlat now provides a crude wrapping of translated lines  that 
     would otherwise be longer than 80 characters (see section 6).


                     Graham Steel
                     154 Station Road
                     Ratby
                     Leicester  LE6 0JP
                     United Kingdom                October 1990

