Edit Distance Computation



The Java class LongestCommonSubsequence allows computing the edit distance between two sequences containing objects (that are compared by means of method equals). In addition to the edit distance, it provides the longest common subsequence, as well as the edit script to transform the first sequence into the second one.


The directory where the TAR archive is opened must be added to the environment variable CLASSPATH.

Execution requires the availability of a Java interpreter (version 1.2 or later).

Compilation requires the availability of a Java compiler (version 1.2 or later). Compilation is not required before usage, since a precompiled (platform independent) byte code is provided in the TAR archive. Compilation is necessary only if the source code is modified.


An example of usage is provided inside the method main of class LongestCommonSubsequence. It shows how to create the two sequences of objects to be compared, how to compare them (method computeLengthMatrix) and how to obtain the metrics of interest (edit distance, length of longest common subsequence, longest common subsequence, edit script, etc.). Here is the command to issue, to run the example:
 java LongestCommonSubsequence "aa" "bab" -v 


No external documentation is available.