blob: b11fbc258c523d60788287c7382780111e8e1bfe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# zhsh
An implementation of the Zhang-Shasha algorithm for calculating
tree edit distance.
Here trees are s-expressions with NON-NULL leaves.
I.e. Leaves are `(and leaf (atom leaf))`
## Examples:
ZHSH> (treedist '((the cat) (sat (on (the mat))))
'((the cat) (sat (on (the mat )))))
0
ZHSH> (treedist '((the cat) (sat (on (the mat))))
'((the cat) (sat (on (a mat )))))
11
ZHSH> (treedist '((the cat) (sat (on (the mat))))
'((the ordinary cats) (sit (on (a simple chair )))))
21
ZHSH> (treedist '((the cat) (sat (on (the mat)) (for (an hour))))
'((the ordinary cats) (sit (on (a simple chair)))))
26
|