kaldi.util

Functions

levenshtein_alignment Computes the levenshtein alignment between two lists of integer labels.
levenshtein_edit_distance Computes the edit distance between two lists of integer labels.
levenshtein_edit_distance_conventional Computes the edit distance between two lists of integer labels.
levenshtein_edit_distance_str Computes the edit distance between two lists of string symbols.
levenshtein_edit_distance_str_conventional Computes the edit distance between two lists of string symbols.

Classes

ConstIntegerSet Constant integer set.
TaskSequencerConfig Task sequencer options.
class kaldi.util.ConstIntegerSet

Constant integer set.

This class provides an efficient way of testing whether an integer is in a set of integers. It can be initialized with a list or set, but cannot be mutated after that.

count(i:int) → int

Returns 1 if i is in the set, 0 otherwise.

empty() → bool

Checks if set is empty.

from_list(input:list<int>) → ConstIntegerSet

Creates a new ConstIntegerSet from a list of integers.

from_other(other:ConstIntegerSet) → ConstIntegerSet

Creates a new ConstIntegerSet from another.

from_set(input:set<int>) → ConstIntegerSet

Creates a new ConstIntegerSet from a set of integers.

init_with_list(input:list<int>)

Initializes with a list of integers.

init_with_set(input:set<int>)

Initializes with a set of integers.

read(is:istream, binary:bool)

Reads object from input stream.

size() → int

Returns the size of the set.

write(os:ostream, binary:bool)

Writes object to output stream.

class kaldi.util.TaskSequencerConfig

Task sequencer options.

num_threads

The number of active threads to run in parallel.

num_threads_total

Total number of threads, including those waiting on others.

Controls memory use. If <= 0, defaults to –num-threads plus 20. Otherwise, must be >= num-threads.

register(opts:OptionsItf)

Registers options with an object implementing the options interface.

Parameters:opts (OptionsItf) – An object implementing the options interface. Typically a command-line option parser.
kaldi.util.levenshtein_alignment(a:list<int>, b:list<int>, eps_label:int) -> (err:int, alignment:list<tuple<int, int>>)

Computes the levenshtein alignment between two lists of integer labels.

This version of the edit-distance computation outputs the alignment between the two inputs. This is a list of pairs of (a label, b label). The epsilon label must not occur in sequences a or b. Where one is aligned to no label in the other (insertion or deletion), epsilon will be the corresponding member of the pair.

Parameters:
  • a (List[int]) – First list of integer labels.
  • b (List[int]) – Second list of integer labels.
  • eps_label (int) – Epsilon label.
Returns:

Edit-distance and levenshtein alignment between the inputs.

Return type:

Tuple[int, List[Tuple[int, int]]]

kaldi.util.levenshtein_edit_distance(a:list<int>, b:list<int>) → int

Computes the edit distance between two lists of integer labels.

Parameters:
  • a (List[int]) – First list of integer labels.
  • b (List[int]) – Second list of integer labels.
Returns:

Edit-distance between the inputs.

Return type:

int

kaldi.util.levenshtein_edit_distance_conventional(a:list<int>, b:list<int>) -> (err:int, ins:int, del:int, sub:int)

Computes the edit distance between two lists of integer labels.

This version returns the number of insertions, deletions and substitutions in addition to the total number of edits, i.e. error.

Parameters:
  • a (List[int]) – First list of integer labels.
  • b (List[int]) – Second list of integer labels.
Returns:

In order: edit-distance, #insertions, #deletions, #substitutions.

Return type:

Tuple[int, int, int, int]

Note

Noise label, e.g. silence label, must be filtered out of the input sequences.

kaldi.util.levenshtein_edit_distance_str(a:list<str>, b:list<str>) → int

Computes the edit distance between two lists of string symbols.

Parameters:
  • a (List[str]) – First list of string symbols.
  • b (List[str]) – Second list of string symbols.
Returns:

Edit-distance between the inputs.

Return type:

int

kaldi.util.levenshtein_edit_distance_str_conventional(a:list<str>, b:list<str>) -> (err:int, ins:int, del:int, sub:int)

Computes the edit distance between two lists of string symbols.

This version returns the number of insertions, deletions and substitutions in addition to the total number of edits, i.e. error.

Parameters:
  • a (List[str]) – First list of string symbols.
  • b (List[str]) – Second list of string symbols.
Returns:

In order: edit-distance, #insertions, #deletions, #substitutions.

Return type:

Tuple[int, int, int, int]

Note

Noise symbol, e.g. silence symbol, must be filtered out of the input sequences.

kaldi.util.io

For detailed documentation of Kaldi input/output streams and extended filenames, see Kaldi I/O mechanisms and Kaldi I/O from a command-line perspective.

Functions

classify_rxfilename Classifies extended filename into an InputType.
classify_wxfilename Classifies extended filename into an OutputType.
printable_rxfilename Turns the rxfilename into a more human-readable form.
printable_wxfilename Turns the wxfilename into a more human-readable form.
read_double_matrix Reads a double precision matrix from an extended filename.
read_double_vector Reads a double precision vector from an extended filename.
read_matrix Reads a single precision matrix from an extended filename.
read_vector Reads a single precision vector from an extended filename.
write_double_matrix Writes a double precision matrix to an extended filename.
write_double_vector Writes a double precision vector to an extended filename.
write_matrix Writes a single precision matrix to an extended filename.
write_vector Writes a single precision vector to an extended filename.
xopen Opens an extended filename and returns the stream.

Classes

Input Input stream for reading from extended filenames.
InputType An enumeration.
Output Output stream for writing to extended filenames.
OutputType An enumeration.
class kaldi.util.io.Input(rxfilename=None, binary=True)[source]

Input stream for reading from extended filenames.

If rxfilename is provided, it is opened for reading.

If binary is True, the input stream is opened in binary mode. Otherwise, it is opened in text mode. If the stream is opened in binary mode and it has Kaldi binary mode header, self.binary attribute is set to True. Similar to how files are handled in Python, PyKaldi distinguishes between input streams opened in binary and text modes, even when the underlying operating system doesn’t. If the input stream is opened in binary mode, read and readline methods return contents as bytes objects without any decoding. In text mode, these methods return contents of the input stream as unicode strings, the bytes having been first decoded using the platform-dependent default encoding.

This class implements the iterator and context manager protocols.

Parameters:
  • rxfilename (str) – Extended filename to open for reading.
  • binary (bool) – Whether to open the stream in binary mode.
Variables:

binary (bool) – Whether the contents of the input stream are binary. This attribute is set to True if the stream is opened in binary mode and it has Kaldi binary mode header. Its value is valid only if the stream is still open.

close() → int

Closes the stream.

Returns:The exit code as an integer if the stream was a pipe, 0 otherwise.
is_open() → bool

Checks if the stream is open.

open(rxfilename, binary=True)[source]

Opens the stream for reading.

Parameters:
  • rxfilename (str) – Extended filename to open for reading.
  • binary (bool) – Whether to open the stream in binary mode.
read()[source]

Reads and returns the contents of the stream.

If stream was opened in binary mode, returns a bytes object. Otherwise, returns a unicode string.

readline()[source]

Reads and returns a line from the stream.

If stream was opened in binary mode, returns a bytes object. Otherwise, returns a unicode string. If the stream is at EOF, an empty object is returned.

readlines()[source]

Reads and returns the contents of the stream as a list of lines.

If stream was opened in binary mode, returns a list of bytes objects. Otherwise, returns a list of unicode strings.

stream() → istream

Returns a handle for the underlying C++ stream.

class kaldi.util.io.InputType

An enumeration.

FILE_INPUT = 1
NO_INPUT = 0
OFFSET_FILE_INPUT = 3
PIPE_INPUT = 4
STANDARD_INPUT = 2
class kaldi.util.io.Output(wxfilename=None, binary=True, write_header=True)[source]

Output stream for writing to extended filenames.

If wxfilename is provided, it is opened for writing.

If binary is True, the output stream is opened in binary mode. Otherwise it is opened in text mode. Similar to how files are handled in Python, PyKaldi distinguishes between output streams opened in binary and text modes, even when the underlying operating system doesn’t. If the output stream is opened in binary mode, write and writelines methods accept bytes objects. Otherwise, they accept unicode strings.

If write_header is True and the stream was opened in binary mode, then Kaldi binary mode header (\0 then B) is written to the beginning of the stream. This header is checked by PyKaldi input streams opened in binary mode to set the binary attribute.

This class implements the context manager protocol.

Parameters:
  • wxfilename (str) – Extended filename to open for writing.
  • binary (bool) – Whether to open the stream in binary mode.
  • write_header (bool) – Whether to write Kaldi binary mode header in binary mode.
close() → bool

Closes the stream.

Returns:True if the stream was closed successfully. False otherwise.
flush()[source]

Flushes the stream.

is_open() → bool

Checks if the stream is open.

open(wxfilename, binary, write_header)[source]

Opens the stream for writing.

Parameters:
  • wxfilename (str) – Extended filename to open for writing.
  • binary (bool) – Whether to open the stream in binary mode.
  • write_header (bool) – Whether to write Kaldi binary mode header in binary mode.
stream() → ostream

Returns a handle for the underlying C++ stream.

write(s)[source]

Writes s to the stream.

Returns the number of bytes/characters written.

writelines(lines)[source]

Writes a list of lines to the stream.

Line separators are not added, so it is usual for each of the lines provided to have a line separator at the end.

class kaldi.util.io.OutputType

An enumeration.

FILE_OUTPUT = 1
NO_OUTPUT = 0
PIPE_OUTPUT = 3
STANDARD_OUTPUT = 2
kaldi.util.io.classify_rxfilename(rxfilename:str) → InputType

Classifies extended filename into an InputType.

kaldi.util.io.classify_wxfilename(wxfilename:str) → OutputType

Classifies extended filename into an OutputType.

kaldi.util.io.printable_rxfilename(rxfilename:str) → str

Turns the rxfilename into a more human-readable form.

This is useful for error reporting, i.e. it does quoting and escaping and replaces ‘’ or ‘-‘ with ‘standard input’.

kaldi.util.io.printable_wxfilename(wxfilename:str) → str

Turns the wxfilename into a more human-readable form.

This is useful for error reporting, i.e. it does quoting and escaping and replaces ‘’ or ‘-‘ with ‘standard input’.

kaldi.util.io.read_double_matrix(filename:str) → DoubleMatrix

Reads a double precision matrix from an extended filename.

kaldi.util.io.read_double_vector(filename:str) → DoubleVector

Reads a double precision vector from an extended filename.

kaldi.util.io.read_matrix(filename:str) → Matrix

Reads a single precision matrix from an extended filename.

kaldi.util.io.read_vector(filename:str) → Vector

Reads a single precision vector from an extended filename.

kaldi.util.io.write_double_matrix(c:DoubleMatrix, filename:str, binary:bool)

Writes a double precision matrix to an extended filename.

kaldi.util.io.write_double_vector(c:DoubleVector, filename:str, binary:bool)

Writes a double precision vector to an extended filename.

kaldi.util.io.write_matrix(c:Matrix, filename:str, binary:bool)

Writes a single precision matrix to an extended filename.

kaldi.util.io.write_vector(c:Vector, filename:str, binary:bool)

Writes a single precision vector to an extended filename.

kaldi.util.io.xopen(xfilename, mode='r', write_header=True)[source]

Opens an extended filename and returns the stream.

The mode defaults to “r” which means open for reading in binary mode. The available modes are:

Character Meaning
‘r’ open for reading (default)
‘w’ open for writing
‘b’ binary mode (default)
‘t’ text mode

xopen() returns a stream object whose type depends on the mode, and through which the standard I/O operations such as reading and writing are performed. When xopen() is used to open a stream for reading (‘r’, ‘rb’, ‘rt’), it returns an Input. When used to open a stream for writing (‘w’, ‘wb’, ‘wt’), it return an Output.

Similar to how files are handled in Python, PyKaldi distinguishes between streams opened in binary and text modes, even when the underlying operating system doesn’t. If the stream is opened in binary mode, its I/O methods accept and return bytes objects. Otherwise, they accept and return unicode strings.

Parameters:
  • xfilename (str) – Extended filename to open.
  • mode (str) – Optional string specifying the mode stream is opened.
  • write_header (str) – Whether streams opened for writing in binary mode write Kaldi binary mode header (\0 then B) to the beginning of the stream. This header is checked by streams opened for reading in binary mode to set binary attribute.

kaldi.util.options

Classes

ParseOptions Command line option parser.
class kaldi.util.options.ParseOptions[source]

Command line option parser.

Parameters:usage (str) – Usage string.
disable_option(name:str)

Disables an option.

If called after registering an option and before calling parse_args, disables that option from being used.

Parameters:name (str) – Option name.
Raises:RuntimeError – If given option had not been registered.
escape(str:str) → str

Returns a quoted and escaped version of given string.

get_arg(param:int) → str

Returns a required positional argument.

Parameters:param (int) – 1-based index position for the argument.
Raises:RuntimeError – If param < 1 or param > self.numargs().
get_opt_arg(param:int) → str

Returns an optional positional argument.

Parameters:param (int) – 1-based index position for the argument.
Returns:The argument at the given position if param <= self.num_args(), empty string otherwise.
num_args() → int

Returns the actual number of positional arguments.

parse_args(args=None)[source]

Parses arguments.

This method is used for parsing command line options. It fills the options objects registered with the parser. Parsed values for options that are directly registered with the parser, i.e. not via an options object, are returned as attributes of a Namespace object.

Parameters:args (list) – List of argument strings. If not provided, the argument strings are taken from sys.argv.
Returns:A new Namespace object populated with the parsed values for options that are directly registered with the parser.
print_config()

Prints the actual configuration of all registered options.

print_usage(print_command_line:bool=default)

Prints the usage string.

Parameters:print_command_line (bool) – Prints the command line.
read_config_file(filename:str)

Reads configuration from file.

Parameters:filename (str) – Config file location.
register_bool(name:str, value:bool, doc:str)

Registers a Boolean option.

Parameters:
  • name (str) – Option name.
  • value (bool) – Default value.
  • doc (str) – Option description.
register_double(name:str, value:float, doc:str)

Registers a double precision float option.

Parameters:
  • name (str) – Option name.
  • value (float) – Default value.
  • doc (str) – Option description.
register_float(name:str, value:float, doc:str)

Registers a single precision float option.

Parameters:
  • name (str) – Option name.
  • value (float) – Default value.
  • doc (str) – Option description.
register_int(name:str, value:int, doc:str)

Registers an integer option.

Parameters:
  • name (str) – Option name.
  • value (int) – Default value.
  • doc (str) – Option description.
register_str(name:str, value:str, doc:str)

Registers a string option.

Parameters:
  • name (str) – Option name.
  • value (str) – Default value.
  • doc (str) – Option description.
register_uint(name:str, value:int, doc:str)

Registers an unsigned integer option.

Parameters:
  • name (str) – Option name.
  • value (int) – Default value.
  • doc (str) – Option description.
with_prefix(prefix:str, other:OptionsItf) → ParseOptions

Creates a new child parser with the given prefix.

This is a constructor for the special case where some options are registered with a prefix to avoid conflicts. The object thus created will only be used temporarily to register an options class with the parent options parser (which is passed as other) using the given prefix. It should not be used for any other purpose, and the prefix must not be the empty string.

Parameters:
  • prefix (str) – Prefix for the child parser.
  • other (str) – Parent parser.

Example

To register and parse MFCC options with the prefix mfcc, e.g., --mfcc.frame-shift=10.0 instead of just --frame-shift=10.0:

po = ParseOptions()
po_mfcc = ParseOptions.with_prefix("mfcc", po)
mfcc_opts = MfccOptions()
mfcc_opts.register(po_mfcc)
opts = po.parse_args()

kaldi.util.table

For detailed documentation of Kaldi tables, table readers/writers, table read/write specifiers, see Kaldi I/O mechanisms and Kaldi I/O from a command-line perspective.

Functions

classify_rspecifier Decomposes the rspecifier string into its components.
classify_wspecifier Decomposes the wspecifier string into its components.
read_script_file Reads a script file into a list of string pairs.
write_script_file Writes a list of string pairs as a script file.

Classes

BoolWriter Table writer for Booleans.
CompactLatticeWriter Table writer for compact lattices.
DoubleMatrixWriter Table writer for double precision matrices.
DoubleVectorWriter Table writer for double precision vectors.
DoubleWriter Table writer for double precision floats.
FloatPairVectorWriter Table writer for sequences of single precision float pairs.
FloatWriter Table writer for single precision floats.
FstWriter Table writer for FSTs over the tropical semiring.
GaussPostWriter Table writer for Gaussian-level frame posteriors.
IntPairVectorWriter Table writer for sequences of integer pairs.
IntVectorVectorWriter Table writer for sequences of integer sequences.
IntVectorWriter Table writer for integer sequences.
IntWriter Table writer for integers.
KwsIndexFstWriter Table writer for FSTs over the KWS index semiring.
LatticeWriter Table writer for lattices.
LogFstWriter Table writer for FSTs over the log semiring.
MatrixWriter Table writer for single precision matrices.
NnetChainExampleWriter Table writer for nnet chain examples.
NnetExampleWriter Table writer for nnet examples.
PosteriorWriter Table writer for frame posteriors.
RandomAccessBoolReader Random access table reader for Booleans.
RandomAccessCompactLatticeReader Random access table reader for compact lattices.
RandomAccessDoubleMatrixReader Random access table reader for double precision matrices.
RandomAccessDoubleMatrixReaderMapped Mapped random access table reader for double precision matrices.
RandomAccessDoubleReader Random access table reader for double precision floats.
RandomAccessDoubleVectorReader Random access table reader for double precision vectors.
RandomAccessDoubleVectorReaderMapped Mapped random access table reader for double precision vectors.
RandomAccessFloatPairVectorReader Random access table reader for sequences of single precision float pairs.
RandomAccessFloatReader Random access table reader for single precision floats.
RandomAccessFloatReaderMapped Mapped random access table reader for single precision floats.
RandomAccessFstReader Random access table reader for FSTs over the tropical semiring.
RandomAccessGaussPostReader Random access table reader for Gaussian-level frame posteriors.
RandomAccessIntPairVectorReader Random access table reader for sequences of integer pairs.
RandomAccessIntReader Random access table reader for integers.
RandomAccessIntVectorReader Random access table reader for integer sequences.
RandomAccessIntVectorVectorReader Random access table reader for sequences of integer sequences.
RandomAccessKwsIndexFstReader Random access table reader for FSTs over the KWS index semiring.
RandomAccessLatticeReader Random access table reader for lattices.
RandomAccessLogFstReader Random access table reader for FSTs over the log semiring.
RandomAccessMatrixReader Random access table reader for single precision matrices.
RandomAccessMatrixReaderMapped Mapped random access table reader for single precision matrices.
RandomAccessNnetChainExampleReader Random access table reader for nnet chain examples.
RandomAccessNnetExampleReader Random access table reader for nnet examples.
RandomAccessPosteriorReader Random access table reader for frame posteriors.
RandomAccessVectorReader Random access table reader for single precision vectors.
RandomAccessVectorReaderMapped Mapped random access table reader for single precision vectors.
RandomAccessWaveInfoReader Random access table reader for wave file headers.
RandomAccessWaveReader Random access table reader for wave files.
RnnlmExampleWriter Table writer for RNNLM examples.
RspecifierOptions Read specifier options.
RspecifierType An enumeration.
SequentialBoolReader Sequential table reader for Booleans.
SequentialCompactLatticeReader Sequential table reader for compact lattices.
SequentialDoubleMatrixReader Sequential table reader for double precision matrices.
SequentialDoubleReader Sequential table reader for double precision floats.
SequentialDoubleVectorReader Sequential table reader for double precision vectors.
SequentialFloatPairVectorReader Sequential table reader for sequences of single precision float pairs.
SequentialFloatReader Sequential table reader for single precision floats.
SequentialFstReader Sequential table reader for FSTs over the tropical semiring.
SequentialGaussPostReader Sequential table reader for Gaussian-level frame posteriors.
SequentialIntPairVectorReader Sequential table reader for sequences of integer pairs.
SequentialIntReader Sequential table reader for integers.
SequentialIntVectorReader Sequential table reader for integer sequences.
SequentialIntVectorVectorReader Sequential table reader for sequences of integer sequences.
SequentialKwsIndexFstReader Sequential table reader for FSTs over the KWS index semiring.
SequentialLatticeReader Sequential table reader for lattices.
SequentialLogFstReader Sequential table reader for FSTs over the log semiring.
SequentialMatrixReader Sequential table reader for single precision matrices.
SequentialNnetChainExampleReader Sequential table reader for nnet chain examples.
SequentialNnetExampleReader Sequential table reader for nnet examples.
SequentialPosteriorReader Sequential table reader for frame posteriors.
SequentialRnnlmExampleReader Sequential table reader for RNNLM examples.
SequentialVectorReader Sequential table reader for single precision vectors.
SequentialWaveInfoReader Sequential table reader for wave file headers.
SequentialWaveReader Sequential table reader for wave files.
VectorWriter Table writer for single precision vectors.
WaveWriter Table writer for wave files.
WspecifierOptions Write specifier options.
WspecifierType An enumeration.
class kaldi.util.table.BoolWriter(wspecifier='')[source]

Table writer for Booleans.

This class is used for writing objects to an archive or script file. It implements the __setitem__ method to provide a dictionary-like interface for writing table entries, e.g. writer[key] = value writes the pair (key, value) to the table.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Raises:IOError – If opening the table for writing fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
flush()

Flushes the table contents to disk/pipe.

is_open()

Indicates whether the table writer is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table writer is open, False otherwise.
open(wspecifier)

Opens the table for writing.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for writing fails.
write(key, value)

Writes the (key, value) pair to the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:
  • key (str) – The key.
  • value – The value.
class kaldi.util.table.CompactLatticeWriter(wspecifier='')[source]

Table writer for compact lattices.

This class is used for writing objects to an archive or script file. It implements the __setitem__ method to provide a dictionary-like interface for writing table entries, e.g. writer[key] = value writes the pair (key, value) to the table.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Raises:IOError – If opening the table for writing fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
flush()

Flushes the table contents to disk/pipe.

is_open()

Indicates whether the table writer is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table writer is open, False otherwise.
open(wspecifier)

Opens the table for writing.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for writing fails.
write(key, value)

Writes the (key, value) pair to the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:
  • key (str) – The key.
  • value – The value.
class kaldi.util.table.DoubleMatrixWriter(wspecifier='')[source]

Table writer for double precision matrices.

This class is used for writing objects to an archive or script file. It implements the __setitem__ method to provide a dictionary-like interface for writing table entries, e.g. writer[key] = value writes the pair (key, value) to the table.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Raises:IOError – If opening the table for writing fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
flush()

Flushes the table contents to disk/pipe.

is_open()

Indicates whether the table writer is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table writer is open, False otherwise.
open(wspecifier)

Opens the table for writing.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for writing fails.
write(key, value)[source]

Writes the (key, value) pair to the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Overrides write to accept both DoubleMatrix and DoubleSubMatrix.

Parameters:
  • key (str) – The key.
  • value – The value.
class kaldi.util.table.DoubleVectorWriter(wspecifier='')[source]

Table writer for double precision vectors.

This class is used for writing objects to an archive or script file. It implements the __setitem__ method to provide a dictionary-like interface for writing table entries, e.g. writer[key] = value writes the pair (key, value) to the table.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Raises:IOError – If opening the table for writing fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
flush()

Flushes the table contents to disk/pipe.

is_open()

Indicates whether the table writer is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table writer is open, False otherwise.
open(wspecifier)

Opens the table for writing.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for writing fails.
write(key, value)[source]

Writes the (key, value) pair to the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Overrides write to accept both DoubleVector and DoubleSubVector.

Parameters:
  • key (str) – The key.
  • value – The value.
class kaldi.util.table.DoubleWriter(wspecifier='')[source]

Table writer for double precision floats.

This class is used for writing objects to an archive or script file. It implements the __setitem__ method to provide a dictionary-like interface for writing table entries, e.g. writer[key] = value writes the pair (key, value) to the table.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Raises:IOError – If opening the table for writing fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
flush()

Flushes the table contents to disk/pipe.

is_open()

Indicates whether the table writer is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table writer is open, False otherwise.
open(wspecifier)

Opens the table for writing.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for writing fails.
write(key, value)

Writes the (key, value) pair to the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:
  • key (str) – The key.
  • value – The value.
class kaldi.util.table.FloatPairVectorWriter(wspecifier='')[source]

Table writer for sequences of single precision float pairs.

This class is used for writing objects to an archive or script file. It implements the __setitem__ method to provide a dictionary-like interface for writing table entries, e.g. writer[key] = value writes the pair (key, value) to the table.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Raises:IOError – If opening the table for writing fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
flush()

Flushes the table contents to disk/pipe.

is_open()

Indicates whether the table writer is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table writer is open, False otherwise.
open(wspecifier)

Opens the table for writing.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for writing fails.
write(key, value)

Writes the (key, value) pair to the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:
  • key (str) – The key.
  • value – The value.
class kaldi.util.table.FloatWriter(wspecifier='')[source]

Table writer for single precision floats.

This class is used for writing objects to an archive or script file. It implements the __setitem__ method to provide a dictionary-like interface for writing table entries, e.g. writer[key] = value writes the pair (key, value) to the table.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Raises:IOError – If opening the table for writing fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
flush()

Flushes the table contents to disk/pipe.

is_open()

Indicates whether the table writer is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table writer is open, False otherwise.
open(wspecifier)

Opens the table for writing.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for writing fails.
write(key, value)

Writes the (key, value) pair to the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:
  • key (str) – The key.
  • value – The value.
class kaldi.util.table.FstWriter(wspecifier='')[source]

Table writer for FSTs over the tropical semiring.

This class is used for writing objects to an archive or script file. It implements the __setitem__ method to provide a dictionary-like interface for writing table entries, e.g. writer[key] = value writes the pair (key, value) to the table.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Raises:IOError – If opening the table for writing fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
flush()

Flushes the table contents to disk/pipe.

is_open()

Indicates whether the table writer is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table writer is open, False otherwise.
open(wspecifier)

Opens the table for writing.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for writing fails.
write(key, value)

Writes the (key, value) pair to the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:
  • key (str) – The key.
  • value – The value.
class kaldi.util.table.GaussPostWriter(wspecifier='')[source]

Table writer for Gaussian-level frame posteriors.

This class is used for writing objects to an archive or script file. It implements the __setitem__ method to provide a dictionary-like interface for writing table entries, e.g. writer[key] = value writes the pair (key, value) to the table.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Raises:IOError – If opening the table for writing fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
flush()

Flushes the table contents to disk/pipe.

is_open()

Indicates whether the table writer is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table writer is open, False otherwise.
open(wspecifier)

Opens the table for writing.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for writing fails.
write(key, value)

Writes the (key, value) pair to the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:
  • key (str) – The key.
  • value – The value.
class kaldi.util.table.IntPairVectorWriter(wspecifier='')[source]

Table writer for sequences of integer pairs.

This class is used for writing objects to an archive or script file. It implements the __setitem__ method to provide a dictionary-like interface for writing table entries, e.g. writer[key] = value writes the pair (key, value) to the table.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Raises:IOError – If opening the table for writing fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
flush()

Flushes the table contents to disk/pipe.

is_open()

Indicates whether the table writer is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table writer is open, False otherwise.
open(wspecifier)

Opens the table for writing.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for writing fails.
write(key, value)

Writes the (key, value) pair to the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:
  • key (str) – The key.
  • value – The value.
class kaldi.util.table.IntVectorVectorWriter(wspecifier='')[source]

Table writer for sequences of integer sequences.

This class is used for writing objects to an archive or script file. It implements the __setitem__ method to provide a dictionary-like interface for writing table entries, e.g. writer[key] = value writes the pair (key, value) to the table.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Raises:IOError – If opening the table for writing fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
flush()

Flushes the table contents to disk/pipe.

is_open()

Indicates whether the table writer is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table writer is open, False otherwise.
open(wspecifier)

Opens the table for writing.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for writing fails.
write(key, value)

Writes the (key, value) pair to the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:
  • key (str) – The key.
  • value – The value.
class kaldi.util.table.IntVectorWriter(wspecifier='')[source]

Table writer for integer sequences.

This class is used for writing objects to an archive or script file. It implements the __setitem__ method to provide a dictionary-like interface for writing table entries, e.g. writer[key] = value writes the pair (key, value) to the table.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Raises:IOError – If opening the table for writing fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
flush()

Flushes the table contents to disk/pipe.

is_open()

Indicates whether the table writer is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table writer is open, False otherwise.
open(wspecifier)

Opens the table for writing.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for writing fails.
write(key, value)

Writes the (key, value) pair to the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:
  • key (str) – The key.
  • value – The value.
class kaldi.util.table.IntWriter(wspecifier='')[source]

Table writer for integers.

This class is used for writing objects to an archive or script file. It implements the __setitem__ method to provide a dictionary-like interface for writing table entries, e.g. writer[key] = value writes the pair (key, value) to the table.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Raises:IOError – If opening the table for writing fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
flush()

Flushes the table contents to disk/pipe.

is_open()

Indicates whether the table writer is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table writer is open, False otherwise.
open(wspecifier)

Opens the table for writing.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for writing fails.
write(key, value)

Writes the (key, value) pair to the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:
  • key (str) – The key.
  • value – The value.
class kaldi.util.table.KwsIndexFstWriter(wspecifier='')[source]

Table writer for FSTs over the KWS index semiring.

This class is used for writing objects to an archive or script file. It implements the __setitem__ method to provide a dictionary-like interface for writing table entries, e.g. writer[key] = value writes the pair (key, value) to the table.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Raises:IOError – If opening the table for writing fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
flush()

Flushes the table contents to disk/pipe.

is_open()

Indicates whether the table writer is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table writer is open, False otherwise.
open(wspecifier)

Opens the table for writing.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for writing fails.
write(key, value)

Writes the (key, value) pair to the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:
  • key (str) – The key.
  • value – The value.
class kaldi.util.table.LatticeWriter(wspecifier='')[source]

Table writer for lattices.

This class is used for writing objects to an archive or script file. It implements the __setitem__ method to provide a dictionary-like interface for writing table entries, e.g. writer[key] = value writes the pair (key, value) to the table.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Raises:IOError – If opening the table for writing fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
flush()

Flushes the table contents to disk/pipe.

is_open()

Indicates whether the table writer is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table writer is open, False otherwise.
open(wspecifier)

Opens the table for writing.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for writing fails.
write(key, value)

Writes the (key, value) pair to the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:
  • key (str) – The key.
  • value – The value.
class kaldi.util.table.LogFstWriter(wspecifier='')[source]

Table writer for FSTs over the log semiring.

This class is used for writing objects to an archive or script file. It implements the __setitem__ method to provide a dictionary-like interface for writing table entries, e.g. writer[key] = value writes the pair (key, value) to the table.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Raises:IOError – If opening the table for writing fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
flush()

Flushes the table contents to disk/pipe.

is_open()

Indicates whether the table writer is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table writer is open, False otherwise.
open(wspecifier)

Opens the table for writing.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for writing fails.
write(key, value)

Writes the (key, value) pair to the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:
  • key (str) – The key.
  • value – The value.
class kaldi.util.table.MatrixWriter(wspecifier='')[source]

Table writer for single precision matrices.

This class is used for writing objects to an archive or script file. It implements the __setitem__ method to provide a dictionary-like interface for writing table entries, e.g. writer[key] = value writes the pair (key, value) to the table.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Raises:IOError – If opening the table for writing fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
flush()

Flushes the table contents to disk/pipe.

is_open()

Indicates whether the table writer is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table writer is open, False otherwise.
open(wspecifier)

Opens the table for writing.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for writing fails.
write(key, value)[source]

Writes the (key, value) pair to the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Overrides write to accept both Matrix and SubMatrix.

Parameters:
  • key (str) – The key.
  • value – The value.
class kaldi.util.table.NnetChainExampleWriter(wspecifier='')[source]

Table writer for nnet chain examples.

This class is used for writing objects to an archive or script file. It implements the __setitem__ method to provide a dictionary-like interface for writing table entries, e.g. writer[key] = value writes the pair (key, value) to the table.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Raises:IOError – If opening the table for writing fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
flush()

Flushes the table contents to disk/pipe.

is_open()

Indicates whether the table writer is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table writer is open, False otherwise.
open(wspecifier)

Opens the table for writing.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for writing fails.
write(key, value)

Writes the (key, value) pair to the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:
  • key (str) – The key.
  • value – The value.
class kaldi.util.table.NnetExampleWriter(wspecifier='')[source]

Table writer for nnet examples.

This class is used for writing objects to an archive or script file. It implements the __setitem__ method to provide a dictionary-like interface for writing table entries, e.g. writer[key] = value writes the pair (key, value) to the table.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Raises:IOError – If opening the table for writing fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
flush()

Flushes the table contents to disk/pipe.

is_open()

Indicates whether the table writer is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table writer is open, False otherwise.
open(wspecifier)

Opens the table for writing.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for writing fails.
write(key, value)

Writes the (key, value) pair to the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:
  • key (str) – The key.
  • value – The value.
class kaldi.util.table.PosteriorWriter(wspecifier='')[source]

Table writer for frame posteriors.

This class is used for writing objects to an archive or script file. It implements the __setitem__ method to provide a dictionary-like interface for writing table entries, e.g. writer[key] = value writes the pair (key, value) to the table.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Raises:IOError – If opening the table for writing fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
flush()

Flushes the table contents to disk/pipe.

is_open()

Indicates whether the table writer is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table writer is open, False otherwise.
open(wspecifier)

Opens the table for writing.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for writing fails.
write(key, value)

Writes the (key, value) pair to the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:
  • key (str) – The key.
  • value – The value.
class kaldi.util.table.RandomAccessBoolReader(rspecifier='')[source]

Random access table reader for Booleans.

This class is used for randomly accessing objects in an archive or script file. It implements __contains__ and __getitem__ methods to provide a dictionary-like interface for accessing table entries. e.g. reader[key] returns the value associated with the key.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
has_key(key)

Checks whether the table has the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:True if the table has the key, False otherwise.
is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value(key)

Returns the value associated with the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:The value associated with the key.
class kaldi.util.table.RandomAccessCompactLatticeReader(rspecifier='')[source]

Random access table reader for compact lattices.

This class is used for randomly accessing objects in an archive or script file. It implements __contains__ and __getitem__ methods to provide a dictionary-like interface for accessing table entries. e.g. reader[key] returns the value associated with the key.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
has_key(key)

Checks whether the table has the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:True if the table has the key, False otherwise.
is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value(key)

Returns the value associated with the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:The value associated with the key.
class kaldi.util.table.RandomAccessDoubleMatrixReader(rspecifier='')[source]

Random access table reader for double precision matrices.

This class is used for randomly accessing objects in an archive or script file. It implements __contains__ and __getitem__ methods to provide a dictionary-like interface for accessing table entries. e.g. reader[key] returns the value associated with the key.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
has_key(key)

Checks whether the table has the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:True if the table has the key, False otherwise.
is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value(key)

Returns the value associated with the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:The value associated with the key.
class kaldi.util.table.RandomAccessDoubleMatrixReaderMapped(table_rspecifier='', map_rspecifier='')[source]

Mapped random access table reader for double precision matrices.

This class is used for randomly accessing objects in an archive or script file. It implements __contains__ and __getitem__ methods to provide a dictionary-like interface for accessing table entries. If a map_rspecifier is provided, the map is used for converting the keys to the actual keys used to query the table, e.g. reader[key] returns the value associated with the key map[key]. Otherwise, it works like a random access table reader.

Parameters:
  • table_rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
  • map_rspecifier (str) – Kaldi rspecifier for reading the map. If provided, the map is opened for reading.
Raises:

IOError – If opening the table or map for reading fails.

close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
has_key(key)

Checks whether the table has the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:True if the table has the key, False otherwise.
is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
open(table_rspecifier, map_rspecifier)

Opens the table for reading.

Parameters:
  • table_rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
  • map_rspecifier (str) – Kaldi rspecifier for reading the map. If provided, the map is opened for reading.
Returns:

True if table is opened successfully, False otherwise.

Raises:

IOError – If opening the table or map for reading fails.

value(key)

Returns the value associated with the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:The value associated with the key.
class kaldi.util.table.RandomAccessDoubleReader(rspecifier='')[source]

Random access table reader for double precision floats.

This class is used for randomly accessing objects in an archive or script file. It implements __contains__ and __getitem__ methods to provide a dictionary-like interface for accessing table entries. e.g. reader[key] returns the value associated with the key.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
has_key(key)

Checks whether the table has the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:True if the table has the key, False otherwise.
is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value(key)

Returns the value associated with the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:The value associated with the key.
class kaldi.util.table.RandomAccessDoubleVectorReader(rspecifier='')[source]

Random access table reader for double precision vectors.

This class is used for randomly accessing objects in an archive or script file. It implements __contains__ and __getitem__ methods to provide a dictionary-like interface for accessing table entries. e.g. reader[key] returns the value associated with the key.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
has_key(key)

Checks whether the table has the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:True if the table has the key, False otherwise.
is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value(key)

Returns the value associated with the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:The value associated with the key.
class kaldi.util.table.RandomAccessDoubleVectorReaderMapped(table_rspecifier='', map_rspecifier='')[source]

Mapped random access table reader for double precision vectors.

This class is used for randomly accessing objects in an archive or script file. It implements __contains__ and __getitem__ methods to provide a dictionary-like interface for accessing table entries. If a map_rspecifier is provided, the map is used for converting the keys to the actual keys used to query the table, e.g. reader[key] returns the value associated with the key map[key]. Otherwise, it works like a random access table reader.

Parameters:
  • table_rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
  • map_rspecifier (str) – Kaldi rspecifier for reading the map. If provided, the map is opened for reading.
Raises:

IOError – If opening the table or map for reading fails.

close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
has_key(key)

Checks whether the table has the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:True if the table has the key, False otherwise.
is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
open(table_rspecifier, map_rspecifier)

Opens the table for reading.

Parameters:
  • table_rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
  • map_rspecifier (str) – Kaldi rspecifier for reading the map. If provided, the map is opened for reading.
Returns:

True if table is opened successfully, False otherwise.

Raises:

IOError – If opening the table or map for reading fails.

value(key)

Returns the value associated with the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:The value associated with the key.
class kaldi.util.table.RandomAccessFloatPairVectorReader(rspecifier='')[source]

Random access table reader for sequences of single precision float pairs.

This class is used for randomly accessing objects in an archive or script file. It implements __contains__ and __getitem__ methods to provide a dictionary-like interface for accessing table entries. e.g. reader[key] returns the value associated with the key.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
has_key(key)

Checks whether the table has the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:True if the table has the key, False otherwise.
is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value(key)

Returns the value associated with the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:The value associated with the key.
class kaldi.util.table.RandomAccessFloatReader(rspecifier='')[source]

Random access table reader for single precision floats.

This class is used for randomly accessing objects in an archive or script file. It implements __contains__ and __getitem__ methods to provide a dictionary-like interface for accessing table entries. e.g. reader[key] returns the value associated with the key.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
has_key(key)

Checks whether the table has the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:True if the table has the key, False otherwise.
is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value(key)

Returns the value associated with the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:The value associated with the key.
class kaldi.util.table.RandomAccessFloatReaderMapped(table_rspecifier='', map_rspecifier='')[source]

Mapped random access table reader for single precision floats.

This class is used for randomly accessing objects in an archive or script file. It implements __contains__ and __getitem__ methods to provide a dictionary-like interface for accessing table entries. If a map_rspecifier is provided, the map is used for converting the keys to the actual keys used to query the table, e.g. reader[key] returns the value associated with the key map[key]. Otherwise, it works like a random access table reader.

Parameters:
  • table_rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
  • map_rspecifier (str) – Kaldi rspecifier for reading the map. If provided, the map is opened for reading.
Raises:

IOError – If opening the table or map for reading fails.

close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
has_key(key)

Checks whether the table has the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:True if the table has the key, False otherwise.
is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
open(table_rspecifier, map_rspecifier)

Opens the table for reading.

Parameters:
  • table_rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
  • map_rspecifier (str) – Kaldi rspecifier for reading the map. If provided, the map is opened for reading.
Returns:

True if table is opened successfully, False otherwise.

Raises:

IOError – If opening the table or map for reading fails.

value(key)

Returns the value associated with the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:The value associated with the key.
class kaldi.util.table.RandomAccessFstReader(rspecifier='')[source]

Random access table reader for FSTs over the tropical semiring.

This class is used for randomly accessing objects in an archive or script file. It implements __contains__ and __getitem__ methods to provide a dictionary-like interface for accessing table entries. e.g. reader[key] returns the value associated with the key.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
has_key(key)

Checks whether the table has the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:True if the table has the key, False otherwise.
is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value(key)

Returns the value associated with the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:The value associated with the key.
class kaldi.util.table.RandomAccessGaussPostReader(rspecifier='')[source]

Random access table reader for Gaussian-level frame posteriors.

This class is used for randomly accessing objects in an archive or script file. It implements __contains__ and __getitem__ methods to provide a dictionary-like interface for accessing table entries. e.g. reader[key] returns the value associated with the key.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
has_key(key)

Checks whether the table has the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:True if the table has the key, False otherwise.
is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value(key)

Returns the value associated with the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:The value associated with the key.
class kaldi.util.table.RandomAccessIntPairVectorReader(rspecifier='')[source]

Random access table reader for sequences of integer pairs.

This class is used for randomly accessing objects in an archive or script file. It implements __contains__ and __getitem__ methods to provide a dictionary-like interface for accessing table entries. e.g. reader[key] returns the value associated with the key.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
has_key(key)

Checks whether the table has the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:True if the table has the key, False otherwise.
is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value(key)

Returns the value associated with the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:The value associated with the key.
class kaldi.util.table.RandomAccessIntReader(rspecifier='')[source]

Random access table reader for integers.

This class is used for randomly accessing objects in an archive or script file. It implements __contains__ and __getitem__ methods to provide a dictionary-like interface for accessing table entries. e.g. reader[key] returns the value associated with the key.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
has_key(key)

Checks whether the table has the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:True if the table has the key, False otherwise.
is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value(key)

Returns the value associated with the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:The value associated with the key.
class kaldi.util.table.RandomAccessIntVectorReader(rspecifier='')[source]

Random access table reader for integer sequences.

This class is used for randomly accessing objects in an archive or script file. It implements __contains__ and __getitem__ methods to provide a dictionary-like interface for accessing table entries. e.g. reader[key] returns the value associated with the key.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
has_key(key)

Checks whether the table has the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:True if the table has the key, False otherwise.
is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value(key)

Returns the value associated with the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:The value associated with the key.
class kaldi.util.table.RandomAccessIntVectorVectorReader(rspecifier='')[source]

Random access table reader for sequences of integer sequences.

This class is used for randomly accessing objects in an archive or script file. It implements __contains__ and __getitem__ methods to provide a dictionary-like interface for accessing table entries. e.g. reader[key] returns the value associated with the key.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
has_key(key)

Checks whether the table has the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:True if the table has the key, False otherwise.
is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value(key)

Returns the value associated with the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:The value associated with the key.
class kaldi.util.table.RandomAccessKwsIndexFstReader(rspecifier='')[source]

Random access table reader for FSTs over the KWS index semiring.

This class is used for randomly accessing objects in an archive or script file. It implements __contains__ and __getitem__ methods to provide a dictionary-like interface for accessing table entries. e.g. reader[key] returns the value associated with the key.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
has_key(key)

Checks whether the table has the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:True if the table has the key, False otherwise.
is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value(key)

Returns the value associated with the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:The value associated with the key.
class kaldi.util.table.RandomAccessLatticeReader(rspecifier='')[source]

Random access table reader for lattices.

This class is used for randomly accessing objects in an archive or script file. It implements __contains__ and __getitem__ methods to provide a dictionary-like interface for accessing table entries. e.g. reader[key] returns the value associated with the key.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
has_key(key)

Checks whether the table has the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:True if the table has the key, False otherwise.
is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value(key)

Returns the value associated with the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:The value associated with the key.
class kaldi.util.table.RandomAccessLogFstReader(rspecifier='')[source]

Random access table reader for FSTs over the log semiring.

This class is used for randomly accessing objects in an archive or script file. It implements __contains__ and __getitem__ methods to provide a dictionary-like interface for accessing table entries. e.g. reader[key] returns the value associated with the key.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
has_key(key)

Checks whether the table has the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:True if the table has the key, False otherwise.
is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value(key)

Returns the value associated with the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:The value associated with the key.
class kaldi.util.table.RandomAccessMatrixReader(rspecifier='')[source]

Random access table reader for single precision matrices.

This class is used for randomly accessing objects in an archive or script file. It implements __contains__ and __getitem__ methods to provide a dictionary-like interface for accessing table entries. e.g. reader[key] returns the value associated with the key.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
has_key(key)

Checks whether the table has the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:True if the table has the key, False otherwise.
is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value(key)

Returns the value associated with the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:The value associated with the key.
class kaldi.util.table.RandomAccessMatrixReaderMapped(table_rspecifier='', map_rspecifier='')[source]

Mapped random access table reader for single precision matrices.

This class is used for randomly accessing objects in an archive or script file. It implements __contains__ and __getitem__ methods to provide a dictionary-like interface for accessing table entries. If a map_rspecifier is provided, the map is used for converting the keys to the actual keys used to query the table, e.g. reader[key] returns the value associated with the key map[key]. Otherwise, it works like a random access table reader.

Parameters:
  • table_rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
  • map_rspecifier (str) – Kaldi rspecifier for reading the map. If provided, the map is opened for reading.
Raises:

IOError – If opening the table or map for reading fails.

close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
has_key(key)

Checks whether the table has the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:True if the table has the key, False otherwise.
is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
open(table_rspecifier, map_rspecifier)

Opens the table for reading.

Parameters:
  • table_rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
  • map_rspecifier (str) – Kaldi rspecifier for reading the map. If provided, the map is opened for reading.
Returns:

True if table is opened successfully, False otherwise.

Raises:

IOError – If opening the table or map for reading fails.

value(key)

Returns the value associated with the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:The value associated with the key.
class kaldi.util.table.RandomAccessNnetChainExampleReader(rspecifier='')[source]

Random access table reader for nnet chain examples.

This class is used for randomly accessing objects in an archive or script file. It implements __contains__ and __getitem__ methods to provide a dictionary-like interface for accessing table entries. e.g. reader[key] returns the value associated with the key.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
has_key(key)

Checks whether the table has the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:True if the table has the key, False otherwise.
is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value(key)

Returns the value associated with the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:The value associated with the key.
class kaldi.util.table.RandomAccessNnetExampleReader(rspecifier='')[source]

Random access table reader for nnet examples.

This class is used for randomly accessing objects in an archive or script file. It implements __contains__ and __getitem__ methods to provide a dictionary-like interface for accessing table entries. e.g. reader[key] returns the value associated with the key.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
has_key(key)

Checks whether the table has the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:True if the table has the key, False otherwise.
is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value(key)

Returns the value associated with the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:The value associated with the key.
class kaldi.util.table.RandomAccessPosteriorReader(rspecifier='')[source]

Random access table reader for frame posteriors.

This class is used for randomly accessing objects in an archive or script file. It implements __contains__ and __getitem__ methods to provide a dictionary-like interface for accessing table entries. e.g. reader[key] returns the value associated with the key.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
has_key(key)

Checks whether the table has the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:True if the table has the key, False otherwise.
is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value(key)

Returns the value associated with the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:The value associated with the key.
class kaldi.util.table.RandomAccessVectorReader(rspecifier='')[source]

Random access table reader for single precision vectors.

This class is used for randomly accessing objects in an archive or script file. It implements __contains__ and __getitem__ methods to provide a dictionary-like interface for accessing table entries. e.g. reader[key] returns the value associated with the key.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
has_key(key)

Checks whether the table has the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:True if the table has the key, False otherwise.
is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value(key)

Returns the value associated with the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:The value associated with the key.
class kaldi.util.table.RandomAccessVectorReaderMapped(table_rspecifier='', map_rspecifier='')[source]

Mapped random access table reader for single precision vectors.

This class is used for randomly accessing objects in an archive or script file. It implements __contains__ and __getitem__ methods to provide a dictionary-like interface for accessing table entries. If a map_rspecifier is provided, the map is used for converting the keys to the actual keys used to query the table, e.g. reader[key] returns the value associated with the key map[key]. Otherwise, it works like a random access table reader.

Parameters:
  • table_rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
  • map_rspecifier (str) – Kaldi rspecifier for reading the map. If provided, the map is opened for reading.
Raises:

IOError – If opening the table or map for reading fails.

close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
has_key(key)

Checks whether the table has the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:True if the table has the key, False otherwise.
is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
open(table_rspecifier, map_rspecifier)

Opens the table for reading.

Parameters:
  • table_rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
  • map_rspecifier (str) – Kaldi rspecifier for reading the map. If provided, the map is opened for reading.
Returns:

True if table is opened successfully, False otherwise.

Raises:

IOError – If opening the table or map for reading fails.

value(key)

Returns the value associated with the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:The value associated with the key.
class kaldi.util.table.RandomAccessWaveInfoReader(rspecifier='')[source]

Random access table reader for wave file headers.

This class is used for randomly accessing objects in an archive or script file. It implements __contains__ and __getitem__ methods to provide a dictionary-like interface for accessing table entries. e.g. reader[key] returns the value associated with the key.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
has_key(key)

Checks whether the table has the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:True if the table has the key, False otherwise.
is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value(key)

Returns the value associated with the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:The value associated with the key.
class kaldi.util.table.RandomAccessWaveReader(rspecifier='')[source]

Random access table reader for wave files.

This class is used for randomly accessing objects in an archive or script file. It implements __contains__ and __getitem__ methods to provide a dictionary-like interface for accessing table entries. e.g. reader[key] returns the value associated with the key.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
has_key(key)

Checks whether the table has the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:True if the table has the key, False otherwise.
is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value(key)

Returns the value associated with the key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:key (str) – The key.
Returns:The value associated with the key.
class kaldi.util.table.RnnlmExampleWriter(wspecifier='')[source]

Table writer for RNNLM examples.

This class is used for writing objects to an archive or script file. It implements the __setitem__ method to provide a dictionary-like interface for writing table entries, e.g. writer[key] = value writes the pair (key, value) to the table.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Raises:IOError – If opening the table for writing fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
flush()

Flushes the table contents to disk/pipe.

is_open()

Indicates whether the table writer is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table writer is open, False otherwise.
open(wspecifier)

Opens the table for writing.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for writing fails.
write(key, value)

Writes the (key, value) pair to the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:
  • key (str) – The key.
  • value – The value.
class kaldi.util.table.RspecifierOptions

Read specifier options.

background

Read ahead to the next object in a background thread.

called_sorted

Table keys/values will be accessed in sorted order. Implies once.

once

Each key in the table will be queried only once.

permissive

If a table cannot be read, act as if its keys were never there.

sorted

Table keys are in sorted order.

class kaldi.util.table.RspecifierType

An enumeration.

ARCHIVE_SPECIFIER = 1
NO_SPECIFIER = 0
SCRIPT_SPECIFIER = 2
class kaldi.util.table.SequentialBoolReader(rspecifier='')[source]

Sequential table reader for Booleans.

This class is used for reading objects sequentially from an archive or script file. It implements the iterator protocol similar to how Python implements iteration over dictionaries. Each iteration returns a (key, value) pair from the table in sequential order.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
done()

Indicates whether the table reader is exhausted or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is exhausted, False otherwise.
free_current()

Deallocates the current value.

This method is provided as an optimization to save memory, for large objects.

is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
key()

Returns the current key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current key.
Return type:str
next()

Advances the table reader.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value()

Returns the current value.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current value.
class kaldi.util.table.SequentialCompactLatticeReader(rspecifier='')[source]

Sequential table reader for compact lattices.

This class is used for reading objects sequentially from an archive or script file. It implements the iterator protocol similar to how Python implements iteration over dictionaries. Each iteration returns a (key, value) pair from the table in sequential order.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
done()

Indicates whether the table reader is exhausted or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is exhausted, False otherwise.
free_current()

Deallocates the current value.

This method is provided as an optimization to save memory, for large objects.

is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
key()

Returns the current key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current key.
Return type:str
next()

Advances the table reader.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value()

Returns the current value.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current value.
class kaldi.util.table.SequentialDoubleMatrixReader(rspecifier='')[source]

Sequential table reader for double precision matrices.

This class is used for reading objects sequentially from an archive or script file. It implements the iterator protocol similar to how Python implements iteration over dictionaries. Each iteration returns a (key, value) pair from the table in sequential order.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
done()

Indicates whether the table reader is exhausted or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is exhausted, False otherwise.
free_current()

Deallocates the current value.

This method is provided as an optimization to save memory, for large objects.

is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
key()

Returns the current key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current key.
Return type:str
next()

Advances the table reader.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value()

Returns the current value.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current value.
class kaldi.util.table.SequentialDoubleReader(rspecifier='')[source]

Sequential table reader for double precision floats.

This class is used for reading objects sequentially from an archive or script file. It implements the iterator protocol similar to how Python implements iteration over dictionaries. Each iteration returns a (key, value) pair from the table in sequential order.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
done()

Indicates whether the table reader is exhausted or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is exhausted, False otherwise.
free_current()

Deallocates the current value.

This method is provided as an optimization to save memory, for large objects.

is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
key()

Returns the current key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current key.
Return type:str
next()

Advances the table reader.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value()

Returns the current value.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current value.
class kaldi.util.table.SequentialDoubleVectorReader(rspecifier='')[source]

Sequential table reader for double precision vectors.

This class is used for reading objects sequentially from an archive or script file. It implements the iterator protocol similar to how Python implements iteration over dictionaries. Each iteration returns a (key, value) pair from the table in sequential order.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
done()

Indicates whether the table reader is exhausted or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is exhausted, False otherwise.
free_current()

Deallocates the current value.

This method is provided as an optimization to save memory, for large objects.

is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
key()

Returns the current key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current key.
Return type:str
next()

Advances the table reader.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value()

Returns the current value.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current value.
class kaldi.util.table.SequentialFloatPairVectorReader(rspecifier='')[source]

Sequential table reader for sequences of single precision float pairs.

This class is used for reading objects sequentially from an archive or script file. It implements the iterator protocol similar to how Python implements iteration over dictionaries. Each iteration returns a (key, value) pair from the table in sequential order.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
done()

Indicates whether the table reader is exhausted or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is exhausted, False otherwise.
free_current()

Deallocates the current value.

This method is provided as an optimization to save memory, for large objects.

is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
key()

Returns the current key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current key.
Return type:str
next()

Advances the table reader.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value()

Returns the current value.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current value.
class kaldi.util.table.SequentialFloatReader(rspecifier='')[source]

Sequential table reader for single precision floats.

This class is used for reading objects sequentially from an archive or script file. It implements the iterator protocol similar to how Python implements iteration over dictionaries. Each iteration returns a (key, value) pair from the table in sequential order.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
done()

Indicates whether the table reader is exhausted or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is exhausted, False otherwise.
free_current()

Deallocates the current value.

This method is provided as an optimization to save memory, for large objects.

is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
key()

Returns the current key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current key.
Return type:str
next()

Advances the table reader.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value()

Returns the current value.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current value.
class kaldi.util.table.SequentialFstReader(rspecifier='')[source]

Sequential table reader for FSTs over the tropical semiring.

This class is used for reading objects sequentially from an archive or script file. It implements the iterator protocol similar to how Python implements iteration over dictionaries. Each iteration returns a (key, value) pair from the table in sequential order.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
done()

Indicates whether the table reader is exhausted or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is exhausted, False otherwise.
free_current()

Deallocates the current value.

This method is provided as an optimization to save memory, for large objects.

is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
key()

Returns the current key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current key.
Return type:str
next()

Advances the table reader.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value()

Returns the current value.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current value.
class kaldi.util.table.SequentialGaussPostReader(rspecifier='')[source]

Sequential table reader for Gaussian-level frame posteriors.

This class is used for reading objects sequentially from an archive or script file. It implements the iterator protocol similar to how Python implements iteration over dictionaries. Each iteration returns a (key, value) pair from the table in sequential order.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
done()

Indicates whether the table reader is exhausted or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is exhausted, False otherwise.
free_current()

Deallocates the current value.

This method is provided as an optimization to save memory, for large objects.

is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
key()

Returns the current key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current key.
Return type:str
next()

Advances the table reader.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value()

Returns the current value.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current value.
class kaldi.util.table.SequentialIntPairVectorReader(rspecifier='')[source]

Sequential table reader for sequences of integer pairs.

This class is used for reading objects sequentially from an archive or script file. It implements the iterator protocol similar to how Python implements iteration over dictionaries. Each iteration returns a (key, value) pair from the table in sequential order.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
done()

Indicates whether the table reader is exhausted or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is exhausted, False otherwise.
free_current()

Deallocates the current value.

This method is provided as an optimization to save memory, for large objects.

is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
key()

Returns the current key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current key.
Return type:str
next()

Advances the table reader.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value()

Returns the current value.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current value.
class kaldi.util.table.SequentialIntReader(rspecifier='')[source]

Sequential table reader for integers.

This class is used for reading objects sequentially from an archive or script file. It implements the iterator protocol similar to how Python implements iteration over dictionaries. Each iteration returns a (key, value) pair from the table in sequential order.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
done()

Indicates whether the table reader is exhausted or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is exhausted, False otherwise.
free_current()

Deallocates the current value.

This method is provided as an optimization to save memory, for large objects.

is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
key()

Returns the current key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current key.
Return type:str
next()

Advances the table reader.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value()

Returns the current value.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current value.
class kaldi.util.table.SequentialIntVectorReader(rspecifier='')[source]

Sequential table reader for integer sequences.

This class is used for reading objects sequentially from an archive or script file. It implements the iterator protocol similar to how Python implements iteration over dictionaries. Each iteration returns a (key, value) pair from the table in sequential order.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
done()

Indicates whether the table reader is exhausted or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is exhausted, False otherwise.
free_current()

Deallocates the current value.

This method is provided as an optimization to save memory, for large objects.

is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
key()

Returns the current key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current key.
Return type:str
next()

Advances the table reader.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value()

Returns the current value.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current value.
class kaldi.util.table.SequentialIntVectorVectorReader(rspecifier='')[source]

Sequential table reader for sequences of integer sequences.

This class is used for reading objects sequentially from an archive or script file. It implements the iterator protocol similar to how Python implements iteration over dictionaries. Each iteration returns a (key, value) pair from the table in sequential order.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
done()

Indicates whether the table reader is exhausted or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is exhausted, False otherwise.
free_current()

Deallocates the current value.

This method is provided as an optimization to save memory, for large objects.

is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
key()

Returns the current key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current key.
Return type:str
next()

Advances the table reader.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value()

Returns the current value.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current value.
class kaldi.util.table.SequentialKwsIndexFstReader(rspecifier='')[source]

Sequential table reader for FSTs over the KWS index semiring.

This class is used for reading objects sequentially from an archive or script file. It implements the iterator protocol similar to how Python implements iteration over dictionaries. Each iteration returns a (key, value) pair from the table in sequential order.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
done()

Indicates whether the table reader is exhausted or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is exhausted, False otherwise.
free_current()

Deallocates the current value.

This method is provided as an optimization to save memory, for large objects.

is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
key()

Returns the current key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current key.
Return type:str
next()

Advances the table reader.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value()

Returns the current value.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current value.
class kaldi.util.table.SequentialLatticeReader(rspecifier='')[source]

Sequential table reader for lattices.

This class is used for reading objects sequentially from an archive or script file. It implements the iterator protocol similar to how Python implements iteration over dictionaries. Each iteration returns a (key, value) pair from the table in sequential order.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
done()

Indicates whether the table reader is exhausted or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is exhausted, False otherwise.
free_current()

Deallocates the current value.

This method is provided as an optimization to save memory, for large objects.

is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
key()

Returns the current key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current key.
Return type:str
next()

Advances the table reader.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value()

Returns the current value.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current value.
class kaldi.util.table.SequentialLogFstReader(rspecifier='')[source]

Sequential table reader for FSTs over the log semiring.

This class is used for reading objects sequentially from an archive or script file. It implements the iterator protocol similar to how Python implements iteration over dictionaries. Each iteration returns a (key, value) pair from the table in sequential order.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
done()

Indicates whether the table reader is exhausted or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is exhausted, False otherwise.
free_current()

Deallocates the current value.

This method is provided as an optimization to save memory, for large objects.

is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
key()

Returns the current key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current key.
Return type:str
next()

Advances the table reader.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value()

Returns the current value.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current value.
class kaldi.util.table.SequentialMatrixReader(rspecifier='')[source]

Sequential table reader for single precision matrices.

This class is used for reading objects sequentially from an archive or script file. It implements the iterator protocol similar to how Python implements iteration over dictionaries. Each iteration returns a (key, value) pair from the table in sequential order.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
done()

Indicates whether the table reader is exhausted or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is exhausted, False otherwise.
free_current()

Deallocates the current value.

This method is provided as an optimization to save memory, for large objects.

is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
key()

Returns the current key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current key.
Return type:str
next()

Advances the table reader.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value()

Returns the current value.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current value.
class kaldi.util.table.SequentialNnetChainExampleReader(rspecifier='')[source]

Sequential table reader for nnet chain examples.

This class is used for reading objects sequentially from an archive or script file. It implements the iterator protocol similar to how Python implements iteration over dictionaries. Each iteration returns a (key, value) pair from the table in sequential order.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
done()

Indicates whether the table reader is exhausted or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is exhausted, False otherwise.
free_current()

Deallocates the current value.

This method is provided as an optimization to save memory, for large objects.

is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
key()

Returns the current key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current key.
Return type:str
next()

Advances the table reader.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value()

Returns the current value.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current value.
class kaldi.util.table.SequentialNnetExampleReader(rspecifier='')[source]

Sequential table reader for nnet examples.

This class is used for reading objects sequentially from an archive or script file. It implements the iterator protocol similar to how Python implements iteration over dictionaries. Each iteration returns a (key, value) pair from the table in sequential order.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
done()

Indicates whether the table reader is exhausted or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is exhausted, False otherwise.
free_current()

Deallocates the current value.

This method is provided as an optimization to save memory, for large objects.

is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
key()

Returns the current key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current key.
Return type:str
next()

Advances the table reader.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value()

Returns the current value.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current value.
class kaldi.util.table.SequentialPosteriorReader(rspecifier='')[source]

Sequential table reader for frame posteriors.

This class is used for reading objects sequentially from an archive or script file. It implements the iterator protocol similar to how Python implements iteration over dictionaries. Each iteration returns a (key, value) pair from the table in sequential order.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
done()

Indicates whether the table reader is exhausted or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is exhausted, False otherwise.
free_current()

Deallocates the current value.

This method is provided as an optimization to save memory, for large objects.

is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
key()

Returns the current key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current key.
Return type:str
next()

Advances the table reader.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value()

Returns the current value.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current value.
class kaldi.util.table.SequentialRnnlmExampleReader(rspecifier='')[source]

Sequential table reader for RNNLM examples.

This class is used for reading objects sequentially from an archive or script file. It implements the iterator protocol similar to how Python implements iteration over dictionaries. Each iteration returns a (key, value) pair from the table in sequential order.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
done()

Indicates whether the table reader is exhausted or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is exhausted, False otherwise.
free_current()

Deallocates the current value.

This method is provided as an optimization to save memory, for large objects.

is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
key()

Returns the current key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current key.
Return type:str
next()

Advances the table reader.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value()

Returns the current value.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current value.
class kaldi.util.table.SequentialVectorReader(rspecifier='')[source]

Sequential table reader for single precision vectors.

This class is used for reading objects sequentially from an archive or script file. It implements the iterator protocol similar to how Python implements iteration over dictionaries. Each iteration returns a (key, value) pair from the table in sequential order.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
done()

Indicates whether the table reader is exhausted or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is exhausted, False otherwise.
free_current()

Deallocates the current value.

This method is provided as an optimization to save memory, for large objects.

is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
key()

Returns the current key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current key.
Return type:str
next()

Advances the table reader.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value()

Returns the current value.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current value.
class kaldi.util.table.SequentialWaveInfoReader(rspecifier='')[source]

Sequential table reader for wave file headers.

This class is used for reading objects sequentially from an archive or script file. It implements the iterator protocol similar to how Python implements iteration over dictionaries. Each iteration returns a (key, value) pair from the table in sequential order.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
done()

Indicates whether the table reader is exhausted or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is exhausted, False otherwise.
free_current()

Deallocates the current value.

This method is provided as an optimization to save memory, for large objects.

is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
key()

Returns the current key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current key.
Return type:str
next()

Advances the table reader.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value()

Returns the current value.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current value.
class kaldi.util.table.SequentialWaveReader(rspecifier='')[source]

Sequential table reader for wave files.

This class is used for reading objects sequentially from an archive or script file. It implements the iterator protocol similar to how Python implements iteration over dictionaries. Each iteration returns a (key, value) pair from the table in sequential order.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Raises:IOError – If opening the table for reading fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
done()

Indicates whether the table reader is exhausted or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is exhausted, False otherwise.
free_current()

Deallocates the current value.

This method is provided as an optimization to save memory, for large objects.

is_open()

Indicates whether the table reader is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table reader is open, False otherwise.
key()

Returns the current key.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current key.
Return type:str
next()

Advances the table reader.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

open(rspecifier)

Opens the table for reading.

Parameters:rspecifier (str) – Kaldi rspecifier for reading the table. If provided, the table is opened for reading.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for reading fails.
value()

Returns the current value.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:The current value.
class kaldi.util.table.VectorWriter(wspecifier='')[source]

Table writer for single precision vectors.

This class is used for writing objects to an archive or script file. It implements the __setitem__ method to provide a dictionary-like interface for writing table entries, e.g. writer[key] = value writes the pair (key, value) to the table.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Raises:IOError – If opening the table for writing fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
flush()

Flushes the table contents to disk/pipe.

is_open()

Indicates whether the table writer is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table writer is open, False otherwise.
open(wspecifier)

Opens the table for writing.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for writing fails.
write(key, value)[source]

Writes the (key, value) pair to the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Overrides write to accept both Vector and SubVector.

Parameters:
  • key (str) – The key.
  • value – The value.
class kaldi.util.table.WaveWriter(wspecifier='')[source]

Table writer for wave files.

This class is used for writing objects to an archive or script file. It implements the __setitem__ method to provide a dictionary-like interface for writing table entries, e.g. writer[key] = value writes the pair (key, value) to the table.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Raises:IOError – If opening the table for writing fails.
close()

Closes the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if table is closed successfully, False otherwise.
flush()

Flushes the table contents to disk/pipe.

is_open()

Indicates whether the table writer is open or not.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Returns:True if the table writer is open, False otherwise.
open(wspecifier)

Opens the table for writing.

Parameters:wspecifier (str) – Kaldi wspecifier for writing the table. If provided, the table is opened for writing.
Returns:True if table is opened successfully, False otherwise.
Raises:IOError – If opening the table for writing fails.
write(key, value)

Writes the (key, value) pair to the table.

This method is provided for compatibility with the C++ API only; most users should use the Pythonic API.

Parameters:
  • key (str) – The key.
  • value – The value.
class kaldi.util.table.WspecifierOptions

Write specifier options.

binary

Write table in binary format.

flush

Flush the stream after writing each entry.

permissive

Ignore absent script file entries.

class kaldi.util.table.WspecifierType

An enumeration.

ARCHIVE_SPECIFIER = 1
BOTH_SPECIFIER = 3
NO_SPECIFIER = 0
SCRIPT_SPECIFIER = 2
kaldi.util.table.classify_rspecifier(rspecifier:str) -> (rspecifier_type:RspecifierType, rxfilename:str, opts:RspecifierOptions)

Decomposes the rspecifier string into its components.

Returns:A tuple containing (rspecifier type, extended filename, rspecifier options).
kaldi.util.table.classify_wspecifier(wspecifier:str) -> (wspecifier_type:WspecifierType, archive_wxfilename:str, script_wxfilename:str, opts:WspecifierOptions)

Decomposes the wspecifier string into its components.

Returns:A tuple containing (wspecifier type, archive filename, script filename, wspecifier options).
kaldi.util.table.read_script_file(rxfilename:str, print_warnings:bool) -> (success:bool, script_out:list<tuple<str, str>>)

Reads a script file into a list of string pairs.

The script (.scp) file format is:

key1 xfilename1
key2 xfilename2
...

where xfilenames are either rxfilenames or wxfilenames.

Parameters:
  • rxfilename (str) – Extended filename for reading the script file.
  • print_warnings (bool) – Whether to print out warning messages that explain the script file errors.
Returns:

A list of (key, xfilename) pairs.

Raises:

ValueError – If the script file format is not valid.

kaldi.util.table.write_script_file(wxfilename:str, script:list<tuple<str, str>>) → bool

Writes a list of string pairs as a script file.

Parameters:wxfilename (str) – Extended filename for writing the script file.
Returns:True on success, False otherwise.