Xerp::Vectors::Cooccurrence
Builds token co-occurrence counts from the indexed corpus.
Models: MODEL_LINE: Traditional linear - sliding window over whole file in text order MODEL_SCOPE: Scope-aware - level-based isolation (leaves swept alone, siblings co-occur)
SCOPE is recommended for code - respects logical structure without crossing scope boundaries. LINE is traditional word2vec-style co-occurrence (whole document, one pass).
Constants
Default training parameters
Model name to ID mapping (matches models table)
Model identifiers (name -> id mapping)
Similarity quantization scale (16-bit precision)
Class methods
Builds co-occurrence counts from all indexed files for a specific model. MODEL_LINE: sliding window co-occurrence (textual proximity) MODEL_SCOPE: level-based isolation (structural siblings)
Computes nearest neighbors from co-occurrence counts for a specific model. Uses in-memory sparse matrix multiplication with inverted index for efficiency.
Dequantizes 16-bit integer back to similarity (0.0-1.0)