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

Class CompositionRule

source code

                object --+        
                         |        
           base.rules.Rule --+    
                             |    
base.rules.CompositionRuleBase --+
                                 |
                                CompositionRule

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, *args, **kwargs)
Unlike application, composition could use the standard CCG definition, but here we redefine it.
source code
 
apply_rule_semantics(self, cat_list, *args, **kwargs)
Provides the semantic part of rule application separately from the syntactic part.
source code

Inherited from base.rules.Rule: __str__

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, *args, **kwargs)

source code 

Unlike application, composition could use the standard CCG definition, but here we redefine it. This allows us to handle multiple functions on arguments not by using unification, but just by calling matches.

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

apply_rule_semantics(self, cat_list, *args, **kwargs)

source code 

Provides the semantic part of rule application separately from the syntactic part.

Returns:
list of the Semantics objects that would be the logical form parts of the results of the rule application.
Decorators:
  • @temporal_rule_apply(semantics_only= True)
Overrides: base.rules.Rule.apply_rule_semantics