Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- setbuf(stdout, NULL);
- Welcome(kWelcomeTextFile);
- int numBuckets = 10007;
- hashset stopWords;
- HashSetNew(&stopWords, sizeof(char*), numBuckets, Whashfn, Wcomparefn, Wfreefn);
- hashset articles;
- HashSetNew(&articles, sizeof(struct article), numBuckets, Ahashfn, Acomparefn, Afreefn);
- printf("%s\n", "sheiqmna es upatrono 'articles'.");
- hashset allWords;
- HashSetNew(&allWords, sizeof(wordData), numBuckets, Dhashfn, Dcomparefn, Dfreefn);
- printf("%s\n", "sheiqmna es upatrono 'allWords'.");
- // --------------------------------------------------------------------------
- FILE *infile;
- streamtokenizer st;
- char buffer[1024];
- infile = fopen(stoplist, "r");
- assert(infile != NULL);
- printf("%s\n", "after assert");
- STNew(&st, infile, kNewLineDelimiters, true);
- while (STNextToken(&st, buffer, sizeof(buffer))) {
- char* b = strdup(buffer);
- // printf("%s\n", b);
- HashSetEnter(&stopWords, &b);
- }
- printf("\n");
- STDispose(&st); // remember that STDispose doesn't close the file, since STNew doesn't open one..
- fclose(infile);
- // --------------------------------------------------------------------------
- printf("%d\n", HashSetCount(&stopWords));
- printf("%s\n", kDefaultFeedsFile);
- BuildIndices(&stopWords, &allWords, &articles, (argc == 1) ? kDefaultFeedsFile : argv[1]);
- QueryIndices(&stopWords, &allWords);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement