source: trunk/indexers/mg/stemmerinterface.c@ 13670

Last change on this file since 13670 was 3745, checked in by mdewsnip, 21 years ago

Addition of MG package for search and retrieval

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 679 bytes
Line 
1#include "lib/lovinstem.h"
2#include <stdio.h>
3#include <ctype.h>
4
5int main () {
6 char word[256];
7 char c;
8 int len;
9
10 c = fgetc (stdin);
11 while (!feof (stdin)) {
12 /* output non words */
13 while (!feof (stdin) && !isalnum (c)) {
14 fputc (c, stdout);
15 c = fgetc (stdin);
16 }
17
18 /* get the word */
19 len = 0;
20 while (!feof (stdin) && isalnum (c) && len < 255) {
21 len++;
22 word[len] = c;
23 c = fgetc (stdin);
24 }
25 word[0] = len;
26
27 /* if we found a word stem and output it */
28 if (len > 0) {
29 lovinstem (word);
30 len = 0;
31 while (len < word[0]) {
32 len++;
33 fputc(word[len], stdout);
34 }
35 }
36 }
37}
38
39
Note: See TracBrowser for help on using the repository browser.