/** * Category Matching and Relationship Scoring * * Provides multi-category detection and relationship scoring for improved * recall in semantic matching. Instead of first-match-wins, this module * extracts ALL matching categories and scores relationships between them. * * Key improvements over single-category matching: * 1. Multi-category detection - finds all matching categories * 2. Relationship scoring - related categories get partial credit * 3. Best-match selection - finds highest-confidence category pair */ /** * Result of category extraction with confidence. */ export interface CategoryMatch { category: string; confidence: number; matchedKeywords: string[]; } /** * Category relationship groups. * Categories in the same group are related and should get partial credit. * * IMPORTANT (v1.3.0): Groups are now more conservative to prevent false positives. * - Authentication and Authorization are NOT grouped (they're different concerns) * - Injection types are more narrowly grouped * - Only truly similar vulnerabilities are grouped */ export declare const SECURITY_CATEGORY_GROUPS: Record; /** * Limitation category relationship groups. */ export declare const LIMITATION_CATEGORY_GROUPS: Record; /** * Extract ALL matching security categories from text with confidence scores. * Unlike single-category extraction, this returns all matches ranked by confidence. */ export declare function extractSecurityCategories(text: string): CategoryMatch[]; /** * Extract ALL matching limitation categories from text with confidence scores. */ export declare function extractLimitationCategories(text: string): CategoryMatch[]; /** * Calculate relationship score between two security categories. * Returns 0-100 where: * - 100: Same category * - 70-90: Categories in same group * - 40-60: Related categories * - 0-30: Unrelated categories */ export declare function calculateSecurityCategoryRelationship(cat1: string, cat2: string): number; /** * Calculate relationship score between two limitation categories. */ export declare function calculateLimitationCategoryRelationship(cat1: string, cat2: string): number; /** * Find the best category match between two texts. * Returns the highest-scoring category pair and their relationship score. */ export declare function findBestSecurityCategoryMatch(categories1: CategoryMatch[], categories2: CategoryMatch[]): { cat1: string; cat2: string; relationshipScore: number; combinedConfidence: number; } | null; /** * Find the best limitation category match between two texts. */ export declare function findBestLimitationCategoryMatch(categories1: CategoryMatch[], categories2: CategoryMatch[]): { cat1: string; cat2: string; relationshipScore: number; combinedConfidence: number; } | null; /** * Check if two security categories are considered matching. * Uses relationship scoring for partial credit. */ export declare function securityCategoriesMatch(cat1: string, cat2: string): boolean; /** * Check if two limitation categories are considered matching. */ export declare function limitationCategoriesMatch(cat1: string, cat2: string): boolean; //# sourceMappingURL=category-matching.d.ts.map