21 #ifndef KALDI_UTIL_KALDI_TABLE_H_ 22 #define KALDI_UTIL_KALDI_TABLE_H_ 34 template<
class Holder>
class RandomAccessTableReaderImplBase;
35 template<
class Holder>
class SequentialTableReaderImplBase;
36 template<
class Holder>
class TableWriterImplBase;
125 std::string *archive_wxfilename,
126 std::string *script_wxfilename,
141 std::vector<std::pair<std::string, std::string> >
147 std::vector<std::pair<std::string, std::string> >
156 const std::vector<std::pair<std::string, std::string> >
161 const std::vector<std::pair<std::string, std::string> >
215 called_sorted(false), permissive(false),
216 background(false) { }
226 std::string *rxfilename,
232 template<
class Holder>
235 typedef typename Holder::T
T;
244 bool Open(
const std::string &rspecifier);
247 bool IsOpen()
const {
return (impl_ != NULL); }
259 bool HasKey(
const std::string &key);
265 const T &Value(
const std::string &key);
277 void CheckImpl()
const;
286 template<
class Holder>
289 typedef typename Holder::T
T;
300 bool Open(
const std::string &rspecifier);
309 inline std::string Key();
359 void CheckImpl()
const;
367 template<
class Holder>
370 typedef typename Holder::T
T;
377 explicit TableWriter(
const std::string &wspecifier);
381 bool Open(
const std::string &wspecifier);
387 inline void Write(
const std::string &key,
const T &value)
const;
412 void CheckImpl()
const;
431 template<
class Holder>
434 typedef typename Holder::T
T;
439 const std::string &utt2spk_rxfilename);
444 bool Open(
const std::string &table_rxfilename,
445 const std::string &utt2spk_rxfilename);
447 bool HasKey(
const std::string &key);
448 const T &Value(
const std::string &key);
449 inline bool IsOpen()
const {
return reader_.IsOpen(); }
450 inline bool Close() {
return reader_.Close(); }
471 #endif // KALDI_UTIL_KALDI_TABLE_H_
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
std::vector< std::string > KeyList
std::string utt2spk_rxfilename_
RandomAccessTableReader< TokenHolder > token_reader_
This class is for when you are reading something in random access, but it may actually be stored per-...
SequentialTableReader(const SequentialTableReader< Holder > &other)
A templated class for writing objects to an archive or script file; see The Table concept...
SequentialTableReaderImplBase< Holder > * impl_
RspecifierType ClassifyRspecifier(const std::string &rspecifier, std::string *rxfilename, RspecifierOptions *opts)
Allows random access to a collection of objects in an archive or script file; see The Table concept...
RandomAccessTableReader(const RandomAccessTableReader< Holder > &other)
RandomAccessTableReader()
bool WriteScriptFile(std::ostream &os, const std::vector< std::pair< std::string, std::string > > &script)
TableWriter(const TableWriter &other)
A templated class for reading objects sequentially from an archive or script file; see The Table conc...
RandomAccessTableReader< Holder > reader_
WspecifierType ClassifyWspecifier(const std::string &wspecifier, std::string *archive_wxfilename, std::string *script_wxfilename, WspecifierOptions *opts)
bool ReadScriptFile(const std::string &rxfilename, bool warn, std::vector< std::pair< std::string, std::string > > *script_out)
#define KALDI_ASSERT(cond)
RandomAccessTableReaderMapped()
TableWriterImplBase< Holder > * impl_
RandomAccessTableReaderImplBase< Holder > * impl_