/** * Text Similarity Utilities * * Provides Jaccard similarity and related text comparison functions * for memory enrichment and contradiction detection. * * Phase 3 Organic Brain Feature */ /** * Tokenize text into a set of normalized words * Removes punctuation, lowercases, and filters short words */ export declare function tokenize(text: string): Set; /** * Calculate Jaccard similarity between two texts * Returns a value between 0 (completely different) and 1 (identical) * * Jaccard Index = |A ∩ B| / |A ∪ B| * * @param textA - First text to compare * @param textB - Second text to compare * @returns Similarity score between 0 and 1 */ export declare function jaccardSimilarity(textA: string, textB: string): number; /** * Extract key phrases/concepts from text * Used for topic comparison in contradiction detection * * Extracts: * - Quoted phrases ("like this") * - Backticked code/terms (`like_this`) * - Capitalized terms (LikeThis) * * @param text - Text to extract key phrases from * @returns Array of unique key phrases (lowercased) */ export declare function extractKeyPhrases(text: string): string[]; /** * Calculate word overlap between two texts * Returns the count of shared words * * @param textA - First text * @param textB - Second text * @returns Number of shared words */ export declare function wordOverlap(textA: string, textB: string): number; /** * Check if two texts share significant content * Quick check before running full similarity calculation * * @param textA - First text * @param textB - Second text * @param minOverlap - Minimum word overlap required * @returns True if texts share at least minOverlap words */ export declare function hasSignificantOverlap(textA: string, textB: string, minOverlap?: number): boolean; //# sourceMappingURL=similarity.d.ts.map