Package jazzparser :: Package data :: Package db_mirrors :: Module distance
[hide private]
[frames] | no frames]

Module distance

source code

Edit distance between chord sequences.


Author: Mark Granroth-Wilding <mark.granroth-wilding@ed.ac.uk>

Functions [hide private]
 
chord_sequence_match_score(seq1, seq2)
Computes the edit distance between two chord sequences to score the extent of the matching between the two sequences between 0 and 1.
source code
 
chord_sequence_alignment(seq1, seq2, transposition=0)
Performs the same alignment as chord_sequence_match_score, but returns the actual alignment of chords.
source code
Variables [hide private]
  __package__ = 'jazzparser.data.db_mirrors'
Function Details [hide private]

chord_sequence_match_score(seq1, seq2)

source code 

Computes the edit distance between two chord sequences to score the extent of the matching between the two sequences between 0 and 1.

Each sequence should be a list of jazzparser.data.db_mirrors.Chords. The metric is key-independent. The distance will be tried for every transposition of one of the sequences and the closest match will be used.

chord_sequence_alignment(seq1, seq2, transposition=0)

source code 

Performs the same alignment as chord_sequence_match_score, but returns the actual alignment of chords.

The alignment assumes that the first sequence is transposed by transposition.