Beispiel #1
0
uint32_t
PolyLexReader_Doc_Freq_IMP(PolyLexiconReader *self, String *field,
                           Obj *term) {
    PolyLexiconReaderIVARS *const ivars = PolyLexReader_IVARS(self);
    uint32_t doc_freq = 0;
    for (uint32_t i = 0, max = VA_Get_Size(ivars->readers); i < max; i++) {
        LexiconReader *reader = (LexiconReader*)VA_Fetch(ivars->readers, i);
        if (reader) {
            doc_freq += LexReader_Doc_Freq(reader, field, term);
        }
    }
    return doc_freq;
}
u32_t
PolyLexReader_doc_freq(PolyLexiconReader *self, const CharBuf *field,
                       Obj *term)
{
    u32_t doc_freq = 0;
    u32_t i, max;
    for (i = 0, max = VA_Get_Size(self->readers); i < max; i++) {
        LexiconReader *reader = (LexiconReader*)VA_Fetch(self->readers, i);
        if (reader) {
            doc_freq += LexReader_Doc_Freq(reader, field, term);
        }
    }
    return doc_freq;
}