module

Xerp::Index::BlockSigBuilder

Builds block signatures for hierarchical context training. A signature is a weighted set of tokens summarizing each block's intent.

Constants

ALLOWED_KINDS = Set {"ident", "word", "compound"}

Allowed token kinds for signatures

COMPOUND_BOOST = 1.2
DEFAULT_MAX_TOKENS = 16

Signature configuration

HEADER_TOKEN_WEIGHT = 2.0

Class methods

build_all(db : DB::Database, max_tokens : Int32 = DEFAULT_MAX_TOKENS) : Int64

Builds signatures for all blocks in the database. Should be called after indexing is complete.

Source