Skip to main content

Matching

Trait Matching 

Source
pub trait Matching {
    // Required methods
    fn build_matching(&mut self, base: &NodeRef, branch: &NodeRef);
    fn get_area_stop_nodes(&self, stop_nodes: &mut Vec<NodeRef>, node: &NodeRef);
    fn base_root(&self) -> Option<&NodeRef>;
    fn branch_root(&self) -> Option<&NodeRef>;
}
Expand description

Trait for tree matching algorithms.

A Matching builds correspondences between a base tree and a branch tree. The actual matchings are stored in the nodes themselves (BaseNode’s left/right MatchedNodes and BranchNode’s base_match field).

Required Methods§

Source

fn build_matching(&mut self, base: &NodeRef, branch: &NodeRef)

Builds a matching between a base tree and a branch tree.

After this method returns, the nodes in both trees will have their matching fields populated.

Source

fn get_area_stop_nodes(&self, stop_nodes: &mut Vec<NodeRef>, node: &NodeRef)

Gets the children of leaf nodes in a matching subtree.

Uses the MatchArea tag of nodes to identify the subtree boundaries.

Source

fn base_root(&self) -> Option<&NodeRef>

Returns a reference to the base tree root.

Source

fn branch_root(&self) -> Option<&NodeRef>

Returns a reference to the branch tree root.

Implementors§