RandomAccessTableReaderMapped< Holder > Class Template Reference

This class is for when you are reading something in random access, but it may actually be stored per-speaker (or something similar) but the keys you're using are per utterance. More...

#include <kaldi-table.h>

Collaboration diagram for RandomAccessTableReaderMapped< Holder >:

Public Types

typedef Holder::T T
 

Public Member Functions

 RandomAccessTableReaderMapped (const std::string &table_rxfilename, const std::string &utt2spk_rxfilename)
 Note: "utt2spk_rxfilename" will in the normal case be an rxfilename for an utterance to speaker map, but this code is general; it accepts a generic map. More...
 
 RandomAccessTableReaderMapped ()
 
bool Open (const std::string &table_rxfilename, const std::string &utt2spk_rxfilename)
 Note: when calling Open, utt2spk_rxfilename may be empty. More...
 
bool HasKey (const std::string &key)
 
const TValue (const std::string &key)
 
bool IsOpen () const
 
bool Close ()
 

Private Member Functions

RandomAccessTableReaderMappedoperator= (const RandomAccessTableReaderMapped< Holder > &)
 

Private Attributes

RandomAccessTableReader< Holder > reader_
 
RandomAccessTableReader< TokenHoldertoken_reader_
 
std::string utt2spk_rxfilename_
 

Detailed Description

template<class Holder>
class kaldi::RandomAccessTableReaderMapped< Holder >

This class is for when you are reading something in random access, but it may actually be stored per-speaker (or something similar) but the keys you're using are per utterance.

So you also provide an "rxfilename" for a file containing lines like utt1 spk1 utt2 spk1 utt3 spk1 and so on. Note: this is optional; if it is an empty string, we just won't do the mapping. Also, "table_rxfilename" may be the empty string (as for a regular table), in which case the table just won't be opened. We provide only the most frequently used of the functions of RandomAccessTableReader.

Definition at line 432 of file kaldi-table.h.

Member Typedef Documentation

◆ T

typedef Holder::T T

Definition at line 434 of file kaldi-table.h.

Constructor & Destructor Documentation

◆ RandomAccessTableReaderMapped()

Definition at line 441 of file kaldi-table.h.

441 {}

Member Function Documentation

◆ Close()

bool Close ( )
inline

Definition at line 450 of file kaldi-table.h.

450 { return reader_.Close(); }
RandomAccessTableReader< Holder > reader_
Definition: kaldi-table.h:460

◆ IsOpen()

bool IsOpen ( ) const
inline

Definition at line 449 of file kaldi-table.h.

Referenced by main(), and kaldi::ProcessUtterance().

449 { return reader_.IsOpen(); }
RandomAccessTableReader< Holder > reader_
Definition: kaldi-table.h:460

◆ operator=()

RandomAccessTableReaderMapped& operator= ( const RandomAccessTableReaderMapped< Holder > &  )
private

Member Data Documentation

◆ reader_

◆ token_reader_

◆ utt2spk_rxfilename_

std::string utt2spk_rxfilename_
private

The documentation for this class was generated from the following files: