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

Class ApplicationRule

source code

                object --+        
                         |        
           base.rules.Rule --+    
                             |    
base.rules.ApplicationRuleBase --+
                                 |
                                ApplicationRule

Instance Methods [hide private]
 
__init__(self, *args, **kwargs)
An application rule.
source code
 
apply_rule(self, cat_list, proc_sems=None, *args, **kwargs)
For halfspan, the definition of the application rule is very important.
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 

An application rule. May be forward or backward, depending on the direction given in XML element.

Overrides: object.__init__
(inherited documentation)

apply_rule(self, cat_list, proc_sems=None, *args, **kwargs)

source code 

For halfspan, the definition of the application rule is very important. It's not the standard CCG application. Crucially, it requires the argument part of the slash category to match the nearest end of the argument category.

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