pub fn compare_pair(
source_code_a: &str,
source_code_b: &str,
cross_language: bool,
threshold: f64,
) -> Option<CloneMatch>Expand description
Compare two source code snippets and return a CloneMatch if they are
similar enough, or None otherwise.
cross_language: structural-only path — immediately returns aStructuralOnlymatch with similarity 1.0.- Otherwise: raw Jaccard ≥ 0.95 →
Type1; normalized Jaccard ≥ threshold →Type2; below threshold →None. - The
sourceandtargetfields of the returned match are left empty; the caller is expected to fill them in.