23 #ifndef KALDI_UTIL_KALDI_HOLDER_H_ 24 #define KALDI_UTIL_KALDI_HOLDER_H_ 98 static bool Write(std::ostream &os,
bool binary,
const T &t);
114 bool Read(std::istream &is);
147 KALDI_ERR <<
"ExtractRange is not defined for this type of holder.";
234 KALDI_ERR <<
"Ranges not supported for objects of this type.";
242 template <
class Real>
247 template <
class Real>
258 template <
class Real>
271 std::string *data_rxfilename,
282 #endif // KALDI_UTIL_KALDI_HOLDER_H_
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
This class is a wrapper that enables you to store a matrix in one of three forms: either as a Matrix<...
KaldiObjectHolder works for Kaldi objects that have the "standard" Read and Write functions...
static bool Write(std::ostream &os, bool binary, const T &t)
Write() writes this object of type T.
void Clear()
The Clear() function doesn't have to do anything.
A Holder for a vector of basic types, e.g.
void swap(basic_filebuf< CharT, Traits > &x, basic_filebuf< CharT, Traits > &y)
A class for storing matrices.
A class for reading/writing Sphinx format matrices.
bool ExtractObjectRange(const GeneralMatrix &input, const std::string &range, GeneralMatrix *output)
GeneralMatrix is always of type BaseFloat.
BasicHolder is valid for float, double, bool, and integer types.
bool Read(std::istream &is)
Reads into the holder.
GenericHolder()
Must have a constructor that takes no arguments.
BasicVectorVectorHolder is a Holder for a vector of vector of a basic type, e.g.
T & Value()
Returns the value of the object held here.
bool ExtractRange(const GenericHolder< T > &other, const std::string &range)
At the time of writing this will only do something meaningful KaldiObjectHolder holding matrix object...
A class representing a vector.
BasicPairVectorHolder is a Holder for a vector of pairs of a basic type, e.g.
bool ExtractRangeSpecifier(const std::string &rxfilename_with_range, std::string *data_rxfilename, std::string *range)
void Swap(GenericHolder< T > *other)
This swaps the objects held by *this and *other (preferably a shallow swap).
~GenericHolder()
If the object held pointers, the destructor would free them.
KALDI_DISALLOW_COPY_AND_ASSIGN(GenericHolder)
static bool IsReadInBinary()
IsReadInBinary() will return true if the object wants the file to be opened in binary for reading (if...
GenericHolder serves to document the requirements of the Holder interface; it's not intended to be us...