2 * Copyright (C) 1994, Index Data I/S
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.3 1994-09-01 17:44:06 adam
8 * depend include change.
9 * CVS ----------------------------------------------------------------------
11 * Revision 1.2 1994/08/18 12:40:54 adam
12 * Some development of dictionary. Not finished at all!
14 * Revision 1.1 1994/08/16 16:26:47 adam
28 int main (int argc, char **argv)
30 const char *name = NULL;
31 const char *inputfile = NULL;
32 const char *base = NULL;
42 fprintf (stderr, "usage:\n"
43 " %s [-s n] [-v n] [-i f] [-w] [-c n] base file\n",
47 while ((ret = options ("s:v:i:wc:", argv, argc, &arg)) != -2)
57 log (LOG_FATAL, "too many files specified\n");
80 log_init (atoi(arg), prog, NULL);
84 log (LOG_FATAL, "unknown option");
90 log (LOG_FATAL, "no base and/or dictionary specified");
93 common_resource = res_open (base);
96 log (LOG_FATAL, "cannot open resource `%s'", base);
99 dict = dict_open (name, cache, rw);
102 log (LOG_FATAL, "dict_open fail of `%s'", name);
112 memset (infobytes, 0, 120);
114 if (!(ipf = fopen(inputfile, "r")))
116 log (LOG_FATAL|LOG_ERRNO, "cannot open %s", inputfile);
120 while (fgets (ipf_buf, 255, ipf))
122 if (sscanf (ipf_buf, "%s", word) == 1)
124 sprintf (infobytes, "%d", line);
125 dict_insert (dict, word, infosize, infobytes);
132 res_close (common_resource);