| Trees | Indices | Help |
|
|---|
|
|
Tonal space path evaluation functions.
Author: Mark Granroth-Wilding <mark.granroth-wilding@ed.ac.uk>
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
__package__ =
|
|||
|
|||
Given a list of (coordinate,function) pairs, produces a similar list that represents the steps between each point in the path and its previous point, maintaining the original functions. The first point yields the step from the origin, ignoring its enharmonic block (in other words, the step from (0,0) within its enharmonic block). This means that effectively we don't care what enharmonic block the path lies in, only the relative points along the path. |
Computes the edit distance between the tonal space paths of two logical forms, using a suitable scoring. This uses a cost of 2 for deletions and insertions and scores 1 for a substitution that gets either the step or function right, but not both. The result is then divided by 2 (meaning that effectively all costs are 1 and a 0.5 cost is given to half-right substitutions). The alignment is not between the tonal space points themselves, but between the vectors between each pair of points (that is the points relative to the previous point). This means that a path won't be penalised if part of it is translated by a constant vector, except at the point where it goes wrong. |
Performs the same algorithm as tonal_space_distance and tonal_space_alignment_costs, but returns a list of the operations that produce the optimal alignment: "I" - insertion; "D" - deletion; "A" - alignment; "S" - full substitution; or anything else beginning with "S" to indicate a partial substitution. Returns the operation list and the two sequences that were compared. If distance=True, also includes the distance metric. Not included by default for backward compatibility. |
Assigns a score to the optimal alignment between the two logical forms. Think of this as essentially a count of alignments in the optimal alignment. In fact, a pair of points may be partly aligned, in which case they contribute something to this score between 0 and 1. |
Length of the tonal space path represented by the given logical form. This could be more efficient, but at the moment only gets used in places where it doesn't matter much, so I might as well keep it simple. |
Like tonal_space_alignment, but uses local alignment of seq2 within seq1. Also returns the distance metric (like tonal_space_local_distance. |
| Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Mon Nov 26 16:04:55 2012 | http://epydoc.sourceforge.net |