Class DbInput
source code
object --+
|
InputReader --+
|
Input --+
|
DbInput
- Known Subclasses:
-
Wrapper for input from the database, rather than the command line. No
point in reducing db input to a string, then reinterpreting it.
If only one of times and durations is given,
the other will be computed from it. Computing times from
durations involves assuming that the first chord occurs at time 0.
Computing durations from times involves
assuming that the last chord has a length of 1.
At least one of times and durations must be
given.
We also store the id of the chord sequence that this came from
(id) and the sequence representation itself
(sequence). This may be None in some cases.
Confusingly (for historical reasons!), inputs contains
string chord labels. chords contains the db_mirrors
representation of the chords.
|
|
__init__(self,
inputs,
durations=None,
times=None,
id=None,
chords=None,
sequence=None,
*args,
**kwargs)
x.__init__(...) initializes x; see help(type(x)) for signature |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
slice(self,
start=None,
end=None)
Subclasses should provide a way of slicing (taking a subsequence of)
the input that returns an input of the original type. |
source code
|
|
|
Inherited from object:
__delattr__,
__format__,
__getattribute__,
__hash__,
__new__,
__reduce__,
__reduce_ex__,
__repr__,
__setattr__,
__sizeof__,
__subclasshook__
|
|
|
from_sequence(seq)
Creates a DbInput from a database representation of a sequence. |
source code
|
|
|
|
|
__init__(self,
inputs,
durations=None,
times=None,
id=None,
chords=None,
sequence=None,
*args,
**kwargs)
(Constructor)
| source code
|
x.__init__(...) initializes x; see help(type(x)) for signature
- Overrides:
object.__init__
- (inherited documentation)
|
|
Parses the annotations, if present, to get a gold analysis. Unlike AnnotatedDbInput, this input type cannot be assumed to
have annotations. It will therefore not raise an error if annotations are
missing or incomplete, but just return None.
- Overrides:
Input.get_gold_analysis
|
__str__(self)
(Informal representation operator)
| source code
|
str(x)
- Overrides:
object.__str__
- (inherited documentation)
|
|
Subclasses should provide a way of slicing (taking a subsequence of)
the input that returns an input of the original type.
- Overrides:
Input.slice
- (inherited documentation)
|
FILE_INPUT_OPTIONS
- Value:
[ModuleOption('index', filter= int, help_text= "read the sequence with
index (not id) X", usage= "index=X, where X is an int", required= Tru
e),]
|
|