Alter the costing of the various operations for GT_LevDist() ──────────────────────────────────────────────────────────────────────────────
Syntax
GT_LevCost(<aCosts>) --> aOldCosts
Arguments:
<aCosts> - An array of operation costs aCosts[1] == cost of insertion aCosts[2] == cost of deletion aCosts[3] == cost of substitution
Returns:
aOldCosts - The old set of operation costs
Description:
Alter the costing of the various operations for GT_LevDist()
For some applications of Levenshtein distances it is important to alter the cost of the various operations. For example if analysing DNA insertions and deletions should be more costly than substitutions. However if trying to write voice recognition software the reverse is true (sounds often vary in length)
REFERENCE Doctor Dobb's Journal #187, April 1992
IMPROVEMENTS The main improvements in this routine will be made by introducing a more complex operation costing.
ie. have three matrices that record the cost of adding or deleting a specific letter, and substituting a specified letter with another.
More improvements can be achieved but at the loss of the general purpose of the routine.
This is left as an exercise for the foolhardy or brave.