Project Files
dist / strategies / priority.d.ts
/**
* @file priority.ts
* @description Priority-based sampling strategy.
* Scores chunks by keyword frequency (auto-extracted from the text), position
* (earlier content slightly boosted), and chunk density. Returns chunks sorted
* by score descending.
*/
import type { Chunk, SamplingConfig } from "../types";
/**
* Score chunks by keyword frequency and position.
*
* Algorithm:
* 1. Extract top keywords from the full text (by frequency).
* 2. Split text into fixed-size chunks using the length-based strategy.
* 3. Score each chunk by keyword density (primary) and position (secondary boost).
* 4. Return chunks sorted by score descending (highest priority first).
*
* @param text - The input text to sample.
* @param config - Sampling configuration (chunkSize, overlap, maxChunks).
* @returns Chunks sorted by priority score descending.
*/
export declare function sampleByPriority(text: string, config: SamplingConfig): readonly Chunk[];
//# sourceMappingURL=priority.d.ts.map