home *** CD-ROM | disk | FTP | other *** search
- /*
- * 78diff - compute trigram score for words
- */
-
- #ifndef lint
- static char _cpyrgt[] = "Copyright 1989 Howard Lee Gayle";
- #endif lint
-
- /*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 1,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
- #include <stdio.h>
- #include <howard/port.h>
- #include <howard/version.h>
- #include <howard/usage.h>
-
- MAINVER ("@(#)$Header: 78diff.c,v 1.7 89/08/25 11:45:50 howard Exp $");
- USAGE ("encodings trigram-difference-table < word-list");
-
- #include <limits.h>
- #include <string.h>
- #include <howard/a2.h>
- #include <howard/malf.h>
- #include <howard/registers.i>
- #include "cz.h"
- #include "78.h"
- #include "78code.h"
- #include "78common.h"
-
- PRIVATE triDifT diftab[TRIMAX + 1]; /* Trigram difference table.*/
-
- /* main - main function */
-
- PUBLIC int main (argc, argv)
- int argc; /* Number of arguments.*/
- bStrT *argv; /* Points to array of argument strings.*/
-
- /* Function:
- *
- * Algorithm:
- * Read each word. Call dif78().
- * Notes:
- *
- */
-
- {
- unsigned ln = 0; /* Input line number.*/
- byteT wb[MLINE]; /* Word buffer.*/
-
- if (3 != argc) usage();
- ipath();
- rdcode (argv[1]);
- mrdtri (argv[2], diftab);
- while (NULBSTR != getlin (wb, MLINE, stdin, S("Standard input"), &ln, 0))
- PRINTF ("%11d %s\n", dif78 (wb, NULBSTR, diftab), wb);
- mfflush (stdout, S("Standard Output"));
- exit (SUCCESS);
-
- #ifdef lint
- return (SUCCESS);
- #endif
- }
-