Package nzilbb.editpath

Implementation of Wagner-Fischer algorithm to determine the minimum edit path.

These classes provide suport for computing the minimum edit path between two lists of objects of any class, and providing access to the mapping from one list to the other, and minimum edit distance.

e.g. The edit path between two lists of Integers can be determined using:

 MinimumEditPath<Integer> mp = new MinimumEditPath<Integer>();
 List<EditStep<Integer>> path = mp.minimumEditPath(vFrom, vTo)
 for (EditStep<Integer> step: path) {
   System.out.println("from " + step.getFrom() + " to " + step.getTo() 
                      + " : " + step.getOperation() + " distance " + step.getStepDistance());
 }

The equality comparison can be customized, e.g.:

 MinimumEditPath<String> mp = new MinimumEditPath<String>(
   new DefaultEditComparator<String>(new EqualsComparator<String>() {
     public int compare(String o1, String o2) {
      return o1.toLowerCase().compareTo(o2.toLowerCase());
     }
    }));
Author:
Robert Fromont robert.fromont@canterbury.ac.nz