D I H Y P H - hyphenation installation




Before you start installing the DIHYPH programs in/on your system,
please (!) proceed as follows:



- Never use "hynr" variable outside DIHYPH-programs !


- Read description "DIHYPH Interfacing and Installation".


- Read file DHTESTX.HLP or DIHYPH.HLP


- Upper-/lowercase file name writing is different on some systems !


- Define pathname of your choice for all DIHYPH runtime files
(DHEXnn.*, DHDFLT.CFG, DHCOnn, DHTAnn) in file array "dhpath[]".
Default pathname is \DIHYPH\ . All default values may be defined during runtime
by the user and TT-program (see: DHDFLT.*).
(TT = text/typesetting) (nn = language-no., see below !).

For DIHYPH-DH40 please first read file DH40READ.ME !


- Create "pathname" directory as defined, into which all runtime files
should be stored.


= Adapt Action Code definitions in code files DHnnCO.C and/or DHCOnn
(default: ASCII-850) to the character coding used by your system.
DHCOnn files are used in RV-version only


= Convert all ASCII-files to your system (files DHTAnn and DHEXnn.CAT
are binary files not to be changed or converted !).
ASCII-files (DHCOnn, DHnn.TXT, DHEXnn.TXT) possibly contain character
codes (accented letters etc.) unknown or coded differently on your system.
Adapt these character codes to your own character coding.


= printf - statements in C-sources are never active ( ! ) except for testing.


= C-source statements commented with "!!!!!"
may possibly have to be adapted to your system.
Function "coreleft( )" may be replaced by value 40000 !

On UNIX systems :
- end-of-line codes hex. '0D0A' have to be changed to hex. '0A'.
- end-of-file code has to be deleted.
- change following DHCFUNCT.C-expressions:
      sys\types.h       to      sys/types.h
      sys\stat.h        to      sys/stat.h
      nendchar = 2;     to      nendchar = 1;


- Compile all DIHYPH files.c on your system.


- Link compiled files.obj as shown in files DHTEST*.LNK and DHEXC*.LNK.


- Create exception dictionaries by following command (nn = language-no.):
DHEXD     nn                  or:
DHEXCDUC  nn                 (for UNICODE only !)


- Start testprogram as follows:
DHTESTX   nn  <DHnn.TXT        or:
DHTESTUC  nn  a  <DHnn.TXT    (for UNICODE only !)

Do the same with DHTEST*.EXE program as delivered by us, or read file
DHnn.RES and compare results.
Results should be identical - otherwise you have a problem !


- Adapt your TT-program to automatically:
set DIHYPH default values as defined by the user
set DIHYPH calling-parameters
evaluate DIHYPH return-parameters.


- Do not strip out special characters
except TT-commands, because DIHYPH has long experience with handling
those characters. Otherwise, many good hyphenation points may not be found !
(see file: DHINT.RES !).


= Adapt program DHTCMD.C when words to be hyphenated contain
TT-commands. Most TT-commands may be skipped/ignored for hyphen-
ation except flying accent commands etc. !


- Replace program names DHTEST* in linkfile DHTEST*.LNK with your
TT-program names.
Now your program should be working with DIHYPH hyphenation(s).


- Adapt DHEX*.BAT files for subsequent exception dictionary updating
to your system (editor "PE" [or "PE2"] and other statements).


= DHSORTD-module used in DHEXCAT contains the following sorting
sequence:
   Longer words precede shorter words of same wordbase:    speciality
                                                   and:    special
   Colon ( . ) and comma ( , ) are highest codes:          textword
   ( .  is higher than every vowel)                        textw.rd
   ( ,  is higher than every consonant)                    text,ord

= these steps must only be observed if necessary (e.g. special coding)


Text-/typesetting system calls hyphenations as follows:
  switch (nn)
     { case  1: DH01(line); break;  /* call hyphenation           */
       case  2: DH02(line); break;
              :
              :
       case 40: DH40(line); break;
       default: rc = -3;    break;  /* Incorrect language-no !    */
     }

or better:
  rc = DHYPH (line, nn);
  if (rc == -1)   ...               /* Table "dhco??" or "dhta??" */
                                    /* missing or wrong !         */


After successful installation only following files are needed:
dhco??      -files  ( Code tables       )
dhta??      -files  ( Prog-tables       )
dhex??.txt  -files  ( Exception-words   )
dhex??.cat  -files  ( Except.catalogues )
dhdflt.cfg  -file   ( Default setting   )
These files have to be stored in dictionary defined in array "dhpath"
(see: "dhdef.c") and they are read into RAM after their first call to DIHYPH.
They need RAM-space of about 20000 Byte.


Module "dhrtaf[al].c" avaluates a checksum using "signed character"
addition, when reading binary file "DHTAnn" at start of hypenation.
When the file-transfer to your system or Read-function has changed binary data,
a checksum error message is displayed !
In this case repeat the file-transfer without any conversion, or ensure that
Read-function does not change any data.
If "checksum error" is still occuring, just switch off that "fprint" error-
message-statement in source file "dhrtaf[al].c".


Once installed every hyphenation quality improvement and/or every new
language added to the system is only a couple of disk files.
Compiling and linking of programs is no longer necessary.



Hyphenation languages
Language            no (nn)
-------------------------------

Afrikaans             26
American English      22
Bahasa Malai./Indon.  31
Bulgarian             18
Czechoslovakian        7
Danish                14
Dutch                 11
English (Oxford)       2
English (Collins)     25
Estonian              34
Finnish               17
French                 3
German (old rules)     1
German (new rules)    40
Greek                 12
Hungarian             19
Latvian               35
Lithuanian            27
Icelandic             33
Italian                5
Latin                 30
Nagari (Indian)       28
New Greenlandic       24
Norwegian             16
Polish                10
Portuguese            13
Rumanian              21
Russian                4
Serbo-croatian         8
Slovakian             23
Slovenian             20
Spanish                9
Swedish               15
Tagalog Philippine    32
Turkish                6
Thai                  37
Ukrainian             36
Swahili               29


The following C-library-functions are used in module DHCFUNCT.C :
C-Compiler Purpose:                           Function
Function:                                     call:
------------------------------------------------------

malloc     allocate memory                    DHMALL
coreleft   get all remainung RAM  (40000)
free       free previously allocated memory

free       free all memory allocations        DHFREEAl

open       open file                          DHOPEN

fopen      fopen file                         DHFOPEN

close      close file                         DHCLOSE
fclose     fclose file

close      close / fclose all open files      DHCLOSAL
fclose

rename     rename file (old-new)              DHRENAME

remove     remove file                        DHDELET

tell       see file size                      DHFSIZE

rewind     reset to start of file             DHSETF
lseek      set file pointer

fgetc      fgetc file                         DHREAD
read       read file

fprintf    print to file                      DHWRITE
write      write file  


Program linkage
Program  |
File     | Meaning
--------------------------------------------------------------

DHTEST   | Testmainline to be replaced by typesetting sources.
DHTESTRD | Dummy, as functions are not needed here.

DHDFLT   | Reset default values using config.file DHDFLT.CFG.

DHEXCFH  |
DHEXCFS  | With    exception-dictionary-program.  **)
DHCUPP   |
     or: |
DHEXSD   | Without exception-dictionary-program.

DHCONTR  | Language-independent modules:
DHQUAL   |
DHDEF    |
DHINT    |
DHFRAM   |
DHTCMD   |
DHSPARM  |
DHSUBR   |
DHCVOW   |
DHCCON   |
DHTLUP   |
DHTABI   |
DHNXLT   |
DHBUST   |
DHVEMI   |
DHFUG    |
DHENDR   |

DHCFUNCT | C-functions using C-libraries
DHGELOG  |
DHGEVOS  | for languages:
DHGEVOP  | 01, 02, 11, 14, 15, 16, 22, 26, 33, 40
DHGEVOL  |
DHGECOL  |

DHLOG    |
DHVOS    |
DHVOL    | for all other languages !
DHCOL    |
DHLASP   |

DHSLLOGD | Dummy version of DHSLLOG (normal case).
     or: |
DHSLLOG  | Needed for languages 28 and 37 only.

           or better
           ---------
DHRCOFAL | DHRCOF
DHRTAFAL | DHRTAF
DHTADF   | DHTADF
         | DHFRAM   **)
DH01     | DHNN     (DHNN holding DH01-DH40)
  :      |
DH40     |

**)
For DIHYPH and DITECT together in one program, replace DHFRAM and
DTFRAM by DMFRAM, DHEXCFS and DTEXCFS by DMEXCFS and link
test program DMTEST (see: DMTEST.LNK) !



Setting of default values using file "DHDFLT.CFG"
/*************************************************************/
/*                                                           */
/*  DIHYPH-file:  "dhdflt.cfg"   =Default settings.          */
/*                                                           */
/*  DH00        Basic default values                         */
/*  DH01-DH40   Language-dependent values                    */
/*  ---------------------------------------------------------*/
/*              tabspac   Space for DHTAnn-file(s)           */
/*              excspac   Space for exception-dict.-catalog  */
/*              exdspac   Space for exception-dict.-records  */
/*              vs        Minimum  length of first syllable  */
/*              ns        Minimum  length of last  syllable  */
/*              minwl     Minimum  length of splittable word */
/*              mexsw     Multiple exception-access          */
/*              exfile    Special exception dictionaries     */
/*              -------   all names in small letters !       */
/*                                                           */
/*       DHnn  lines only are evaluated     !                */
/*             All other lines are comments !                */
/*                                                     Jul98 */
/*************************************************************/

Basic default values
---------------------------------------------------------------

DH00   mexsw=       1;
DH00   tabspac= 14500;
DH00   exdspac=  5000;
DH00   excspac=  2000;


Language-dependent values:
e.g.:  vs=2; ns=2; minwl=4; mexsw=1; exfile= +ausn1 ausn2;
---------------------------------------------------------------

DH01   vs=2; ns=2; minwl=4;
DH02   vs=2; ns=3; minwl=6;
DH03   vs=2; ns=3; minwl=5;
DH14   vs=2; ns=2; minwl=4;
DH17   vs=1; ns=1; minwl=4;
DH22   vs=2; ns=3; minwl=6;
DH25   vs=2; ns=3; minwl=6;
DH37   vs=1; ns=1; minwl=2; mexsw=0;
DH40   vs=2; ns=2; minwl=4;
--------------------------------------------------------------- 

Values for "tabspac" and "excspac" may also be defined per language (DNN) !


When different users are working with DIHYPH simultaneously e.g. in network,
configuration file "dhdflt.cfg" is on the server and so all values defined in
this file are automatically valid for everyone.
User-dependent values such as 'usef', 'csch', 'ftmp', 'minwl' and 'mexsw' should
be set as user-defined, via calling system, then these values must be erased from
the "dhdflt.cfg" file, otherwise these definitions would overwrite those set by
the calling-system !



Speed improvement


Frequent changes between languages:
Every time DIHYPH changes to another language or switches to and from DITECT,
the new program opens and reads some files into RAM, which will result in a
decrease in program speed.

To avoid this DIHYPH automatically tries to permanently hold all tables in RAM,
if sufficient free RAM is available.
To do this, program values 'tabspac', 'excspac' and 'exdspac' have to be set
correctly in the configuration file "dhdflt.cfg" as basic default values (DH00)
in order to be valid for all languages; but 'tabspac' and 'excspac' may, instead,
also be defined as language dependent (DHnn).
The first method needs more RAM as it allocates the same RAM size to every
language.
Using the second method, the values may be defined as tailor-made for every
language.
If there is insufficient RAM available, a message is written into the "dmessage"
error-file, and the last language tables are always overlaid by the new ones.

If DIHYPH and DITECT are linked together in one program-system, use
sources DMEXCFS and DMFRAM instead of DHEXCFS, DTEXCFS, DHFRAM
and DTFRAM (see link-file "DMTEST.LNK"), and set the variable 'hynr' to zero
(hynr = 0;) before switching from DITECT to DIHYPH (but only then) !

If files of more than one program are to be held permanently in RAM, all sources
must be compiled with the large compiler model !



Error messages

may only occur in case of incorrect installation !
They are stored into file "dmessage":


DHFOPEN: No free file index found ! Abort.
It is only possible to open a maximum of 15 files simultaneously.

"progname" -Error( 0): Can't open file : "filename"
Prog.module "progname" can't open file "filename".

"progname" -Error( 1): Insufficient memory allocation.
Progname= "dhrcof": Variable 'codspac' definition too small.
Progname = "dhrtaf ": Variable 'tabspac' definition too small.
Progname = "dhexcfh": Variable 'excspac' definition too small,
program continues without exceptions.

"progname" -Error( 2): 'tabspac' definition too small.
Set 'tabspac' to correct value !

"progname" -Error( 3): 'exdspac' definition too small.
Set 'exdspac' to correct value !

Checksum error in file: dhta.. !
Program module "dhrtaf" or "dhrtafal" has detected a checksum error when
reading binary file "dhta.." (.. =hyphenation-no.).
Make sure that this binary file remains unchanged during file-transfer or
READ-function. If you are sure that file "dhta.." is okay, but the error still
occurs, simply switch off this error-print command in source-code

DMFRAM-Error: Insufficient RAM to hold tables permanently.
There is insufficient space to load all the DIHYPH program tables into RAM.
The last language is always overlaid !




For more information please read:

Exception Dictionary

DIHYPH Interfacing




Contact