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

Class PcfgParser

source code

object --+
         |
        Formalism.PcfgParser

Formalism interface for the PcfgParser parser module.

Instance Methods [hide private]

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

Static Methods [hide private]
 
category_representation(category, base_category=None)
Given a syntactic category, generates a representation that will be used by the model.
source code
 
category_relative_chord(chord, category=None)
Returns a version of the Chord object that's relative to the base pitch of the category.
source code
Class Variables [hide private]
  rule_short_names = {'appb': ('application', {'dir': 'backward'...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

category_representation(category, base_category=None)
Static Method

source code 

Given a syntactic category, generates a representation that will be used by the model. The result should be a string and must uniquely identify all of the features of the category that the model should distinguish.

If base_category is given, it may be used as a base to compare the category to. In this case, observations of generated categories always take their parent as a base category and syntactic pitches are all relative to it.

If base_category is not given, the category itself will be considered the base category.

category_relative_chord(chord, category=None)
Static Method

source code 

Returns a version of the Chord object that's relative to the base pitch of the category. If no category is given, the chord returned will be rooted at I (i.e. relative to itself).


Class Variable Details [hide private]

rule_short_names

Value:
{'appb': ('application', {'dir': 'backward'}),
 'appf': ('application', {'dir': 'forward'}),
 'compb': ('composition', {'dir': 'backward'}),
 'compf': ('composition', {'dir': 'forward'}),
 'cont': ('development', {}),
 'coord': ('coordination', {})}