Package jazzparser :: Package backoff :: Package ngram :: Module hmmpath :: Class HmmPathBuilder
[hide private]
[frames] | no frames]

Class HmmPathBuilder

source code

          object --+        
                   |        
 base.BackoffBuilder --+    
                       |    
base.ModelBackoffBuilder --+
                           |
                          HmmPathBuilder

Builds a semantics using an ngram model. Can take input from chord sequences or a weighted lattice of chords.

Nested Classes [hide private]
  MODEL_CLASS
Model type that uses an ngram model to assign a tonal space path to a sequence.
Instance Methods [hide private]
 
__init__(self, input, options={}, grammar=None, *args, **kwargs)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
jazzparser.formalisms.base.semantics.lambdacalc.Semantics subclass instance
get_tonal_space_path(self, rank=0)
This is the main interface method.
source code

Inherited from base.BackoffBuilder: get_all_paths

Inherited from base.BackoffBuilder (private): _get_input_length, _get_name

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

Class Methods [hide private]

Inherited from base.BackoffBuilder: check_options

Static Methods [hide private]

Inherited from base.ModelBackoffBuilder: partition_model_name

Class Variables [hide private]
  BUILDER_OPTIONS = ModelBackoffBuilder.BUILDER_OPTIONS+ [Module...
  INPUT_TYPES = ['db', 'chords', 'labels']
Properties [hide private]
  num_paths

Inherited from base.BackoffBuilder: input_length, name

Inherited from object: __class__

Method Details [hide private]

__init__(self, input, options={}, grammar=None, *args, **kwargs)
(Constructor)

source code 

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

Overrides: object.__init__
(inherited documentation)

get_tonal_space_path(self, rank=0)

source code 

This is the main interface method.

Parameters:
  • rank - the rank of the path the get, where 0 is the highest ranked path
Returns: jazzparser.formalisms.base.semantics.lambdacalc.Semantics subclass instance
the rankth highest ranked path through the tonal space for this sequence. Returns None if there is no path with this rank.
Overrides: base.BackoffBuilder.get_tonal_space_path
(inherited documentation)

Class Variable Details [hide private]

BUILDER_OPTIONS

Value:
ModelBackoffBuilder.BUILDER_OPTIONS+ [ModuleOption('paths', filter= in\
t, help_text= "Number of paths to suggest.", usage= "paths=X, where X \
is an integer", default= 10),]

Property Details [hide private]

num_paths

Get Method:
unreachable.num_paths(self)