Evaluates the structural similarity of code or XML by calculating the minimum number of edits required to transform one text’s abstract syntax tree into another’s.
output
(str): The generated structured text (e.g., code, XML).expectedOutput
(str): The reference structured text.Result
(float): A normalized distance score between 0 and 1.0
: The tree structures are identical.1
: The tree structures are completely different.Captures syntactic and structural similarity, often more important than lexical similarity for code or structured data.