Package jazzparser :: Package formalisms :: Package music_halfspan :: Package semantics :: Module distance :: Class LargestCommonEmbeddedSubtrees
[hide private]
[frames] | no frames]

Class LargestCommonEmbeddedSubtrees

source code

                            object --+        
                                     |        
base.semantics.distance.DistanceMetric --+    
                                         |    
      base.semantics.distance.FScoreMetric --+
                                             |
                                            LargestCommonEmbeddedSubtrees

Tonal space distance metric computed as the size of the largest subtree that can be embedded in the dependency graphs of two logical forms. This is done separately for each alignment of cadences in the two logical forms and the global optimum is used.

Instance Methods [hide private]
 
_get_identifier(self)
A human-readable identifier for the metric represented by this instance.
source code
 
fscore_match(self, sem1, sem2)
The core computation of the distance metric.
source code
 
print_computation(self, sem1, sem2)
Produces a string showing a derivation of the distance metric that would be returned for the given inputs.
source code

Inherited from base.semantics.distance.FScoreMetric: distance, format_distance, total_distance

Inherited from base.semantics.distance.DistanceMetric: __init__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  OPTIONS = FScoreMetric.OPTIONS+ [ModuleOption('res_score', fil...
  name = 'lces'
Properties [hide private]
  identifier
A human-readable identifier for the metric represented by this instance.

Inherited from object: __class__

Method Details [hide private]

_get_identifier(self)

source code 

A human-readable identifier for the metric represented by this instance.

Overrides: base.semantics.distance.DistanceMetric._get_identifier
(inherited documentation)

fscore_match(self, sem1, sem2)

source code 

The core computation of the distance metric. Takes care of the tree comparison and cadence alignment and return the vital statistics.

Overrides: base.semantics.distance.FScoreMetric.fscore_match

print_computation(self, sem1, sem2)

source code 

Produces a string showing a derivation of the distance metric that would be returned for the given inputs. This is useful for debugging the metric.

Subclasses are not required to provide this, and there may not always be something sensible to show.

Overrides: base.semantics.distance.DistanceMetric.print_computation
(inherited documentation)

Class Variable Details [hide private]

OPTIONS

Value:
FScoreMetric.OPTIONS+ [ModuleOption('res_score', filter= int, usage= "\
res_score=R, where R is an integer", default= 2, help_text= "Score to \
give to matching resolutions. 1 " "is the score given to a matching no\
de in the " "dependency tree. The default (2) gives more " "weight to \
matching resolutions that tree nodes. " "Special value -1 assigns a we\
ight equal to the size " "of the common dependency tree + 1"),]

Property Details [hide private]

identifier

A human-readable identifier for the metric represented by this instance.

Get Method:
_get_identifier(self) - A human-readable identifier for the metric represented by this instance.