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

Class HalfCategory

source code

object --+
         |
        HalfCategory

One half of an atomic category, or the argument or result of a complex category. Stores a root value and a chord function marker (which may be a set of functions in the case of an argument half category).

Instance Methods [hide private]
 
__init__(self, root_symbol=None, function='T', root_number=None)
Either root_symbol or root_number must be given.
source code
 
__str__(self)
str(x)
source code
 
__eq__(self, other) source code
 
__ne__(self, other) source code
 
__hash__(self)
hash(x)
source code
 
set_relative_to(self, root)
Changes the root value to a new root that is the original root relative to the given root.
source code
 
copy(self) source code
 
to_latex(self) source code
 
matches(self, other)
Returns True if this half category, as the argument part of a complex category, would accept the other half category as the relevant part of its argument (in function application).
source code

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

Properties [hide private]
  function_symbol
Readable representation of the category's function or alternative functions.
  function
If the category has only one function (not a set of possible functions), returns this.
  symbol
Readable symbol of the category's root.
  ambiguous_function
True if the category has multiple possible functions

Inherited from object: __class__

Method Details [hide private]

__init__(self, root_symbol=None, function='T', root_number=None)
(Constructor)

source code 

Either root_symbol or root_number must be given.

Will raise a ChordError if the root symbol can't be interpreted as a root number.

Parameters:
  • root_symbol (string) - symbol to interpret as the root of this category. This will be converted to a root number.
  • function (string or list of strings) - either a single function marker (usually 'T', 'D' and 'S') or a list of such function markers, as in the case of a complex category's argument.
  • root_number (int) - alternative to setting the root by a symbol. This will be used in preferance to root_symbol if given.
Overrides: object.__init__

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

__hash__(self)
(Hashing function)

source code 

hash(x)

Overrides: object.__hash__
(inherited documentation)

Property Details [hide private]

function_symbol

Readable representation of the category's function or alternative functions.

Get Method:
unreachable.function_symbol(self) - Readable representation of the category's function or alternative functions.

function

If the category has only one function (not a set of possible functions), returns this. Otherwise returns None.

Get Method:
unreachable.function(self) - If the category has only one function (not a set of possible functions), returns this.

symbol

Readable symbol of the category's root.

Get Method:
unreachable.symbol(self) - Readable symbol of the category's root.

ambiguous_function

True if the category has multiple possible functions

Get Method:
unreachable.ambiguous_function(self) - True if the category has multiple possible functions