Xerp::Index::BlocksBuilder
Constants
ELIGIBLE_KINDS = Set {Tokenize::TokenKind::Ident, Tokenize::TokenKind::Compound, Tokenize::TokenKind::Word}
Token kinds that count toward block size (eligible for salience normalization)
Class methods
Builds blocks from adapter result and stores them in the database. Returns an array of database block_ids corresponding to the adapter blocks.
Decodes a block_line_map blob back to block_ids per line.
update_token_counts(db : DB::Database, block_idx_by_line : Array(Int32), tokens_by_line : Array(Array(Tokenize::TokenOcc)), block_ids : Array(Int64)) : Nil
Computes and stores token counts per block. block_idx_by_line: maps line index (0-based) to block index tokens_by_line: from TokenizeResult, maps line index to token occurrences block_ids: database block_ids corresponding to block indices