compute_element_similarity

Function compute_element_similarity 

Source
pub fn compute_element_similarity<'mem, 'facet>(
    peek_a: Peek<'mem, 'facet>,
    peek_b: Peek<'mem, 'facet>,
    config: Option<&MatchingConfig>,
) -> SimilarityResult<'mem, 'facet>
Expand description

Compute structural similarity between two Peek values using tree diff.

This uses the cinereus GumTree algorithm to:

  1. Build trees from both Peek values
  2. Compute a matching between nodes (hash-based + Dice coefficient)
  3. Return a similarity score based on how many nodes matched

The similarity score is: matched_nodes / max(nodes_a, nodes_b)

§Arguments

  • peek_a - First value to compare
  • peek_b - Second value to compare
  • config - Optional matching configuration (uses defaults if None)

§Returns

A SimilarityResult containing the score and edit operations