Package jazzparser :: Package formalisms :: Package music_halfspan :: Class Formalism
[hide private]
[frames] | no frames]

Class Formalism

source code

   object --+    
            |    
FormalismBase --+
                |
               Formalism

Nested Classes [hide private]
  PcfgModel
Pcfg model class appropriate for the formalism.
  Syntax
Formalisms should define override this nested class with their own, which will specify values for these attributes.
  Semantics
Formalisms should define override this nested class with their own, which will specify values for these attributes.
  PcfgParser
Formalism interface for the PcfgParser parser module.
  Evaluation
Functions for evaluating tonal space paths and parse results.

Inherited from FormalismBase: __metaclass__

Instance Methods [hide private]

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

Class Methods [hide private]

Inherited from FormalismBase: cl_output_options, get_name, process_output_options, sign_to_coordinates

Static Methods [hide private]
 
lexicon_builder(element)
Given the XML element of a CCG sign, builds the internal representation.
source code
 
distinguish_categories(x, y) source code
 
unify(category1, category2, grammar=None)
Dummy unification procedure.
source code
 
clean_results(x) source code
 
backoff_states_to_lf(states)
Builds a logical form given a list of states and the chords they were assigned to.
source code
 
semantics_to_coordinates(sems)
Function to generate a list of coordinates from a parse result (semantic part).
source code
 
semantics_to_functions(sems)
Generates a list of (function,time) tuples given a parse result.
source code
 
semantics_to_keys(sems)
Gets a list of keys implied by a logical form.
source code
Class Variables [hide private]
  rules = {'application': <class 'jazzparser.formalisms.music_ha...
  shell_tools = [TimeOutputTool(), songtools.LoadCorpusTool(), s...
  output_options = [ModuleOption('tsformat', choose_from_list(['...
ModuleOptions that can be used to set global settings that will affect the formatting of output.
  semantics_distance_metrics = [<class 'jazzparser.formalisms.mu...
List of distance metrics available in the formalism.

Inherited from FormalismBase: literal_functions

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

unify(category1, category2, grammar=None)
Static Method

source code 

Dummy unification procedure.

Unification succeeds if and only if the two categories are equal (using their own definition of equality). The unification constraints do nothing to the categories when applied.

backoff_states_to_lf(states)
Static Method

source code 

Builds a logical form given a list of states and the chords they were assigned to. Accepts a list of labels,time and return a logical form for the formalism (a Semantics in this case).

This uses the special logical form classes CoordinateList and PathCoordinate.

semantics_to_coordinates(sems)
Static Method

source code 

Function to generate a list of coordinates from a parse result (semantic part).

Raises:
  • ValueError - if the result can't produce a list of coordinates.
Overrides: semantics_to_coordinates

semantics_to_functions(sems)
Static Method

source code 

Generates a list of (function,time) tuples given a parse result.

Raises:
  • ValueError - if the result can't produce a list of coordinates.

Class Variable Details [hide private]

rules

Value:
{'application': <class 'jazzparser.formalisms.music_halfspan.rules.App\
licationRule'>,
 'cadencerepetition': <class 'jazzparser.formalisms.music_halfspan.rul\
es.CadenceRepetitionRule'>,
 'composition': <class 'jazzparser.formalisms.music_halfspan.rules.Com\
positionRule'>,
 'coordination': <class 'jazzparser.formalisms.music_halfspan.rules.Co\
ordinationRule'>,
...

shell_tools

Value:
[TimeOutputTool(), songtools.LoadCorpusTool(), songtools.ListSongsTool\
(), songtools.PrintAnalysisTool(), songtools.ResultSongTSEditDistanceT\
ool(), songtools.ResultSongDependencyRecoveryTool(), songtools.Recogni\
seSongTool(), songtools.SongSelfSimilarityTool(), songtools.SongTreeTo\
ol(), songtools.SongDependencyGraphTool(),]

output_options

ModuleOptions that can be used to set global settings that will affect the formatting of output.

Don't use any required options. All options must be able to be initialized to a default.

The values of the options will be set to their default when the formalism class is first encountered. Call process_output_options to customize the options.

Although the options are globally available for simplicity of access, you should only ever access them from within formalism-specific code in practice.

Value:
[ModuleOption('tsformat', choose_from_list(['coord', 'xycoord', 'roman\
', 'alpha']), help_text= "Tonal space output format", default= "coord"\
, usage= "tsformat=X, where X is one of 'coord', 'xycoord', " "'alpha'\
 or 'roman'"),]

semantics_distance_metrics

List of distance metrics available in the formalism. Each item is a subclass of jazzparser.formalisms.base.semantics.distance.DistanceMetric.

Value:
[<class 'jazzparser.formalisms.music_halfspan.semantics.distance.Tonal\
SpaceEditDistance'>,
 <class 'jazzparser.formalisms.music_halfspan.semantics.distance.Large\
stCommonEmbeddedSubtrees'>,
 <class 'jazzparser.formalisms.music_halfspan.semantics.distance.Rando\
mDistance'>,
 <class 'jazzparser.formalisms.music_halfspan.semantics.distance.Depen\
dencyGraphSize'>,
...