2 * Copyright (C) 1994, Index Data I/S
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.2 1994-08-18 12:40:54 adam
8 * Some development of dictionary. Not finished at all!
10 * Revision 1.1 1994/08/16 16:26:47 adam
24 int main (int argc, char **argv)
26 const char *name = NULL;
27 const char *inputfile = NULL;
34 log_init (LOG_DEFAULT_LEVEL, prog, NULL);
37 fprintf (stderr, "usage:\n"
38 " %s [-v n] [-i f] [-w] [-c n] file\n", prog);
41 while ((ret = options ("v:i:wc:", argv, argc, &arg)) != -2)
47 log (LOG_FATAL, "too many files specified\n");
67 log_init (atoi(arg), prog, NULL);
71 log (LOG_FATAL, "unknown option");
77 log (LOG_FATAL, "no dictionary file given");
80 dict = dict_open (name, cache, rw);
83 log (LOG_FATAL, "dict_open fail");
93 if (!(ipf = fopen(inputfile, "r")))
95 log (LOG_FATAL|LOG_ERRNO, "cannot open %s", inputfile);
99 while (fgets (ipf_buf, 255, ipf))
101 for (i=0; i<255; i++)
102 if (ipf_buf[i] > ' ')
103 word[i] = ipf_buf[i];
108 dict_insert (dict, word, &line);