import type { TextChunk } from '../types/index.js'; /** * Normalizes text for searching (lowercase, trim, normalize whitespace) */ export declare function normalizeText(text: string): string; /** * Tokenizes text into words */ export declare function tokenize(text: string): string[]; /** * Extracts a snippet of text around a query match * * @param content - The full text content * @param query - The search query * @param contextLength - Number of characters to include before and after match * @returns A snippet with the query highlighted in context */ export declare function extractSnippet(content: string, query: string, contextLength?: number): string; /** * Calculates Levenshtein distance between two strings (for fuzzy matching) */ export declare function levenshteinDistance(a: string, b: string): number; /** * Calculates fuzzy match score (0-100) based on Levenshtein distance * 100 = exact match, lower scores = more different */ export declare function fuzzyMatchScore(str1: string, str2: string): number; /** * Checks if text contains all words from query */ export declare function containsAllWords(text: string, query: string): boolean; /** * Counts how many query words appear in the text */ export declare function countMatchingWords(text: string, query: string): number; /** * Chunks text into smaller pieces with overlap * * @param text - The text to chunk * @param maxTokens - Maximum tokens per chunk (approximate, using word count) * @param overlapTokens - Number of tokens to overlap between chunks * @returns Array of text chunks with metadata */ export declare function chunkText(text: string, maxTokens?: number, overlapTokens?: number): TextChunk[]; /** * Strips markdown from text (basic implementation) * For more robust stripping, use remark-strip-markdown */ export declare function stripMarkdownBasic(text: string): string; /** * Truncates text to a maximum length, breaking at word boundaries */ export declare function truncateText(text: string, maxLength: number): string; /** * Creates a hash from a string (simple implementation for cache keys) */ export declare function hashString(str: string): string; /** * Calculates cosine similarity between two vectors */ export declare function cosineSimilarity(a: number[], b: number[]): number; //# sourceMappingURL=text-processing.d.ts.map