This source file includes following definitions.
- main
1
2
3
4
5
6
7
8 static char *rcs_id = "$Id: staslova.c,v 1.2 2007/09/09 11:14:33 isao Exp $";
9
10 #include <stdio.h>
11 #include <string.h>
12 #include "staslova.h"
13 #include "table.h"
14
15 int
16 main(int argc, char **argv)
17 {
18 unsigned char *word;
19 struct cdent **cdp = cdtbl;
20 char *pn = *argv;
21 int i, rtn;
22
23
24 if ((pn = (char *)strrchr(pn, '/')) != NULL)
25 pn++;
26 else
27 pn = *argv;
28
29 fprintf(stderr, "%s %s\n", pn, ver);
30 printf("***** %s %s\n", pn, ver);
31
32 if (rtn = extender(argc, argv)) {
33 print_usage(pn);
34 return rtn;
35 }
36
37
38 wdcount = 0;
39 while ((word = fetchword()) != NULL) {
40 if (casemode == '0')
41 (unsigned char *)mlchrlower(word+2);
42
43 statisticsctrl(word);
44 if (task & MTCT)
45 matchingctrl(word);
46 }
47
48
49 if (task & STAT)
50 for (i=0; i < 3; i++) {
51 printf("***** %s word statistics report <%s>\n", pn, langname[i]);
52 wdtotal = wdnum = 0;
53 printwdtree(langroot[i], STAT);
54 printf("***** %d total statistics of %d words. <%s>\n",
55 wdtotal, wdnum, langname[i]);
56 printf("\n");
57 }
58
59
60 if (task & MTCT)
61 while (*cdp != NULL) {
62 printf("***** %s matching test report\n", pn);
63 printcdtable(*cdp);
64 if (outmode > '0') {
65 wdtotal = wdnum = 0;
66 printwdtree((*cdp)->mwdroot, MTCT);
67 printf("***** %d total statistics of %d words.\n",
68 wdtotal, wdnum);
69 }
70 printf("\n");
71 cdp++;
72 }
73
74
75 fprintf(stderr,"processed %d lines.\n", --lno);
76 return 0;
77 }
78
79
80
81