/**
 * @file Content Similarity Scorer
 * Evaluates text similarity using various metrics (Jaccard, cosine, Levenshtein)
 */
import type { RuleScorerConfig, ScoreResult, ScorerInput } from "../../../types/scorerTypes.js";
import { BaseScorer } from "../baseScorer.js";
/**
 * Similarity metric types
 */
export type SimilarityMetric = "jaccard" | "cosine" | "levenshtein" | "dice" | "overlap";
/**
 * Configuration specific to content similarity scoring
 */
export type ContentSimilarityConfig = RuleScorerConfig & {
    /** Similarity metric to use */
    metric?: SimilarityMetric;
    /** Multiple metrics to combine */
    metrics?: SimilarityMetric[];
    /** How to combine multiple metrics */
    metricCombination?: "average" | "min" | "max" | "weighted";
    /** Weights for each metric (if weighted combination) */
    metricWeights?: Record<SimilarityMetric, number>;
    /** Whether to normalize text before comparison */
    normalizeText?: boolean;
    /** Whether to use word-level or character-level comparison */
    tokenLevel?: "word" | "character" | "ngram";
    /** N-gram size if using ngram tokenization */
    ngramSize?: number;
    /** Compare against ground truth, context, or custom reference */
    compareWith?: "groundTruth" | "context" | "custom";
    /** Custom reference text if compareWith is "custom" */
    referenceText?: string;
};
/**
 * ContentSimilarityScorer evaluates how similar the response is to a reference text
 */
export declare class ContentSimilarityScorer extends BaseScorer {
    private _similarityConfig;
    constructor(config?: ContentSimilarityConfig);
    /**
     * Get similarity-specific configuration
     */
    get similarityConfig(): ContentSimilarityConfig;
    /**
     * Get reference text based on configuration
     */
    private _getReferenceText;
    /**
     * Calculate similarity between two texts
     */
    private _calculateSimilarity;
    /**
     * Normalize text for comparison
     */
    private _normalizeText;
    /**
     * Tokenize text based on configuration
     */
    private _tokenize;
    /**
     * Calculate Jaccard similarity coefficient
     * J(A,B) = |A ∩ B| / |A ∪ B|
     */
    private _jaccardSimilarity;
    /**
     * Calculate cosine similarity using term frequency vectors
     */
    private _cosineSimilarity;
    /**
     * Get term frequency map
     */
    private _getTermFrequency;
    /**
     * Calculate normalized Levenshtein similarity
     * Returns 1 - (edit_distance / max_length)
     */
    private _levenshteinSimilarity;
    /**
     * Calculate Levenshtein edit distance using space-optimized two-row DP
     */
    private _levenshteinDistance;
    /**
     * Calculate Dice coefficient (Sorensen-Dice)
     * DSC(A,B) = 2|A ∩ B| / (|A| + |B|)
     */
    private _diceSimilarity;
    /**
     * Calculate overlap coefficient
     * O(A,B) = |A ∩ B| / min(|A|, |B|)
     */
    private _overlapCoefficient;
    /**
     * Override score to add detailed similarity metrics
     */
    score(input: ScorerInput): Promise<ScoreResult>;
    /**
     * Combine multiple metric scores
     */
    private _combineMetricScores;
    /**
     * Generate reasoning from similarity details
     */
    private _generateSimilarityReasoning;
}
/**
 * Factory function for creating ContentSimilarityScorer instances
 */
export declare function createContentSimilarityScorer(config?: ContentSimilarityConfig): Promise<ContentSimilarityScorer>;
