2 * Copyright (C) 1994, Index Data I/S
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.4 1994-09-01 17:49:37 adam
8 * Removed stupid line. Work on insertion in dictionary. Not finished yet.
10 * Revision 1.3 1994/09/01 17:44:06 adam
11 * depend include change.
13 * Revision 1.2 1994/08/18 12:40:54 adam
14 * Some development of dictionary. Not finished at all!
16 * Revision 1.1 1994/08/16 16:26:47 adam
30 int main (int argc, char **argv)
32 const char *name = NULL;
33 const char *inputfile = NULL;
34 const char *base = NULL;
44 fprintf (stderr, "usage:\n"
45 " %s [-s n] [-v n] [-i f] [-w] [-c n] base file\n",
49 while ((ret = options ("s:v:i:wc:", argv, argc, &arg)) != -2)
59 log (LOG_FATAL, "too many files specified\n");
82 log_init (atoi(arg), prog, NULL);
86 log (LOG_FATAL, "unknown option");
92 log (LOG_FATAL, "no base and/or dictionary specified");
95 common_resource = res_open (base);
98 log (LOG_FATAL, "cannot open resource `%s'", base);
101 dict = dict_open (name, cache, rw);
104 log (LOG_FATAL, "dict_open fail of `%s'", name);
114 memset (infobytes, 0, 120);
116 if (!(ipf = fopen(inputfile, "r")))
118 log (LOG_FATAL|LOG_ERRNO, "cannot open %s", inputfile);
122 while (fgets (ipf_buf, 255, ipf))
124 if (sscanf (ipf_buf, "%s", word) == 1)
126 sprintf (infobytes, "%d", line);
127 dict_insert (dict, word, infosize, infobytes);
134 res_close (common_resource);