/** * BM25 over the turn's own messages. * * The corpus is small — a few hundred documents at most — so the index * is rebuilt from term frequencies each pass rather than maintained * incrementally; the arithmetic is the cost of a few string splits. The * constants are the textbook ones (k1 = 1.2, b = 0.75). What matters * here is not ranking quality against a web corpus but that a message * mentioning the goal's identifiers outscores one that does not, and * that a term every message contains (the turn's own file name, say) * stops counting. */ export interface Bm25Document { readonly tf: ReadonlyMap; readonly length: number; } export interface Bm25Index { readonly documents: readonly Bm25Document[]; readonly documentFrequency: ReadonlyMap; readonly averageLength: number; } export declare function indexDocument(text: string): Bm25Document; export declare function buildIndex(documents: readonly Bm25Document[]): Bm25Index; /** BM25 score of one document for a query given as tokens. */ export declare function bm25Score(index: Bm25Index, doc: Bm25Document, queryTokens: readonly string[]): number; //# sourceMappingURL=bm25.d.ts.map