This library is an implementation of Zhang and Shasha's algorithm [Zhang89] for calculating tree edit distance.
- Implement Tree interface.
- Implement EditScore interface for the Tree.
- Make a new TreeEditDistance instance with the EditScore instance, and execute calc method.
Tree tree1 = makeMyTree1(); Tree tree2 = makeMyTree2(); EditScore score = new MyEditScore(); double dist = new TreeEditDistance(score).calc(tree1, tree2); System.out.println("distance: " + dist);
See test programs for more information.
This library is distributed under the new BSD license. See LICENSE file.
[Zhang89] | Kaizhong Zhang, Dennis Shashs. Simple fast algorithms for the editing distance between trees and related problems. SIAM Journal on Computing, vol. 18, issue 6, 1989. |