Package jazzparser :: Package formalisms :: Package base :: Module syntax :: Class SignBase
[hide private]
[frames] | no frames]

Class SignBase

source code

object --+
         |
        SignBase
Known Subclasses:

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.

Instance Methods [hide private]
 
__init__(self, formalism, category, semantics, derivation_trace=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__hash__(self)
hash(x)
source code
 
copy(self) source code
 
__str__(self)
str(x)
source code
 
__eq__(self, other) source code
 
__ne__(self, other) source code
 
__repr__(self)
repr(x)
source code
 
to_latex(self)
Returns: a Latex source representation of the object.
source code
 
format_result(self)
Format the sign as a string for display in a list of results.
source code
 
format_latex_result(self)
Same as format_result, but returns latex source.
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
 
set_time(self, time)
Must be implemented by subclasses.
source code
 
set_duration(self, duration)
Must be implemented by subclasses.
source code
 
check_rule_applied(self, rule, other_input=None)
Returns True if the given rule instance has been applied to this sign previously in the parse.
source code
 
note_rule_applied(self, rule, other_input=None)
Keeps a note that the given rule was applied to this sign.
source code

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, formalism, category, semantics, derivation_trace=None)
(Constructor)

source code 

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

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

__hash__(self)
(Hashing function)

source code 

hash(x)

Overrides: object.__hash__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

to_latex(self)

source code 
Returns:
a Latex source representation of the object.

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).

format_latex_result(self)

source code 

Same as format_result, but returns latex source. By default uses the class' to_latex method.

See Also: format_result

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).

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.

set_duration(self, duration)

source code 

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

check_rule_applied(self, rule, other_input=None)

source code 

Returns True if the given rule instance has been applied to this sign previously in the parse. If the rule is binary, other_input should be given and this sign is assumed to be the leftmore input.

note_rule_applied(self, rule, other_input=None)

source code 

Keeps a note that the given rule was applied to this sign. If it is a binary rule, you must also specify what the second input was.