All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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
< TokenHolder
token_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 433 of file kaldi-table.h.

Member Typedef Documentation

typedef Holder::T T

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

Constructor & Destructor Documentation

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

442 {}

Member Function Documentation

bool Close ( )
inline

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

References RandomAccessTableReaderMapped< Holder >::reader_.

451 { return reader_.Close(); }
RandomAccessTableReader< Holder > reader_
Definition: kaldi-table.h:461
bool IsOpen ( ) const
inline

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

References RandomAccessTableReaderMapped< Holder >::reader_.

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

450 { return reader_.IsOpen(); }
RandomAccessTableReader< Holder > reader_
Definition: kaldi-table.h:461
RandomAccessTableReaderMapped& operator= ( const RandomAccessTableReaderMapped< Holder > &  )
private

Member Data Documentation

RandomAccessTableReader<TokenHolder> token_reader_
private

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

std::string utt2spk_rxfilename_
private

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


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