/** * Pure deduplication detection utilities. * * These functions operate on plain data (arrays, sets, strings) with no * infrastructure dependencies. They can be used by both the infrastructure * DeduplicationService and skill-level MemoryService. */ import type { IMemoryItem } from '../interfaces/types'; import type { IConflictGroup } from '../interfaces/dal/types'; import type { IDuplicateGroup, IDeduplicationOptions } from '../interfaces/IDeduplicationService'; /** * Normalize text for comparison: lowercase, trim, collapse whitespace. */ export declare function normalizeText(text: string): string; /** * Extract meaningful words from text, removing stop words. * Returns a set of lowercase words. */ export declare function extractWords(text: string): Set; /** * Compute Jaccard similarity between two word sets. * Returns |A ∩ B| / |A ∪ B|, or 0 if both sets are empty. */ export declare function jaccardSimilarity(a: Set, b: Set): number; /** * Detect duplicates from a pre-loaded array of facts. * * Three-pass algorithm: * 1. Exact match — identical normalized text * 2. Tag overlap — same type:* tag with shared words (via conflict groups) * 3. Similar content — Jaccard word-set similarity * * @param facts - Array of memory items to scan * @param conflictGroups - Pre-fetched conflict groups (for tag overlap pass) * @param options - Detection options */ export declare function detectDuplicatesFromFacts(facts: readonly IMemoryItem[], conflictGroups: readonly IConflictGroup[], options?: IDeduplicationOptions): IDuplicateGroup[]; //# sourceMappingURL=deduplication.d.ts.map