DocVector* PolyHLReader_fetch_doc_vec(PolyHighlightReader *self, int32_t doc_id) { uint32_t seg_tick = PolyReader_sub_tick(self->offsets, doc_id); int32_t offset = I32Arr_Get(self->offsets, seg_tick); HighlightReader *sub_reader = (HighlightReader*)VA_Fetch(self->readers, seg_tick); if (!sub_reader) { THROW(ERR, "Invalid doc_id: %i32", doc_id); } return HLReader_Fetch_Doc_Vec(sub_reader, doc_id - offset); }
DocVector* PolyHLReader_Fetch_Doc_Vec_IMP(PolyHighlightReader *self, int32_t doc_id) { PolyHighlightReaderIVARS *const ivars = PolyHLReader_IVARS(self); uint32_t seg_tick = PolyReader_sub_tick(ivars->offsets, doc_id); int32_t offset = I32Arr_Get(ivars->offsets, seg_tick); HighlightReader *sub_reader = (HighlightReader*)Vec_Fetch(ivars->readers, seg_tick); if (!sub_reader) { THROW(ERR, "Invalid doc_id: %i32", doc_id); } return HLReader_Fetch_Doc_Vec(sub_reader, doc_id - offset); }