20 #ifndef KALDI_HMM_HMM_TOPOLOGY_H_ 21 #define KALDI_HMM_HMM_TOPOLOGY_H_ 112 this->forward_pdf_class = pdf_class;
113 this->self_loop_pdf_class = pdf_class;
116 KALDI_ASSERT((forward_pdf_class != kNoPdf && self_loop_pdf_class != kNoPdf) ||
117 (forward_pdf_class == kNoPdf && self_loop_pdf_class == kNoPdf));
128 HmmState(): forward_pdf_class(-1), self_loop_pdf_class(-1) { }
135 void Read(std::istream &is,
bool binary);
136 void Write(std::ostream &os,
bool binary)
const;
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
A structure defined inside HmmTopology to represent a HMM state.
HmmState(int32 forward_pdf_class, int32 self_loop_pdf_class)
A class for storing topology information for phones.
bool IsHmm() const
Returns true if this HmmTopology is really 'hmm-like', i.e.
HmmState(int32 pdf_class)
void Read(std::istream &is, bool binary)
bool operator==(const HmmState &other) const
std::vector< HmmState > TopologyEntry
TopologyEntry is a typedef that represents the topology of a single (prototype) state.
static const int32 kNoPdf
A constant used in the HmmTopology class as the pdf-class kNoPdf, which is used when a HMM-state is n...
std::vector< int32 > phones_
int32 NumPdfClasses(int32 phone) const
Returns the number of pdf-classes for this phone; throws exception if phone not covered by this topol...
void Write(std::ostream &os, bool binary) const
const TopologyEntry & TopologyForPhone(int32 phone) const
Returns the topology entry (i.e.
std::vector< std::pair< int32, BaseFloat > > transitions
A list of transitions, indexed by what we call a 'transition-index'.
std::vector< TopologyEntry > entries_
const std::vector< int32 > & GetPhones() const
Returns a reference to a sorted, unique list of phones covered by the topology (these phones will be ...
std::vector< int32 > phone2idx_
#define KALDI_ASSERT(cond)
int32 forward_pdf_class
The Pdf-classes forward-pdf-class, typically 0, 1 or 2 (the same as the HMM-state index)...
int32 MinLength(int32 phone) const
void GetPhoneToNumPdfClasses(std::vector< int32 > *phone2num_pdf_classes) const
Outputs a vector of int32, indexed by phone, that gives the number of Pdf-classes pdf-classes for the...
int32 self_loop_pdf_class
The Pdf-classes self-loop pdf-class, similar to Pdf-classes forward-pdf-class.