Project Files
dist / sampler.d.ts
/**
* @file sampler.ts
* @description Main sampling logic. Routes to the correct strategy implementation
* based on the configured strategy type. Handles edge cases: empty text,
* invalid chunkSize, negative overlap.
*/
import type { SamplingConfig, SampleResult } from "./types";
/**
* Sample text using the configured strategy.
*
* Routing:
* - "length" → sampleByLength: fixed-size chunking, document order
* - "priority" → sampleByPriority: keyword-frequency + position scoring
* - "relevance" → sampleByRelevance: BM25-style query scoring
*
* Edge cases handled:
* - Empty text → returns empty chunks array
* - chunkSize < 1 → clamped to 1
* - Negative overlap → clamped to 0
* - maxChunks ≤ 0 → treated as unlimited
*
* @param text - The input text to sample.
* @param config - Sampling configuration including strategy selector.
* @returns A SampleResult with the sampled chunks and metadata.
*/
export declare function sample(text: string, config: SamplingConfig): SampleResult;
//# sourceMappingURL=sampler.d.ts.map