2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU Library General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 void Under2Space(char *p)
23 for (p=strchr(p, '_'); p; p=strchr(p, '_')) *(p++)=' ';
27 int main (int argc, char *argv[])
31 char word[200], word2[200];
37 case 0: freopen("/usr/share/wordnet/noun.exc", "rt", stdin); break;
38 case 1: freopen("/usr/share/wordnet/verb.exc", "rt", stdin); break;
39 case 2: freopen("/usr/share/wordnet/adj.exc", "rt", stdin); break;
40 case 3: freopen("/usr/share/wordnet/adv.exc", "rt", stdin); break;
42 while (fgets(word, 200, stdin))
49 for (p=strtok(p, " "); p; p=strtok(NULL, " "))
54 sprintf(word2, "%ses", p);
55 if (strcmp(word, word2)==0) continue;
59 if (p[strlen(p)-1]=='y')
62 strcpy(word2+strlen(word2)-1, "ied");
63 if (strcmp(word, word2)==0) continue;
65 if (strchr("bcdfghjklmnpqrstvz", p[strlen(p)-1]))
67 sprintf(word2, "%s%ced", p, p[strlen(p)-1]);
68 if (strcmp(word, word2)==0) continue;
69 sprintf(word2, "%s%cing", p, p[strlen(p)-1]);
70 if (strcmp(word, word2)==0) continue;
72 if (p[strlen(p)-1]=='e')
74 sprintf(word2, "%sd", p);
75 if (strcmp(word, word2)==0) continue;
77 sprintf(word2, "%sed", p);
78 if (strcmp(word, word2)==0) continue;
79 sprintf(word2, "%sing", p);
80 if (strcmp(word, word2)==0) continue;
85 if (p[strlen(p)-1]=='y')
88 strcpy(word2+strlen(p)-1, "ier");
89 //printf ("word=%s! word2=%s!\t", word, word2);
90 if (strcmp(word, word2)==0) continue;
91 strcpy(word2+strlen(p)-1, "iest");
92 if (strcmp(word, word2)==0) continue;
94 if (strchr("bcdfghjklmnpqrstvz", p[strlen(p)-1]))
96 sprintf(word2, "%s%cer", p, p[strlen(p)-1]);
97 if (strcmp(word, word2)==0) continue;
98 sprintf(word2, "%s%cest", p, p[strlen(p)-1]);
99 if (strcmp(word, word2)==0) continue;
101 if (p[strlen(p)-1]=='e')
103 sprintf(word2, "%sr", p);
104 if (strcmp(word, word2)==0) continue;
105 sprintf(word2, "%sst", p);
106 if (strcmp(word, word2)==0) continue;
108 sprintf(word2, "%ser", p);
109 if (strcmp(word, word2)==0) continue;
110 sprintf(word2, "%sest", p);
111 if (strcmp(word, word2)==0) continue;
116 if (strcmp(word, p)==0) continue;
117 printf((i)? "%s : => {%s}\n": "%s : pl. of {%s}\n", word, p);
120 case 0: printf("%s : (pl) %s\n", p, word); break;
121 case 1: printf("%s : (%s)\n", p, word); break;
122 case 2: printf("%s : %s (>)\n", p, word); break;
123 case 3: printf("%s : (adv.) %s (>)\n", p, word); break;