|
Compute best alignment using Levenshtein distance. Return a Viterbi
table, a paths table, and a list of pairs.
The two tables:
-
viterbi: a table in which each cell (i,j) contains the cheapest edit
cost, an int, for the alignment of source[:i+1] with target[:j+1].
-
paths: a table in which each cell (i,j) contains the (row,col) pair
for the predecessor cell in the cheapest edit path to (i,j).
Columns in the table cover target characters, Rows cover source
characters.
We also compute pairs, an alignment of characters in the
two strings that corresponds to executing the minimum distance edits that
produce target from source. This least cost
alignment is represented as a sequence of pairs p, such that
p[0] (from target) is aligned with p[1] (from
source).
|