Package jazzparser :: Package formalisms :: Package music_halfspan :: Module syntax :: Class Sign
[hide private]
[frames] | no frames]

Class Sign

source code

          object --+    
                   |    
base.syntax.SignBase --+
                       |
                      Sign

A CCG category and its associated semantics: a CCG sign.

Keeps a note of which rules have been applied and which other signs they were applied to, so that the parser can avoid re-applying the same rule to the same inputs again.

This overrides the base sign implementation with a few formalism-specific things.

Instance Methods [hide private]
 
__init__(self, *args, **kwargs)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
copy(self) source code
 
apply_lexical_features(self, features)
Given a dictionary of features, applies any changes to this sign that need to be made before it is added to the chart on the basis of surface-level features (e.g.
source code
 
__str__(self)
str(x)
source code
 
format_result(self)
Format the sign as a string for display in a list of results.
source code
 
set_time(self, time)
Must be implemented by subclasses.
source code
 
set_duration(self, duration)
Must be implemented by subclasses.
source code

Inherited from base.syntax.SignBase: __eq__, __hash__, __ne__, __repr__, check_rule_applied, format_latex_result, note_rule_applied, to_latex

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

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

Parameters:
  • formalism - the formalism of the subclass.
  • category - the top level node of the category instance.
  • semantics - the semantics part of the sign
  • derivation_trace - a derivation trace to store how the sign was derived (optional).
Overrides: object.__init__
(inherited documentation)

copy(self)

source code 
Overrides: base.syntax.SignBase.copy

apply_lexical_features(self, features)

source code 

Given a dictionary of features, applies any changes to this sign that need to be made before it is added to the chart on the basis of surface-level features (e.g. pitch, time).

Overrides: base.syntax.SignBase.apply_lexical_features
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

format_result(self)

source code 

Format the sign as a string for display in a list of results. By default, this just uses the class' str(), but subclasses may provide an alternative format if required (you may want signs to look different in results and in, e.g., chart representation).

Overrides: base.syntax.SignBase.format_result
(inherited documentation)

set_time(self, time)

source code 

Must be implemented by subclasses. Adds timing information to components such that the start time of the whole sign is encoded as the given time.

Overrides: base.syntax.SignBase.set_time
(inherited documentation)

set_duration(self, duration)

source code 

Must be implemented by subclasses. Adds duration information to all components that store durations.

Overrides: base.syntax.SignBase.set_duration
(inherited documentation)