Пример #1
0
int updateIndex(char* word, int documentId, INVERTED_INDEX* index) {
    int unique;
    int i;

    // make words lowercase
    for(i = 0; word[i]; i++) {
        word[i] = tolower(word[i]);
    }
    unique = checkUniqueness(word, index);
    if(unique == 1) { // if the word is unique, add new WORD and DOCUMENTNODE
        addNode(word, index, documentId);
        // printf("added new unique node at hash: %d\n", hashIndex);
    } else {
        updateFreq(word, documentId, index);
    }
    return 1;
}
Пример #2
0
 void checkEngine(size_t N, size_t consumeCount, bool check) {
   ShuffleT gen(N);
   check ? checkUniqueness(gen, consumeCount) : consume(gen, consumeCount);
 }