/** * Semantic Hasher - TF-IDF + Cosine Similarity * * Provides fast duplicate detection and semantic similarity scoring */ import type { Pattern } from '../types/pattern.js'; export declare class SemanticHasher { private vocabulary; private documentCount; /** * Compute semantic hash for exact duplicate detection */ computeSemanticHash(pattern: Pattern): string; /** * Compute TF-IDF embedding for similarity calculation */ computeEmbedding(pattern: Pattern): Map; /** * Calculate cosine similarity between two embeddings */ cosineSimilarity(emb1: Map, emb2: Map): number; /** * Update vocabulary with IDF values from a set of patterns */ updateVocabulary(patterns: Pattern[]): void; /** * Extract key terms for semantic hashing */ private extractKeyTerms; /** * Tokenize text into words */ private tokenize; } /** * Singleton instance for global use */ export declare const semanticHasher: SemanticHasher; //# sourceMappingURL=semantic-hasher.d.ts.map