Package jazzparser :: Package formalisms :: Package music_halfspan :: Module rules :: Class TonicRepetitionRule
[hide private]
[frames] | no frames]

Class TonicRepetitionRule

source code

     object --+    
              |    
base.rules.Rule --+
                  |
                 TonicRepetitionRule

A special unary rule for expanding the lexicon to add tonic repetition categories, generated from the tonic categories already in the lexicon.

This doesn't get used during parsing, but only to generate the full lexicon when it's loaded up.

It will expand any tonic category: X[T] => X[T]/X[T] : \x.x

Instance Methods [hide private]
 
__init__(self, *args, **kwargs)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
apply_rule(self, cat_list, proc_sems=None)
*** This should be overridden by subclasses.
source code

Inherited from base.rules.Rule: __str__, apply_rule_semantics

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

Class Variables [hide private]

Inherited from base.rules.Rule: readable_rule

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, *args, **kwargs)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

apply_rule(self, cat_list, proc_sems=None)

source code 

*** This should be overridden by subclasses. *** Applies the rule to combine the categories in cat_list.

Note that the returned semantics should always be in beta-normal form.

Returns:
a list of the possible categories resulting from the application if the rule is valid for the given arguments, otherwise None.
Overrides: base.rules.Rule.apply_rule
(inherited documentation)