import type { CodeSymbol, SearchResult } from "../types.js";
type FieldName = "name" | "signature" | "docstring" | "body" | "comments";
export interface BM25Index {
    /** Per-field inverted index: token -> Map<symbolId, termFrequency> */
    fields: Record<FieldName, Map<string, Map<string, number>>>;
    /** Per-field average document length (in tokens) */
    avgFieldLengths: Record<FieldName, number>;
    /** Total number of indexed documents */
    docCount: number;
    /** Symbol lookup by ID */
    symbols: Map<string, CodeSymbol>;
    /** Import centrality: file -> log-scaled importer count (for search ranking bonus) */
    centrality: Map<string, number>;
    /** Pre-computed per-document field lengths (avoids O(n*m) recomputation per search) */
    fieldLengths: Map<string, Record<FieldName, number>>;
}
/**
 * General-purpose tokenizer for signature, docstring, and body text.
 * Splits on non-alphanumeric chars, applies camelCase/snake_case splitting,
 * lowercases, and filters tokens shorter than 2 chars.
 */
export declare function tokenizeText(text: string): string[];
export declare function buildBM25Index(symbols: CodeSymbol[]): BM25Index;
export declare function searchBM25(index: BM25Index, query: string, topK: number, fieldWeights: Record<FieldName, number>): SearchResult[];
export declare function applyCutoff(results: SearchResult[]): SearchResult[];
export {};
//# sourceMappingURL=bm25.d.ts.map