home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 2 / 2766 < prev    next >
Internet Message Format  |  1991-02-14  |  57KB

  1. From: gtoal@tharr.UUCP (Graham Toal)
  2. Newsgroups: alt.sources
  3. Subject: Word hyphenation using troff's algorithm
  4. Message-ID: <1795@tharr.UUCP>
  5. Date: 15 Feb 91 02:37:01 GMT
  6.  
  7. Archive-name: hyphen/troffalg.sh
  8.  
  9. While I'm posting the TeX code to do the same job, I'll include this --
  10. I found it on a disk of Austin Code Works stuff, and haven't seen it
  11. on the net before.  It's smaller that the TeX code, and faster, though
  12. the TeX algorithm works better if you use the correct set of patterns.
  13.  
  14. #!/bin/sh-----cut here-----cut here-----cut here-----cut here-----
  15. # shar:    Shell Archiver
  16. #    Run the following text with /bin/sh to create:
  17. #    README #    digram.c #    hy.c #    hyphen.c #    suffix.c 
  18. cat - << \SHAR_EOF > README
  19. TITLE:        Hyphenation Maker;
  20. DESCRIPTION:  "Hyphenate words from standard input";
  21. SYSTEM:       Portable (MSDOS, Archimedes)
  22. FILENAME:     HY.C;
  23. SEE ALSO:     HYPHEN.C, SUFFIX.C, DIGRAM.C;
  24. COMPILERS:    Microsoft C ver 4.0 in the small size model;
  25. AUTHORS:      Bob Denny from DECUS Software;
  26. SHAR_EOF
  27. cat - << \SHAR_EOF > digram.c
  28. /*
  29.  * Hyphenation digram tables. Taken directly from the public domain
  30.  * Bell Labs hyphenation algorithm exemplified in the DECUS RUNOFF
  31.  * program.
  32.  *
  33.  * Edits:
  34.  *    01 13-May-81 RBD  Initial conversion to C
  35.  */
  36.  
  37. char bxh[1][13] =
  38.    {
  39.    0060, 0000, 0040, 0000, 0040, 0000, 0000, 0040, 0000, 0000, 0040, 0000, 0040
  40.    };
  41.  
  42. char hxx[26][13] =
  43.    {
  44.    0006, 0042, 0041, 0123, 0021, 0024, 0063, 0042, 0002, 0043, 0021, 0001, 0022,
  45.    0140, 0000, 0200, 0003, 0260, 0006, 0000, 0160, 0007, 0000, 0140, 0000, 0320,
  46.    0220, 0000, 0160, 0005, 0240, 0010, 0000, 0100, 0006, 0000, 0200, 0000, 0320,
  47.    0240, 0000, 0120, 0003, 0140, 0000, 0000, 0240, 0010, 0000, 0220, 0000, 0160,
  48.    0042, 0023, 0041, 0040, 0040, 0022, 0043, 0041, 0030, 0064, 0021, 0000, 0041,
  49.    0100, 0000, 0140, 0000, 0220, 0006, 0000, 0140, 0003, 0000, 0200, 0000, 0000,
  50.    0200, 0000, 0120, 0002, 0220, 0010, 0000, 0160, 0006, 0000, 0140, 0000, 0320,
  51.    0020, 0000, 0020, 0000, 0020, 0000, 0000, 0020, 0000, 0000, 0020, 0000, 0000,
  52.    0043, 0163, 0065, 0044, 0022, 0043, 0104, 0042, 0061, 0146, 0061, 0000, 0007,
  53.    0100, 0000, 0140, 0000, 0040, 0000, 0000, 0100, 0000, 0000, 0120, 0000, 0000,
  54.    0140, 0000, 0040, 0011, 0060, 0004, 0001, 0120, 0003, 0000, 0140, 0000, 0040,
  55.    0200, 0000, 0100, 0000, 0140, 0000, 0000, 0140, 0000, 0000, 0140, 0000, 0240,
  56.    0200, 0000, 0140, 0000, 0160, 0000, 0000, 0220, 0000, 0000, 0140, 0000, 0240,
  57.    0200, 0000, 0140, 0000, 0160, 0000, 0000, 0220, 0000, 0000, 0060, 0000, 0240,
  58.    0021, 0043, 0041, 0121, 0040, 0023, 0042, 0003, 0142, 0042, 0061, 0001, 0022,
  59.    0120, 0000, 0140, 0010, 0140, 0010, 0000, 0140, 0002, 0000, 0120, 0000, 0120,
  60.    0000, 0000, 0000, 0000, 0360, 0000, 0000, 0000, 0000, 0000, 0160, 0000, 0000,
  61.    0100, 0000, 0040, 0005, 0120, 0000, 0000, 0100, 0000, 0000, 0060, 0000, 0140,
  62.    0140, 0040, 0100, 0001, 0240, 0041, 0000, 0242, 0000, 0002, 0140, 0000, 0100,
  63.    0240, 0000, 0120, 0002, 0200, 0000, 0000, 0320, 0007, 0000, 0240, 0000, 0340,
  64.    0101, 0021, 0041, 0020, 0040, 0005, 0042, 0121, 0002, 0021, 0201, 0000, 0020,
  65.    0160, 0000, 0100, 0000, 0140, 0000, 0000, 0160, 0006, 0000, 0220, 0000, 0140,
  66.    0140, 0000, 0020, 0001, 0020, 0000, 0000, 0100, 0001, 0000, 0300, 0000, 0000,
  67.    0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000,
  68.    0106, 0041, 0040, 0147, 0040, 0000, 0063, 0041, 0001, 0102, 0160, 0002, 0002,
  69.    0300, 0000, 0040, 0017, 0140, 0017, 0000, 0240, 0000, 0000, 0140, 0000, 0120
  70.    };
  71.  
  72. char bxxh[26][13] =
  73.    {
  74.    0005, 0150, 0153, 0062, 0062, 0246, 0152, 0127, 0146, 0203, 0310, 0017, 0206,
  75.    0100, 0000, 0120, 0000, 0140, 0000, 0000, 0100, 0000, 0000, 0120, 0000, 0060,
  76.    0100, 0000, 0040, 0000, 0060, 0000, 0000, 0060, 0000, 0000, 0220, 0000, 0040,
  77.    0100, 0000, 0120, 0000, 0200, 0000, 0000, 0100, 0000, 0000, 0140, 0000, 0060,
  78.    0043, 0142, 0046, 0140, 0062, 0147, 0210, 0131, 0046, 0106, 0246, 0017, 0111,
  79.    0060, 0000, 0020, 0000, 0060, 0000, 0000, 0040, 0000, 0000, 0100, 0000, 0000,
  80.    0060, 0000, 0040, 0000, 0040, 0000, 0000, 0040, 0000, 0000, 0100, 0000, 0040,
  81.    0100, 0000, 0100, 0000, 0100, 0000, 0000, 0040, 0000, 0000, 0100, 0000, 0140,
  82.    0066, 0045, 0145, 0140, 0000, 0070, 0377, 0030, 0130, 0103, 0003, 0017, 0006,
  83.    0040, 0000, 0040, 0000, 0020, 0000, 0000, 0040, 0000, 0000, 0100, 0000, 0000,
  84.    0200, 0000, 0020, 0000, 0140, 0000, 0000, 0120, 0000, 0000, 0120, 0000, 0040,
  85.    0120, 0000, 0040, 0000, 0060, 0000, 0000, 0060, 0000, 0000, 0160, 0000, 0040,
  86.    0120, 0000, 0040, 0000, 0120, 0000, 0000, 0040, 0000, 0000, 0160, 0000, 0040,
  87.    0120, 0000, 0020, 0000, 0140, 0000, 0000, 0120, 0000, 0000, 0140, 0000, 0040,
  88.    0051, 0126, 0150, 0140, 0060, 0210, 0146, 0006, 0006, 0165, 0003, 0017, 0244,
  89.    0120, 0000, 0040, 0000, 0160, 0000, 0000, 0140, 0000, 0000, 0060, 0000, 0140,
  90.    0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000,
  91.    0140, 0000, 0140, 0000, 0060, 0000, 0000, 0100, 0000, 0000, 0140, 0000, 0020,
  92.    0120, 0000, 0020, 0000, 0060, 0000, 0000, 0060, 0000, 0000, 0060, 0000, 0040,
  93.    0140, 0000, 0020, 0000, 0100, 0000, 0000, 0140, 0000, 0000, 0140, 0000, 0020,
  94.    0070, 0125, 0051, 0162, 0120, 0105, 0126, 0104, 0006, 0044, 0000, 0017, 0052,
  95.    0140, 0000, 0020, 0000, 0140, 0000, 0000, 0060, 0000, 0000, 0060, 0000, 0040,
  96.    0020, 0000, 0000, 0000, 0020, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0060,
  97.    0140, 0000, 0160, 0000, 0200, 0000, 0000, 0140, 0000, 0000, 0000, 0000, 0240,
  98.    0065, 0042, 0060, 0200, 0000, 0210, 0222, 0146, 0006, 0204, 0220, 0012, 0003,
  99.    0240, 0000, 0020, 0000, 0120, 0000, 0000, 0200, 0000, 0000, 0200, 0000, 0240
  100.    };
  101.  
  102. char xhx[26][13] =
  103.    {
  104.    0032, 0146, 0042, 0107, 0076, 0102, 0042, 0146, 0202, 0050, 0006, 0000, 0051,
  105.    0036, 0377, 0057, 0013, 0057, 0366, 0377, 0057, 0001, 0377, 0057, 0000, 0040,
  106.    0037, 0377, 0020, 0000, 0100, 0022, 0377, 0057, 0362, 0116, 0100, 0000, 0017,
  107.    0057, 0377, 0057, 0031, 0137, 0363, 0377, 0037, 0362, 0270, 0077, 0000, 0117,
  108.    0074, 0142, 0012, 0236, 0076, 0125, 0063, 0165, 0341, 0046, 0047, 0000, 0024,
  109.    0020, 0017, 0075, 0377, 0040, 0001, 0377, 0017, 0001, 0204, 0020, 0000, 0040,
  110.    0057, 0017, 0057, 0340, 0140, 0362, 0314, 0117, 0003, 0302, 0100, 0000, 0057,
  111.    0057, 0357, 0077, 0017, 0100, 0366, 0314, 0057, 0342, 0346, 0037, 0000, 0060,
  112.    0252, 0145, 0072, 0157, 0377, 0165, 0063, 0066, 0164, 0050, 0363, 0000, 0362,
  113.    0000, 0000, 0020, 0000, 0020, 0000, 0000, 0017, 0000, 0000, 0020, 0000, 0000,
  114.    0117, 0017, 0237, 0377, 0200, 0354, 0125, 0110, 0004, 0257, 0000, 0000, 0300,
  115.    0057, 0367, 0054, 0357, 0157, 0216, 0314, 0114, 0217, 0353, 0053, 0000, 0057,
  116.    0077, 0213, 0077, 0077, 0177, 0317, 0377, 0114, 0377, 0352, 0077, 0000, 0076,
  117.    0077, 0213, 0077, 0077, 0157, 0177, 0377, 0054, 0377, 0352, 0117, 0000, 0075,
  118.    0125, 0230, 0065, 0216, 0057, 0066, 0063, 0047, 0345, 0126, 0011, 0000, 0033,
  119.    0057, 0377, 0051, 0360, 0120, 0361, 0273, 0056, 0001, 0256, 0057, 0000, 0060,
  120.    0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000, 0000,
  121.    0076, 0310, 0056, 0310, 0137, 0174, 0273, 0055, 0335, 0266, 0033, 0000, 0155,
  122.    0077, 0157, 0057, 0360, 0057, 0063, 0042, 0024, 0077, 0206, 0020, 0000, 0040,
  123.    0057, 0037, 0077, 0360, 0100, 0365, 0377, 0037, 0362, 0176, 0050, 0000, 0026,
  124.    0167, 0146, 0042, 0112, 0077, 0110, 0062, 0254, 0366, 0052, 0377, 0000, 0163,
  125.    0060, 0000, 0040, 0000, 0120, 0000, 0377, 0060, 0012, 0000, 0037, 0000, 0257,
  126.    0037, 0232, 0157, 0361, 0040, 0003, 0125, 0010, 0001, 0256, 0000, 0000, 0340,
  127.    0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0377, 0017, 0277,
  128.    0253, 0315, 0257, 0216, 0377, 0206, 0146, 0306, 0371, 0126, 0232, 0000, 0004,
  129.    0057, 0012, 0100, 0360, 0160, 0360, 0000, 0040, 0000, 0017, 0157, 0000, 0176
  130.    };
  131.  
  132. char xxh[26][13] =
  133.    {
  134.    0045, 0150, 0154, 0162, 0042, 0246, 0210, 0147, 0152, 0103, 0230, 0017, 0206,
  135.    0100, 0000, 0040, 0000, 0140, 0000, 0000, 0100, 0000, 0021, 0120, 0017, 0060,
  136.    0100, 0000, 0040, 0002, 0140, 0320, 0000, 0060, 0000, 0001, 0220, 0017, 0040,
  137.    0100, 0001, 0120, 0001, 0241, 0000, 0000, 0100, 0000, 0020, 0140, 0017, 0060,
  138.    0023, 0162, 0046, 0142, 0022, 0207, 0210, 0131, 0052, 0106, 0250, 0017, 0110,
  139.    0060, 0000, 0042, 0000, 0160, 0000, 0000, 0040, 0000, 0212, 0100, 0017, 0000,
  140.    0140, 0000, 0040, 0002, 0140, 0000, 0000, 0120, 0000, 0040, 0120, 0017, 0040,
  141.    0100, 0000, 0100, 0000, 0140, 0001, 0021, 0140, 0000, 0046, 0100, 0017, 0140,
  142.    0066, 0045, 0025, 0201, 0020, 0130, 0146, 0030, 0130, 0103, 0025, 0017, 0006,
  143.    0100, 0000, 0040, 0000, 0020, 0000, 0000, 0040, 0000, 0000, 0200, 0017, 0000,
  144.    0200, 0000, 0020, 0001, 0140, 0000, 0000, 0140, 0000, 0000, 0120, 0017, 0040,
  145.    0120, 0026, 0042, 0020, 0140, 0161, 0042, 0143, 0000, 0022, 0162, 0017, 0040,
  146.    0121, 0042, 0060, 0020, 0140, 0200, 0000, 0123, 0000, 0021, 0220, 0017, 0041,
  147.    0121, 0042, 0060, 0120, 0140, 0200, 0000, 0123, 0000, 0021, 0160, 0017, 0041,
  148.    0051, 0126, 0150, 0141, 0060, 0210, 0146, 0066, 0026, 0165, 0026, 0017, 0247,
  149.    0120, 0000, 0040, 0003, 0160, 0000, 0000, 0140, 0000, 0021, 0100, 0017, 0140,
  150.    0000, 0000, 0000, 0000, 0200, 0000, 0000, 0000, 0000, 0000, 0000, 0017, 0000,
  151.    0141, 0023, 0122, 0040, 0160, 0143, 0042, 0142, 0000, 0047, 0143, 0017, 0020,
  152.    0120, 0000, 0040, 0006, 0140, 0060, 0000, 0141, 0000, 0026, 0100, 0017, 0040,
  153.    0140, 0000, 0020, 0007, 0100, 0000, 0000, 0140, 0000, 0001, 0140, 0017, 0020,
  154.    0110, 0125, 0051, 0162, 0120, 0125, 0127, 0104, 0006, 0104, 0000, 0017, 0052,
  155.    0140, 0000, 0040, 0000, 0160, 0000, 0000, 0140, 0000, 0000, 0060, 0017, 0000,
  156.    0040, 0005, 0020, 0000, 0040, 0313, 0231, 0030, 0000, 0140, 0000, 0017, 0056,
  157.    0140, 0000, 0160, 0000, 0200, 0000, 0000, 0140, 0000, 0000, 0000, 0017, 0240,
  158.    0065, 0042, 0060, 0040, 0000, 0206, 0231, 0146, 0006, 0224, 0220, 0017, 0004,
  159.    0240, 0000, 0020, 0000, 0140, 0000, 0000, 0220, 0000, 0000, 0200, 0017, 0141
  160.    };
  161. SHAR_EOF
  162. cat - << \SHAR_EOF > hy.c
  163. /*
  164.  * hy.c
  165.  *
  166.  * Mark words for hyphenation.
  167.  * Output is one word per line.
  168.  * May be used as a filter.
  169.  *
  170.  * Not too useful unless a decent exception list is added
  171.  * to the hyphenation processing.
  172.  *
  173.  * Bob Denny
  174.  * 28-Mar-82
  175.  */
  176.  
  177. /*)BUILD    $(PROGRAM)    = hy
  178.         $(FILES)    = { hy hyphen digram suffix }
  179.         $(TKBOPTIONS)    = {
  180.             STACK    = 256
  181.             TASK    = ...HYP
  182.             ACTFIL    = 3
  183.             UNITS    = 3
  184.         }
  185. */
  186.  
  187. #include <stdio.h>
  188. #include <ctype.h>
  189.  
  190. #define    EOS    0
  191.  
  192. /*
  193.  * Hyphenation marker character
  194.  */
  195. #define HYCH '-'
  196.  
  197. char *wdstart, *wdend;            /* Shared with hyphen()        */
  198. char *hyptr[16];            /* Hyphenation locations    */
  199.  
  200. static char intext[133];        /* Input text line        */
  201. static char iwbuf[32];            /* Input word buffer        */
  202. static char owbuf[48];            /* Marked output word        */
  203.  
  204. main()
  205. {
  206.     int        i;        /* Hyphen buffer index        */
  207.     register char    *tp;        /* Text pointer            */
  208.     register char    *wp;        /* Input word pointer        */
  209.     register char    *op;        /* Output word pointer        */
  210.  
  211.     while((tp = gets(intext)) != NULL) {
  212.         while (*tp != EOS) {
  213.         while (isspace(*tp))    /* Skip over whitespace        */
  214.             tp++;        /* between words        */
  215.         if (*tp == EOS)
  216.             break;
  217.         for (wp = iwbuf; (*wp++ = *tp) != EOS && !isspace(*tp); tp++)
  218.             ;
  219.         *--wp = EOS;        /* Terminate word        */
  220.         if (wp == iwbuf)    /* Ignore null words        */
  221.             continue;
  222.             hyphen(iwbuf);        /* Get hyphenation pointers    */
  223.         i = 0;            /* Start with 1st pointer    */
  224.         op = owbuf;        /* Initialize output pointer    */
  225.         wp = iwbuf;
  226.         while ((*op++ = tolower(*wp)) != EOS) {
  227.             wp++;        /* (no side effect in tolower)    */
  228.             if (hyptr[i] == wp) {
  229.             /*
  230.              * Mark hyphenation point
  231.              */
  232.             *op++ = HYCH;
  233.             i++;        /* Next hyphenation pointer    */
  234.             }
  235.         }
  236.         puts(owbuf);            /* Write the marked word    */
  237.         }
  238.     }
  239. }
  240. SHAR_EOF
  241. cat - << \SHAR_EOF > hyphen.c
  242. /*
  243.  * HYPHEN.C
  244.  *
  245.  * Hyphenation module. Adapted from the Bell Labs hyphenation algorithm.
  246.  * Suffix and digram tables taken from several public domain sources,
  247.  * including DECUS RUNOFF.
  248.  *
  249.  * Basically a toy until a decent exception list is added.
  250.  *
  251.  * Edits:
  252.  *    01 13-May-81 RBD  Initial edit.
  253.  */
  254. #include <stdio.h>
  255. #include <ctype.h>
  256.  
  257. #define NULL 0
  258.  
  259. /*
  260.  * Custom C control construct: cycle/recycle/quit
  261.  */
  262.  
  263. #define cycle while(1) {
  264. #define recycle continue
  265. #define quit break
  266. #define endcycle }
  267.  
  268. /*
  269.  * External statics and functions.
  270.  */
  271. extern char *wdstart, *wdend;          /* Pointers to 1st and last chars */
  272. extern char *hyptr[];                  /* Table of ptrs to hyp pos's */
  273. /* extern char tolower(); */                /* Fold character to lower case */
  274.  
  275. /*
  276.  * Internal statics.
  277.  */
  278. static char *hyend;                    /* Working scan pointer */
  279. static char **hyp;                     /* Scan ptr for hyptr table */
  280.  
  281. /*
  282.  * Digram tables, table of pointers to suffix tables.
  283.  */
  284. extern char bxh[26][13], bxxh[26][13], xxh[26][13], xhx[26][13], hxx[26][13];
  285. extern char *suftab[];
  286.  
  287. #define THRESH 160                     /* Digram goodness threshold */
  288.  
  289. /*
  290.  * Mark word for hyphenation.
  291.  *
  292.  * Inputs:
  293.  *       wp = pointer to start of word to hyphenate.
  294.  *
  295.  * Outputs:
  296.  *       returns 0
  297.  *       wdstart --> first letter
  298.  *       wdend   --> last letter
  299.  *       hyend   --> letter before first hyphenation break
  300.  *       hyptr[] --> locations where hyphenation is OK
  301.  */
  302. hyphen(wp)
  303. char *wp;
  304.    {
  305.    register char *ch;
  306.    register char **h;
  307.    register int i;
  308. /*
  309.  * Skip by leading punctuation
  310.  */
  311.    ch = wp;
  312. /******** TEMP
  313.    while(punct(*ch++))
  314.       ;
  315. */
  316.    ch++;    /* Fake it */
  317. /*
  318. *********/
  319.  
  320. /*
  321.  * If word doesn't start with alpha, don't hyphenate.
  322.  */
  323.    if (!isalpha(*--ch))
  324.       return;
  325. /*
  326.  * Mark the special places in the word.
  327.  */
  328.    wdstart = ch++;                     /* wdstart --> 1st alpha */
  329.    while(isalpha(*ch++))
  330.       ;
  331.    hyend = wdend = --ch-1;             /* hyend --> last letter */
  332.  
  333. /******** TEMP **********
  334.    while(punct(*ch++))  */               /* (skip trailing punctuation) */
  335.    ch++; /* Fake it */
  336. /*      ;
  337. *************************/
  338. /*
  339.  * Don't hyphenate unless that was trailing punctuation, not
  340.  * punctuation within a word. Assumes word ends in NULL. Also,
  341.  * don't hyphenate if word is shorter than 5 characters.
  342.  */
  343.    if (*--ch)
  344.       return;
  345.    if ((wdend-wdstart-4) < 0)
  346.       return;
  347.  
  348.    hyp = hyptr;                        /* hyp --> first cell in hyptr */
  349.    *hyp = NULL;                        /* hyptr[0] <-- 0 */
  350.  
  351.    suffix();                           /* Mark suffix based hyp points */
  352.    digram();                           /* Mark usable digrams in the word */
  353.    *hyp++ = NULL;                      /* Terminate the list with a NULL */
  354.  
  355.    /*
  356.     * Do a bubble sort on the hyphenation pointers in hyptr[]
  357.     * so they point to spots in the word from left to right.
  358.     */
  359.    if (*hyptr)
  360.       for(i = 1; i;)
  361.          {
  362.          i = 0;
  363.          for(h = hyptr+1; *h != 0; h++)
  364.             {
  365.             if (*(h-1) > *h)
  366.                {
  367.                i++;
  368.                ch = *h; *h = *(h-1); *(h-1) = ch;
  369.                }
  370.             }
  371.          }
  372.    }
  373.  
  374. /*
  375.  * Suffix test and processing. Handles multiple suffices, such as
  376.  * "ationalism".
  377.  */
  378. suffix()
  379.    {
  380.    register char *s, *s0, *w;
  381.    char ch;
  382.    char *chkvow();
  383.  
  384.    /*
  385.     * Do this from right to left, recognizing suffix forms which make
  386.     * up a concatenated multi-suffix.
  387.     */
  388.    cycle
  389.       /*
  390.        * Make ch = lower case last character for this suffix try.
  391.        */
  392.       if (!isalpha(ch = *hyend))       /* Done if non-alpha */
  393.          return(0);
  394.       /*
  395.        * Point s0 at suffix table for the last letter in this word.
  396.        * If there is no suffix table, return failure.
  397.        */
  398.       if ((s0 = suftab[tolower(ch)-'a']) == NULL)
  399.          return(0);
  400.       /*
  401.        * Test word for match to nodes in suffix table. Done if end of
  402.        * table reached.
  403.        */
  404.       cycle
  405.          if ((ch = *s0 & 017) == '\0') /* ch = # chars in this node */
  406.             return(0);                 /* Done if none (end of table) */
  407.          s = s0 + ch - 1;              /* s --> last char in node */
  408.          w = hyend - 1;                /* w --> next to last char in word */
  409.  
  410.          while(((s > s0) && (w >= wdstart)) && ((*s & 0177) == tolower(*w)))
  411.             {
  412.             s--;
  413.             w--;
  414.             }
  415.  
  416.          if (s == s0)                  /* If the entire suffix matched ... */
  417.             quit;                      /* ... quit the cycle. Found one. */
  418.          s0 += ch;                     /* No match, go to next node */
  419.       endcycle
  420.  
  421.       s = s0 + ch - 1;                 /* s --> last char in node */
  422.       w = hyend;                       /* w --> last char in word */
  423.       if (*s0 & 0200) goto mark;       /* If hyp flag set, mark hyp spot */
  424.       /*
  425.        * Mark the places where it can be hyphenated.
  426.        */
  427.       while(s > s0)
  428.          {
  429.          --w;
  430.          if (*s-- & 0200)              /* If this is a legal hyp spot */
  431.             {
  432. mark:                                  /* Mark it as a hyphenation spot */
  433.             hyend = w - 1;             /* hyend --> word b4 hyp spot */
  434.             /*
  435.              * If bit 6 set in first cell, it means
  436.              * supress actual hyphenation.
  437.              */
  438.             if (*s0 & 0100)            /* If supress, keep moving left */
  439.                continue;
  440.             if (!chkvow(w))            /* Done if no vowels precede this */
  441.                return(0);
  442.             *hyp++ = w;                /* Fill in a hyphenation pointer */
  443.             }
  444.          }
  445. /*
  446.  * End of suffix node. If bit 5 set in first cell, supress multi
  447.  * suffix processing, done. Otherwise, look further to the left
  448.  * for more suffices and hyphenation points.
  449.  */
  450.       if (*s0 & 040)
  451.          return(0);
  452.    endcycle
  453.    }
  454.  
  455. /*
  456.  * Test if the supplied letter is a vowel.
  457.  */
  458. vowel(ch)
  459. int ch;
  460.    {
  461.    switch(tolower(ch))
  462.       {
  463.       case 'a':
  464.       case 'e':
  465.       case 'i':
  466.       case 'o':
  467.       case 'u':
  468.       case 'y':
  469.          return(1);
  470.       default:
  471.          return(0);
  472.       }
  473.    }
  474.  
  475. /*
  476.  * Check if any letters to the left of *w are vowels.
  477.  */
  478. char *chkvow(w)
  479. char *w;
  480.    {
  481.    while(--w >= wdstart) if(vowel(*w)) return(w);
  482.    return(0);
  483.    }
  484.  
  485. /*
  486.  * Digram processing. Magic here.
  487.  */
  488. digram()
  489.    {
  490.    register char *w;
  491.    register int val;
  492.    char *nhyend, *maxw;
  493.    int maxval;
  494.    char *chkvow();
  495.  
  496.    cycle
  497.       if (!(w=chkvow(hyend+1))) return;
  498.       hyend = w;
  499.       if (!(w=chkvow(hyend))) return;
  500.       nhyend = w;
  501.       maxval = 0;
  502.       w--;
  503.       while((++w < hyend) && (w < (wdend-1)))
  504.          {
  505.          val = 1;
  506.          if (w == wdstart) val *= dilook('a',*w,bxh);
  507.          else if(w == wdstart+1) val *= dilook(*(w-1),*w,bxxh);
  508.          else val *= dilook(*(w-1),*w,xxh);
  509.          val *= dilook(*w, *(w+1), xhx);
  510.          val *= dilook(*(w+1), *(w+2), hxx);
  511.          if (val > maxval)
  512.             {
  513.             maxval = val;
  514.             maxw = w + 1;
  515.             }
  516.          }
  517.       hyend = nhyend;
  518.       if (maxval > THRESH)*hyp++ = maxw;
  519.    endcycle
  520. }
  521.  
  522. dilook(a,b,t)
  523. char a, b;
  524. char t[26][13];
  525.    {
  526.    register char i, j;
  527.  
  528.    i = t[tolower(a)-'a'][(j = tolower(b)-'a')/2];
  529.    if (!(j & 01))i >>= 4;
  530.    return(i & 017);
  531.    }
  532. SHAR_EOF
  533. cat - << \SHAR_EOF > suffix.c
  534. /*
  535.  * Suffix table for hyphenation. Taken from the public domain Bell Labs
  536.  * hyphenation algorithm.
  537.  *
  538.  * Edits:
  539.  *    01 13-May-81 RBD  Initial edit
  540.  */
  541.  
  542. static char sufa[] =
  543.    {
  544.    02,0200+'t',                                             /* -TA */
  545.    02,0200+'s',                                             /* -SA */
  546.    03,0200+'t','r',                                         /* -TRA */
  547.    03,0200+'d','r',                                         /* -DRA */
  548.    03,0200+'b','r',                                         /* -BRA */
  549.    02,0200+'p',                                             /* -PA */
  550.    02,0200+'n',                                             /* -NA */
  551.    02,0200+'m',                                             /* -MA */
  552.    03,0200+'p','l',                                         /* -PLA */
  553.    02,0200+'l',                                             /* -LA */
  554.    02,0200+'k',                                             /* -KA */
  555.    03,0200+'t','h',                                         /* -THA */
  556.    03,0200+'s','h',                                         /* -SHA */
  557.    02,0200+'g',                                             /* -GA */
  558.    02,0200+'d',                                             /* -DA */
  559.    02,0200+'c',                                             /* -CA */
  560.    02,0200+'b',                                             /* -BA */
  561.    00
  562.    };
  563.  
  564. static char sufc[] =
  565.    {
  566.    04,'e','t',0200+'i',                                     /* ET-IC */
  567.    07,'a','l',0200+'i','s',0200+'t','i',                    /* AL-IS-TIC */
  568.    04,'s',0200+'t','i',                                     /* S-TIC */
  569.    04,'p',0200+'t','i',                                     /* P-TIC */
  570.    05,0200+'l','y','t',0200+'i',                            /* -LYT-IC */
  571.    04,'o','t',0200+'i',                                     /* OT-IC */
  572.    05,'a','n',0200+'t','i',                                 /* AN-TIC */
  573.    04,'n',0200+'t','i',                                     /* N-TIC */
  574.    04,'c',0200+'t','i',                                     /* C-TIC */
  575.    04,'a','t',0200+'i',                                     /* AT-IC */
  576.    04,'h',0200+'n','i',                                     /* H-NIC */
  577.    03,'n',0200+'i',                                         /* N-IC */
  578.    03,'m',0200+'i',                                         /* M-IC */
  579.    04,'l',0200+'l','i',                                     /* L-LIC */
  580.    04,'b',0200+'l','i',                                     /* B-LIC */
  581.    04,0200+'c','l','i',                                     /* -CLIC */
  582.    03,'l',0200+'i',                                         /* L-IC */
  583.    03,'h',0200+'i',                                         /* H-IC */
  584.    03,'f',0200+'i',                                         /* F-IC */
  585.    03,'d',0200+'i',                                         /* D-IC */
  586.    03,0200+'b','i',                                         /* -BIC */
  587.    03,'a',0200+'i',                                         /* A-IC */
  588.    03,0200+'m','a',                                         /* -MAC */
  589.    03,'i',0200+'a',                                         /* I-AC */
  590.    00
  591.    };
  592.  
  593. static char sufd[] =
  594.    {
  595.    04,0200+'w','o','r',                                     /* -WORD */
  596.    04,0200+'l','o','r',                                     /* -LORD */
  597.    04,0200+'f','o','r',                                     /* -FORD */
  598.    04,0200+'y','a','r',                                     /* -YARD */
  599.    04,0200+'w','a','r',                                     /* -WARD */
  600.    05,0200+'g','u','a','r',                                 /* -GUARD */
  601.    04,0200+'t','a','r',                                     /* -TARD */
  602.    05,0200+'b','o','a','r',                                 /* -BOARD */
  603.    04,0200+'n','a','r',                                     /* -NARD */
  604.    05,0200+'l','i','a','r',                                 /* -LIARD */
  605.    04,0200+'i','a','r',                                     /* -IARD */
  606.    04,0200+'g','a','r',                                     /* -GARD */
  607.    04,0200+'b','a','r',                                     /* -BARD */
  608.    03,0200+'r','o',                                         /* -ROD */
  609.    04,0200+'w','o','o',                                     /* -WOOD */
  610.    04,0200+'h','o','o',                                     /* -HOOD */
  611.    04,0200+'m','o','n',                                     /* -MOND */
  612.    04,0200+'t','e','n',                                     /* -TEND */
  613.    05,0200+'s','t','a','n',                                 /* -STAND */
  614.    04,0200+'l','a','n',                                     /* -LAND */
  615.    04,0200+'h','a','n',                                     /* -HAND */
  616.    04,0200+'h','o','l',                                     /* -HOLD */
  617.    04,0200+'f','o','l',                                     /* -FOLD */
  618.    05,0200+'f','i','e','l',                                 /* -FIELD */
  619.    03,0200+'v','i',                                         /* -VID */
  620.    03,0200+'c','i',                                         /* -CID */
  621.    04,0200+'s','a','i',                                     /* -SAID */
  622.    04,0200+'m','a','i',                                     /* -MAID */
  623.    04,'t',0200+'t','e',                                     /* T-TED */
  624.    03,'t',0200+'e',                                         /* T-ED */
  625.    04,0200+'d','r','e',                                     /* -DRED */
  626.    04,0200+'c','r','e',                                     /* -CRED */
  627.    04,0200+'b','r','e',                                     /* -BRED */
  628.    05,'v',0200+'e','l','e',                                 /* V-ELED */
  629.    0100+04,'a','l',0200+'e',                                /* AL/ED */
  630.    0140+03,0200+'e','e',                                    /* /EED */
  631.    040+05,'e','d',0200+'d','e',                             /* ED-DED */
  632.    04,'d',0200+'d','e',                                     /* D-DED */
  633.    040+04,'e','d',0200+'e',                                 /* ED-ED */
  634.    03,'d',0200+'e',                                         /* D-ED */
  635.    05,0200+'d','u','c','e',                                 /* -DUCED */
  636.    0300+02,'e',                                             /* E/D */
  637.    05,0200+'s','t','e','a',                                 /* -STEAD */
  638.    04,0200+'h','e','a',                                     /* -HEAD */
  639.    00
  640.    };
  641.  
  642. static char sufe[] =
  643.    {
  644.    05,'a','r',0200+'i','z',                                 /* AR-IZE */
  645.    05,'a','n',0200+'i','z',                                 /* AN-IZE */
  646.    05,'a','l',0200+'i','z',                                 /* AL-IZE */
  647.    06,0200+'a','r','d',0200+'i','z',                        /* -ARD-IZE */
  648.    05,0200+'s','e','l','v',                                 /* -SELVE */
  649.    05,0200+'k','n','i','v',                                 /* -KNIVE */
  650.    05,0200+'l','i','e','v',                                 /* -LIEVE */
  651.    0100+03,0200+'q','u',                                    /* /QUE */
  652.    07,'o','n',0200+'t','i','n',0200+'u',                    /* ON-TIN-UE */
  653.    03,0200+'n','u',                                         /* -NUE */
  654.    03,0200+'d','u',                                         /* -DUE */
  655.    0300+02,'u',                                             /* U/E */
  656.    0300+05,'q','u','a','t',                                 /*  QUAT/E */
  657.    04,'u',0200+'a','t',                                     /* U-ATE */
  658.    05,0200+'s','t','a','t',                                 /* -STATE */
  659.    04,0200+'t','a','t',                                     /* -TATE */
  660.    06,0200+'t','o','r',0200+'a','t',                        /* -TOR-ATE */
  661.    05,'e','n',0200+'a','t',                                 /* EN-ATE */
  662.    04,0200+'m','a','t',                                     /* -MATE */
  663.    05,0200+'h','o','u','s',                                 /* -HOUSE */
  664.    05,0200+'c','l','o','s',                                 /* -CLOSE */
  665.    04,'i',0200+'o','s',                                     /* I-OSE */
  666.    04,0200+'w','i','s',                                     /* -WISE */
  667.    05,'a','s',0200+'u','r',                                 /* AS-URE */
  668.    040+04,0200+'s','u','r',                                 /* -SURE */
  669.    06,0200+'f','i','g',0200+'u','r',                        /* -FIG-URE */
  670.    040+03,0200+'t','r',                                     /* -TRE */
  671.    05,0200+'s','t','o','r',                                 /* -STORE */
  672.    04,0200+'f','o','r',                                     /* -FORE */
  673.    05,0200+'w','h','e','r',                                 /* -WHERE */
  674.    06,0200+'s','p','h','e','r',                             /* -SPHERE */
  675.    03,0200+'d','r',                                         /* -DRE */
  676.    03,0200+'c','r',                                         /* -CRE */
  677.    03,0200+'b','r',                                         /* -BRE */
  678.    05,0200+'s','c','o','p',                                 /* -SCOPE */
  679.    04,'y',0200+'o','n',                                     /* Y-ONE */
  680.    05,0200+'s','t','o','n',                                 /* -STONE */
  681.    05,0200+'p','h','o','n',                                 /* -PHONE */
  682.    04,0200+'g','o','n',                                     /* -GONE */
  683.    04,'e',0200+'o','n',                                     /* E-ONE */
  684.    040+04,0200+'e','n','n',                                 /* -ENNE */
  685.    040+05,'a',0200+'r','i','n',                             /* A-RINE */
  686.    05,0200+'c','l','i','n',                                 /* -CLINE */
  687.    04,0200+'l','i','n',                                     /* -LINE */
  688.    007,00200+'r','o','u',00200+'t','i','n',                 /*-ROU-TINE */
  689.    04,0200+'s','o','m',                                     /* -SOME */
  690.    04,0200+'c','o','m',                                     /* -COME */
  691.    04,0200+'t','i','m',                                     /* -TIME */
  692.    03,0200+'z','l',                                         /* -ZLE */
  693.    03,0200+'t','l',                                         /* -TLE */
  694.    03,0200+'s','l',                                         /* -SLE */
  695.    03,0200+'p','l',                                         /* -PLE */
  696.    05,0200+'v','i','l','l',                                 /* -VILLE */
  697.    04,'c','k',0200+'l',                                     /* CK-LE */
  698.    03,0200+'k','l',                                         /* -KLE */
  699.    03,0200+'g','l',                                         /* -GLE */
  700.    03,0200+'f','l',                                         /* -FLE */
  701.    03,0200+'d','l',                                         /* -DLE */
  702.    03,0200+'c','l',                                         /* -CLE */
  703.    05,0200+'p','a',0200+'b','l',                            /* -PA-BLE */
  704.    05,'f','a',0200+'b','l',                                 /* FA-BLE */
  705.    05,0200+'c','a',0200+'b','l',                            /* -CA-BLE */
  706.    06,0200+'s','t','a','b','l',                             /* -STABLE */
  707.    04,0200+'a','b','l',                                     /* -ABLE */
  708.    03,0200+'b','l',                                         /* -BLE */
  709.    04,0200+'d','a','l',                                     /* -DALE */
  710.    04,0200+'m','a','l',                                     /* -MALE */
  711.    04,0200+'s','a','l',                                     /* -SALE */
  712.    04,0200+'l','i','k',                                     /* -LIKE */
  713.    0340+05,'g',0200+'u','a','g',                            /* -G/UAGE */
  714.    05,0200+'r','i','a','g',                                 /* -RIAGE */
  715.    05,'e','r',0200+'a','g',                                 /* ER-AGE */
  716.    04,'m',0200+'a','g',                                     /* M-AGE */
  717.    04,'k',0200+'a','g',                                     /* K-AGE */
  718.    04,'d',0200+'a','g',                                     /* D-AGE */
  719.    04,0200+'w','i','f',                                     /* -WIFE */
  720.    05,0200+'k','n','i','f',                                 /* -KNYFE */
  721.    03,0200+'s','e',                                         /* -SEE */
  722.    04,0200+'f','r','e',                                     /* -FREE */
  723.    0340+02,'e',                                             /* EE */
  724.    04,0200+'w','i','d',                                     /* -WIDE */
  725.    04,0200+'t','i','d',                                     /* -TIDE */
  726.    04,0200+'s','i','d',                                     /* -SIDE */
  727.    06,0200+'q','u','e','n','c',                             /* -QUENCE */
  728.    07,0200+'f','l','u',0200+'e','n','c',                    /* -FLU-ENCE */
  729.    040+06,'e','s',0200+'e','n','c',                         /* ES-ENCE */
  730.    06,'e','r',0200+'e','n','c',                             /* ER-ENCE */
  731.    05,'i',0200+'e','n','c',                                 /* I-ENCE */
  732.    040+05,0200+'s','a','n','c',                             /* -SANCE */
  733.    06,'e','r',0200+'a','n','c',                             /* ER-ANCE */
  734.    06,'a','r',0200+'a','n','c',                             /* AR-ANCE */
  735.    05,0200+'n','a','n','c',                                 /* -NANCE */
  736.    07,0200+'b','a','l',0200+'a','n','c',                    /* -BAL-ANCE */
  737.    05,'i',0200+'a','n','c',                                 /* I-ANCE */
  738.    07,0200+'j','u','s',0200+'t','i','c',                    /* -JUS-TICE */
  739.    05,0200+'s','t','i','c',                                 /* -STICE */
  740.    05,0200+'p','i','e','c',                                 /* -PIECE */
  741.    05,0200+'p','l','a','c',                                 /* -PLACE */
  742.    0340+01,                                                 /* /E */
  743.    00
  744.    };
  745.  
  746. static char suff[] =
  747.    {
  748.    03,0200+'o','f',                                         /* -OFF */
  749.    05,0200+'p','r','o','o',                                 /* -PROOF */
  750.    04,0200+'s','e','l',                                     /* -SELF */
  751.    03,0200+'r','i',                                         /* -RIF */
  752.    040+04,0200+'l','i','e',                                 /* -LIEF */
  753.    00
  754.    };
  755.  
  756. static char sufg[] =
  757.    {
  758.    03,0200+'l','o',                                         /* -LOG */
  759.    04,0200+'l','o','n',                                     /* -LONG */
  760.    05,'t',0200+'t','i','n',                                 /* T-TING */
  761.    06,0200+'s','t','r','i','n',                             /*  -STRING */
  762.    05,'r',0200+'r','i','n',                                 /* R-RING */
  763.    05,'p',0200+'p','i','n',                                 /* P-PING */
  764.    05,'n',0200+'n','i','n',                                 /* N-NING */
  765.    05,'m',0200+'m','i','n',                                 /* M-MING */
  766.    05,'l',0200+'l','i','n',                                 /*  L-LING */
  767.    05,0200+'z','l','i','n',                                 /* -ZLING */
  768.    05,0200+'t','l','i','n',                                 /* -TLING */
  769.    040+05,'s',0200+'l','i','n',                             /* S-LING */
  770.    05,'r',0200+'l','i','n',                                 /* R-LING */
  771.    05,0200+'p','l','i','n',                                 /* -PLING */
  772.    06,'n',0200+'k','l','i','n',                             /* N-KLING */
  773.    05,'k',0200+'l','i','n',                                 /* K-LING */
  774.    05,0200+'g','l','i','n',                                 /* -GLING */
  775.    05,0200+'f','l','i','n',                                 /* -FLING */
  776.    05,0200+'d','l','i','n',                                 /* -DLING */
  777.    05,0200+'c','l','i','n',                                 /* -CLING */
  778.    05,0200+'b','l','i','n',                                 /* -BLING */
  779.    06,'y',0200+'t','h','i','n',                             /* Y-THING */
  780.    07,'e','e','t','h',0200+'i','n',                         /* EETH-ING */
  781.    06,'e',0200+'t','h','i','n',                             /* E-THING */
  782.    05,'g',0200+'g','i','n',                                 /* G-GING */
  783.    05,'d',0200+'d','i','n',                                 /* D-DING */
  784.    05,'b',0200+'b','i','n',                                 /* B-BING */
  785.    03,0200+'i','n',                                         /* -ING */
  786.    00
  787.    };
  788.  
  789. static    char sufh[] =
  790.    {
  791.    05,0200+'m','o','u','t',                                 /* -MOUTH */
  792.    05,0200+'w','o','r','t',                                 /* -WORTH */
  793.    04,0200+'w','i','t',                                     /* -WITH */
  794.    05,'t',0200+'t','i','s',                                 /* T-TISH */
  795.    05,'e',0200+'t','i','s',                                 /* E-TISH */
  796.    05,'p',0200+'p','i','s',                                 /* P-PISH */
  797.    05,'r',0200+'n','i','s',                                 /* R-NISH */
  798.    05,'n',0200+'n','i','s',                                 /* N-NISH */
  799.    05,0200+'p','l','i','s',                                 /* -PLISH */
  800.    05,0200+'g','u','i','s',                                 /*  -GUISH */
  801.    05,0200+'g','l','i','s',                                 /*  -GLISH */
  802.    05,'b',0200+'l','i','s',                                 /*  B-LISH */
  803.    05,'g',0200+'g','i','s',                                 /* G-GISH */
  804.    05,'d',0200+'d','i','s',                                 /* D-DISH */
  805.    03,0200+'i','s',                                         /* -ISH */
  806.    05,0200+'g','r','a','p',                                 /* -GRAPH */
  807.    07,0200+'b','o','r',0200+'o','u','g',                    /* -BOR-OUGH */
  808.    05,0200+'b','u','r','g',                                 /* -BURGH */
  809.    04,0200+'v','i','c',                                     /* -VICH */
  810.    03,0200+'n','a',                                         /* -NAH */
  811.    03,0200+'l','a',                                         /* -LAH */
  812.    04,0200+'m','i',0200+'a',                                /* -MI-AH */
  813.    00
  814.    };
  815.  
  816. static char sufi[] =
  817.    {
  818.    03,0200+'t','r',                                         /* -TRI */
  819.    03,0200+'c','h',                                         /* -CHI */
  820.    0200+03,'i','f',                                         /* IF-I */
  821.    0200+03,'e','d',                                         /* ED-I */
  822.    05,0200+'a','s','c','i',                                 /* -ASCII */
  823.    04,0200+'s','e','m',                                     /* -SEMI */
  824.    00
  825.    };
  826.  
  827. static char sufk[] =
  828.    {
  829.    04,0200+'w','o','r',                                     /* -WORK */
  830.    04,0200+'m','a','r',                                     /* -MARK */
  831.    04,0200+'b','o','o',                                     /* -BOOK */
  832.    04,0200+'w','a','l',                                     /* -WALK */
  833.    05,0200+'c','r','a','c',                                 /* -CRACK */
  834.    04,0200+'b','a','c',                                     /* -BACK */
  835.    00
  836.    };
  837.  
  838. static char sufl[] =
  839.    {
  840.    03,0200+'f','u',                                         /* -FUL */
  841.    05,'s',0200+'w','e','l',                                 /* S-WELL */
  842.    04,0200+'t','e','l',                                     /* -TELL */
  843.    05,0200+'s','h','e','l',                                 /* -SHELL */
  844.    05,0200+'s','t','a','l',                                 /* -STALL */
  845.    04,0200+'s','t','a',                                     /* -STAL */
  846.    04,0200+'b','a','l',                                     /* -BALL */
  847.    04,0200+'c','a','l',                                     /* -CALL */
  848.    03,'v',0200+'e',                                         /* V-EL */
  849.    03,'u',0200+'e',                                         /* U-EL */
  850.    03,'k',0200+'e',                                         /* K-EL */
  851.    04,'t','h',0200+'e',                                     /* TH-EL */
  852.    05,'t','c','h',0200+'e',                                 /* TCH-EL */
  853.    03,'a',0200+'e',                                         /* A-EL */
  854.    0140+04,0200+'q','u','a',                                /* /QUAL */
  855.    040+03,'u',0200+'a',                                     /* U-AL */
  856.    03,0200+'t','a',                                         /* -TAL */
  857.    04,'u','r',0200+'a',                                     /* UR-AL */
  858.    040+05,'g',0200+'o',0200+'n','a',                        /* G-O-NAL */
  859.    04,'o','n',0200+'a',                                     /* ON-AL */
  860.    03,0200+'n','a',                                         /* -NAL */
  861.    04,0200+'t','i','a',                                     /* -TIAL */
  862.    04,0200+'s','i','a',                                     /* -SIAL */
  863.    040+05,0200+'t','r','i',0200+'a',                        /* -TRI-AL */
  864.    04,'r','i',0200+'a',                                     /* RI-AL */
  865.    04,0200+'n','i',0200+'a',                                /* -NI-AL */
  866.    04,0200+'d','i',0200+'a',                                /* -DI-AL */
  867.    04,0200+'c','i','a',                                     /* -CIAL */
  868.    03,0200+'g','a',                                         /* -GAL */
  869.    04,0200+'m','e','a',                                     /* -MEAL */
  870. /* >>>    040+04,0200+'r','e',0200+'a', */                    /* (del) -RE-AL */
  871.    040+04,0200+'r','e','a',                                 /* -REAL */
  872.    06,'c',0200+'t','i',0200+'c','a',                        /* C-TI-CAL */
  873.    05,0200+'s','i',0200+'c','a',                            /* -SI-CAL */
  874.    04,0200+'i',0200+'c','a',                                /* -I-CAL */
  875.    03,0200+'c','a',                                         /* -CAL */
  876.    03,0200+'b','a',                                         /* -BAL */
  877.    06,0200+'n','o',0200+'m','i',0200+'a',                   /* -NO-MI-AL */
  878.    00
  879.    };
  880.  
  881. static char sufm[] =
  882.    {
  883.    03,0200+'n','u',                                         /* -NUM */
  884.    05,'o',0200+'r','i',0200+'u',                            /* O-RI-UM */
  885.    040+03,'i',0200+'u',                                     /* I-UM */
  886.    040+03,'e',0200+'u',                                     /* E-UM */
  887.    05,'i','v',0200+'i','s',                                 /* IV-ISM */
  888.    04,0200+'t','i','s',                                     /* -TISM */
  889.    05,'i',0200+'m','i','s',                                 /* I-MISM */
  890.    05,'a','l',0200+'i','s',                                 /* AL-ISM */
  891.    040+04,'e',0200+'i','s',                                 /* E-ISM */
  892.    040+04,'a',0200+'i','s',                                 /* A-ISM */
  893.    04,0200+'r','o','o',                                     /* -ROOM */
  894.    03,0200+'d','o',                                         /* -DOM */
  895.    03,0200+'h','a',                                         /* -HAM */
  896.    06,0200+'a',0200+'r','i','t','h',                        /* -A-RITHM */
  897.    05,0200+'r','i','t','h',                                 /* -RITHM */
  898.    00
  899.    };
  900.  
  901. static char sufn[] =
  902.    {
  903.    04,0200+'t','o','w',                                     /* -TOWN */
  904.    04,0200+'d','o','w',                                     /* -DOWN */
  905.    04,0200+'t','u','r',                                     /* -TURN */
  906.    05,0200+'s','p','o','o',                                 /* -SPOON */
  907.    04,0200+'n','o','o',                                     /* -NOON */
  908.    04,0200+'m','o','o',                                     /* -MOON */
  909.    011,'a','l',0200+'i',0200+'z','a',0200+'t','i','o',      /* AL-I-ZA-TION */
  910.    07,0200+'i',0200+'z','a',0200+'t','i','o',               /* -I-ZA-TION */
  911.    07,'l',0200+'i',0200+'a',0200+'t','i','o',               /* L-I-A-TION */
  912.    04,0200+'t','i','o',                                     /* -TION */
  913.    040+05,'s',0200+'s','i','o',                             /* S-SION */
  914.    04,0200+'s','i','o',                                     /* -SION */
  915.    04,'n',0200+'i','o',                                     /* N-ION */
  916.    04,0200+'g','i','o',                                     /* -GION */
  917.    04,0200+'c','i','o',                                     /* -CION */
  918.    03,0200+'c','o',                                         /* -CON */
  919.    05,0200+'c','o','l','o',                                 /* -COLON */
  920.    03,0200+'t','o',                                         /* -TON */
  921.    04,'i','s',0200+'o',                                     /* IS-ON */
  922.    03,0200+'s','o',                                         /* -SON */
  923.    03,0200+'r','i',                                         /* -RIN */
  924.    03,0200+'p','i',                                         /* -PIN */
  925.    03,0200+'n','i',                                         /* -NIN */
  926.    03,0200+'m','i',                                         /* -MIN */
  927.    03,0200+'l','i',                                         /* -LIN */
  928.    03,0200+'k','i',                                         /* -KIN */
  929.    05,0200+'s','t','e','i',                                 /* -STEIN */
  930.    04,0200+'t','a','i',                                     /* -TAIN */
  931.    05,'g','h','t',0200+'e',                                 /* GHT-EN */
  932.    05,0200+'w','o','m',0200+'e',                            /* -WOM-EN */
  933.    03,0200+'m','e',                                         /* -MEN */
  934.    04,'o',0200+'k','e',                                     /* O-KEN */
  935.    03,'k',0200+'e',                                         /* K-EN */
  936.    04,0200+'t','e','e',                                     /* -TEEN */
  937.    04,0200+'s','e','e',                                     /* -SEEN */
  938.    040+03,0200+'s','a',                                     /* -SAN */
  939.    05,0200+'w','o','m',0200+'a',                            /* -WOM-AN */
  940.    03,0200+'m','a',                                         /* -MAN */
  941.    04,0200+'t','i','a',                                     /* -TIAN */
  942.    04,0200+'s','i','a',                                     /* -SIAN */
  943.    040+04,'e',0200+'i','a',                                 /* E-IAN */
  944.    04,0200+'c','i','a',                                     /* -CIAN */
  945.    0300+03,'i','a',                                         /* IA/N */
  946.    05,0200+'c','l','e','a',                                 /* -CLEAN */
  947.    04,0200+'m','e','a',                                     /* -MEAN */
  948.    040+03,'e',0200+'a',                                     /* E-AN */
  949.    00
  950.    };
  951.  
  952. static char sufo[] =
  953.    {
  954.    05,0200+'m','a','c',0200+'r',                            /* -MAC-RO */
  955.    00
  956.    };
  957.  
  958. static char sufp[] =
  959.    {
  960.    05,0200+'g','r','o','u',                                 /* -GROUP */
  961.    02,0200+'u',                                             /* -UP */
  962.    04,0200+'s','h','i',                                     /* -SHIP */
  963.    04,0200+'k','e','e',                                     /* -KEEP */
  964.    00
  965.    };
  966.  
  967. static char sufr[] =
  968.    {
  969.    04,0200+'z','a','r',                                     /* -ZARR */
  970.    0300+02,'r',                                             /* R/R */
  971.    03,0200+'t','o',                                         /* -TOR */
  972.    040+03,0200+'s','o',                                     /* -SOR */
  973.    040+04,0200+'r','i',0200+'o',                            /* -RI-OR */
  974.    04,'i','z',0200+'e',                                     /* IZ-ER */
  975.    05,0200+'c','o','v',0200+'e',                            /* -COV-ER */
  976. /* >>>    04,'o',0200+'v','e', */                             /* (del) O-VER */
  977.    04,0200+'o','v','e',                                     /* -OVER */
  978.    04,0200+'e','v',0200+'e',                                /* -EV-ER */
  979.    8,0200+'c','o','m',0200+'p','u','t',0200+'e',            /* -COM-PUT-ER */
  980.    040+05,'u','s',0200+'t','e',                             /* US-TER */
  981.    05,'o','s','t',0200+'e',                                 /* OST-ER */
  982.    040+05,0200+'a','c',0200+'t','e',                        /* -AC-TER */
  983.    06,0200+'w','r','i','t',0200+'e',                        /* -WRIT-ER */
  984.    040+05,'i','s',0200+'t','e',                             /* IS-TER */
  985.    040+05,'e','s',0200+'t','e',                             /* ES-TER */
  986.    040+05,'a','s',0200+'t','e',                             /* AS-TER */
  987.    04,0200+'s','t','e',                                     /* -STER */
  988.    05,'a','r',0200+'t','e',                                 /* AR-TER */
  989.    04,'r','t',0200+'e',                                     /* RT-ER */
  990.    040+05,'m',0200+'e',0200+'t','e',                        /* M-E-TER */
  991.    05,0200+'w','a',0200+'t','e',                            /* -WA-TER */
  992.    03,'r',0200+'e',                                         /* R-ER */
  993.    04,'o','p',0200+'e',                                     /* OP-ER */
  994.    05,0200+'p','a',0200+'p','e',                            /* -PA-PER */
  995.    04,'w','n',0200+'e',                                     /* WN-ER */
  996.    040+04,'s',0200+'n','e',                                 /* S-NER */
  997.    04,'o','n',0200+'e',                                     /* ON-ER */
  998.    04,'r','m',0200+'e',                                     /* RM-ER */
  999.    03,0200+'m','e',                                         /* -MER */
  1000.    04,'l','l',0200+'e',                                     /* LL-ER */
  1001.    05,'d',0200+'d','l','e',                                 /* D-DLER */
  1002.    04,0200+'b','l','e',                                     /* -BLER */
  1003.    03,'k',0200+'e',                                         /* K-ER */
  1004.    05,'n',0200+'t','h','e',                                 /* N-THER */
  1005.    06,0200+'f','a',0200+'t','h','e',                        /* -FA-THER */
  1006.    06,'e','i',0200+'t','h','e',                             /* EI-THER */
  1007.    04,'t','h',0200+'e',                                     /* TH-ER */
  1008.    04,'s','h',0200+'e',                                     /* SH-ER */
  1009.    04,0200+'p','h','e',                                     /* -PHER */
  1010.    04,'c','h',0200+'e',                                     /* CH-ER */
  1011.    04,'d','g',0200+'e',                                     /* DG-ER */
  1012.    04,'r','d',0200+'e',                                     /* RD-ER */
  1013.    06,'o','u','n','d',0200+'e',                             /* OUND-ER */
  1014.    04,'l','d',0200+'e',                                     /* LD-ER */
  1015.    04,'i','d',0200+'e',                                     /* ID-ER */
  1016.    05,0200+'d','u','c',0200+'e',                            /* -DUC-ER */
  1017.    04,'n','c',0200+'e',                                     /* NC-ER */
  1018.    0100+02,0200+'e',                                        /*  /ER */
  1019.    03,0200+'s','a',                                         /* -SAR */
  1020.    040+06,'a','c',0200+'u',0200+'l','a',                    /* AC-U-LAR */
  1021.    040+06,'e','c',0200+'u',0200+'l','a',                    /* EC-U-LAR */
  1022.    040+06,'i','c',0200+'u',0200+'l','a',                    /* IC-U-LAR */
  1023.    040+06,'e','g',0200+'u',0200+'l','a',                    /* EG-U-LAR */
  1024.    00
  1025.    };
  1026.  
  1027. static char sufs[] =
  1028.    {
  1029.    040+04,'u',0200+'o','u',                                 /* U-OUS */
  1030.    05,0200+'t','i','o','u',                                 /* -TIOUS */
  1031.    05,0200+'g','i','o','u',                                 /* -GIOUS */
  1032.    05,0200+'c','i','o','u',                                 /* -CIOUS */
  1033.    040+04,'i',0200+'o','u',                                 /* I-OUS */
  1034.    05,0200+'g','e','o','u',                                 /* -GEOUS */
  1035.    05,0200+'c','e','o','u',                                 /* -CEOUS */
  1036.    04,'e',0200+'o','u',                                     /* E-OUS */
  1037.    0140+02,0200+'u',                                        /* /US */
  1038.    04,0200+'n','e','s',                                     /* -NESS */
  1039.    04,0200+'l','e','s',                                     /* -LESS */
  1040.    0140+02,0200+'s',                                        /* /SS */
  1041.    040+05,'p',0200+'o',0200+'l','i',                        /* P-O-LIS */
  1042.    0140+02,0200+'i',                                        /* /IS */
  1043.    0100+03,0200+'x','e',                                    /* X/ES */
  1044.    0100+03,0200+'s','e',                                    /* S/ES */
  1045.    0100+04,'s','h',0200+'e',                                /* SH/ES */
  1046.    0100+04,'c','h',0200+'e',                                /* CH/ES */
  1047.    0300+01,                                                 /* /S */
  1048.    00
  1049.    };
  1050.  
  1051. static char suft[] =
  1052.    {
  1053.    06,'i','o','n',0200+'i','s',                             /* ION-IST */
  1054.    05,'i','n',0200+'i','s',                                 /* IN-IST */
  1055.    05,'a','l',0200+'i','s',                                 /* AL-IST */
  1056.    06,'l',0200+'o',0200+'g','i','s',                        /* L-O-GIST */
  1057.    05,'h','t',0200+'e','s',                                 /* HT-EST */
  1058.    04,'i',0200+'e','s',                                     /* I-EST */
  1059.    05,'g',0200+'g','e','s',                                 /* G-GEST */
  1060.    04,'g',0200+'e','s',                                     /* G-EST */
  1061.    05,'d',0200+'d','e','s',                                 /* D-DEST */
  1062.    04,'d',0200+'e','s',                                     /* D-EST */
  1063.    04,0200+'c','a','s',                                     /* -CAST */
  1064.    05,0200+'h','e','a','r',                                 /* -HEART */
  1065.    04,0200+'f','o','o',                                     /* -FOOT */
  1066.    03,'i',0200+'o',                                         /* I-OT */
  1067.    05,0200+'f','r','o','n',                                 /* -FRONT */
  1068.    05,0200+'p','r','i','n',                                 /* -PRINT */
  1069.    04,0200+'m','e','n',                                     /* -MENT */
  1070.    05,0200+'c','i','e','n',                                 /* -CIENT */
  1071.    04,'i',0200+'a','n',                                     /* I-ANT */
  1072.    06,0200+'w','r','i','g','h',                             /* -WRIGHT */
  1073.    06,0200+'b','r','i','g','h',                             /* -BRIGHT */
  1074.    06,0200+'f','l','i','g','h',                             /* -FLIGHT */
  1075.    06,0200+'w','e','i','g','h',                             /* -WEIGHT */
  1076.    05,0200+'s','h','i','f',                                 /* -SHIFT */
  1077.    05,0200+'c','r','a','f',                                 /* -CRAFT */
  1078.    040+04,'d','g',0200+'e',                                 /* DG-ET */
  1079.    04,0200+'g','o','a',                                     /* -GOAT */
  1080.    04,0200+'c','o','a',                                     /* -COAT */
  1081.    04,0200+'b','o','a',                                     /* -BOAT */
  1082.    04,0200+'w','h','a',                                     /* -WHAT */
  1083.    04,0200+'c','u','i',                                     /* -CUIT */
  1084.    00
  1085.    };
  1086.  
  1087. static char sufy[] =
  1088.    {
  1089.    040+04,'e','s',0200+'t',                                 /* ES-TY */
  1090.    040+05,'q','u','i',0200+'t',                             /* QUI-TY */
  1091.    04,0200+'t','i',0200+'t',                                /* -TI-TY */
  1092.    040+05,'o','s',0200+'i',0200+'t',                        /* OS-I-TY */
  1093.    04,0200+'s','i',0200+'t',                                /* -SI-TY */
  1094.    05,'i','n',0200+'i',0200+'t',                            /* IN-I-TY */
  1095.    04,'n','i',0200+'t',                                     /* NI-TY */
  1096.    040+010,'f','a',0200+'b','i','l',0200+'i',0200+'t',      /* FA-BIL-I-TY */
  1097.    010,0200+'c','a',0200+'b','i','l',0200+'i',0200+'t',     /* -CA-BIL-I-TY */
  1098.    010,0200+'p','a',0200+'b','i','l',0200+'i',0200+'t',     /* -PA-BIL-I-TY */
  1099.    06,0200+'b','i','l',0200+'i',0200+'t',                   /* -BIL-I-TY */
  1100.    03,'i',0200+'t',                                         /* I-TY */
  1101.    04,0200+'b','u','r',                                     /* -BUR-Y */
  1102.    04,0200+'t','o',0200+'r',                                /* -TO-RY */
  1103.    05,0200+'q','u','a','r',                                 /* -QUAR-Y */
  1104.    040+04,'u',0200+'a','r',                                 /* U-ARY */
  1105.    07,0200+'m','e','n',0200+'t','a',0200+'r',               /* -MEN-TA-RY */
  1106.    06,'i','o','n',0200+'a','r',                             /* ION-ARY */
  1107.    04,'i',0200+'a','r',                                     /* I-ARY */
  1108.    04,'n',0200+'o',0200+'m',                                /* N-O-MY */
  1109.    03,0200+'p','l',                                         /* -PLY */
  1110.    04,'g',0200+'g','l',                                     /* G-GLY */
  1111.    05,0200+'p','a',0200+'b','l',                            /* -PA-BLY */
  1112.    05,'f','a',0200+'b','l',                                 /* FA-BLY */
  1113.    05,0200+'c','a',0200+'b','l',                            /* -CA-BLY */
  1114.    04,0200+'a','b','l',                                     /* -ABLY */
  1115.    03,0200+'b','l',                                         /* -BLY */
  1116.    02,0200+'l',                                             /* -LY */
  1117.    03,0200+'s','k',                                         /* -SKY */
  1118.    040+06,'g',0200+'r','a',0200+'p','h',                    /* G-RA-PHY */
  1119.    04,'l',0200+'o',0200+'g',                                /* L-O-GY */
  1120.    02,0200+'f',                                             /* -FY */
  1121.    03,0200+'n','e',                                         /* -NEY */
  1122.    03,0200+'l','e',                                         /* -LEY */
  1123.    04,'c','k',0200+'e',                                     /* CK-EY */
  1124.    03,0200+'k','e',                                         /* -KEY */
  1125.    04,0200+'b','o','d',                                     /* -BODY */
  1126.    05,0200+'s','t','u','d',                                 /* -STUDY */
  1127.    0340+04,'e','e','d',                                     /* EEDY */
  1128.    02,0200+'b',                                             /* -BY */
  1129.    03,0200+'w','a',                                         /* -WAY */
  1130.    03,0200+'d','a',                                         /* -DAY */
  1131.    00
  1132.    };
  1133.  
  1134. char *suftab[] =
  1135.    {
  1136.    sufa, 0, sufc, sufd, sufe, suff, sufg, sufh, sufi, 0,
  1137.    sufk, sufl, sufm, sufn, sufo, sufp, 0, sufr, sufs, suft,
  1138.    0, 0, 0, 0, sufy, 0
  1139.    };
  1140. SHAR_EOF
  1141.  
  1142. -- 
  1143. (* Posted from tharr.uucp - Public Access Unix - +44 (234) 261804 *)
  1144.