36 label =
"\"PdfClass = ?\"";
37 }
else if (key == 0) {
38 if (
N_ == 1 &&
P_ == 0)
39 label =
"\"Phone = ?\"";
40 else if (
N_ == 3 &&
P_ == 1)
41 label =
"\"LContext = ?\"";
42 }
else if (key == 2 &&
N_ == 3 &&
P_ == 1) {
43 label =
"\"RContext = ?\"";
44 }
else if (key >= 0 && key <=
N_-1) {
46 label =
"\"Center = ?\"";
48 std::ostringstream oss;
49 oss <<
"\"Ctx Position " << key <<
" = ?\"";
53 KALDI_ERR <<
"Invalid decision tree key: " << key;
56 out_ <<
id <<
"[label=" << label <<
", color=" << color
57 <<
", penwidth=" << width <<
"];" << std::endl;
63 std::ostringstream oss;
65 for (; child != intset.
end(); ++child) {
66 if (child != intset.
begin())
70 phone_syms_.Find(static_cast<kaldi::int64>(*child));
72 KALDI_ERR <<
"No phone found for Phone ID " << *child;
94 const EventType *query_no = (query_yes == NULL)? query: NULL;
103 out_ <<
"tooltip=\"" << yes_label <<
"\", label=YES" 104 <<
", penwidth=" << width_yes <<
", color=" << color_yes <<
"];\n";
106 out_ <<
"label=\"" << yes_label <<
"\", penwidth=" << width_yes
107 <<
", penwidth=" << width_yes <<
", color=" << color_yes <<
"];\n";
110 out_ <<
"\t" <<
id <<
" -> " << next_id_++ <<
"[label=NO" 111 <<
", color=" << color_no <<
", penwidth=" << width_no <<
"];\n";
129 for (
size_t t = 0; t < size; t++) {
132 std::ostringstream label;
135 }
else if (key >= 0 && key <
N_) {
140 std::string phone =
phone_syms_.Find(static_cast<kaldi::int64>(t));
142 KALDI_ERR <<
"Phone ID found in a TableEventMap, but not in the " 143 <<
"phone symbol table! ID: " << t;
146 KALDI_ERR <<
"TableEventMap: Invalid event key: " << key;
149 out_ <<
"\t" <<
id <<
" -> " <<
next_id_++ <<
" [label=" << label.str()
150 <<
", color=" << color <<
", penwidth=" << width <<
"];\n";
151 const EventType *query_child = (t == value)? query: NULL;
165 out_ <<
id <<
"[shape=doublecircle, label=" << answer
166 <<
",color=" << color <<
", penwidth=" << width <<
"];\n";
174 }
else if (c ==
'C') {
176 }
else if (c ==
'T') {
178 }
else if (c ==
'S') {
182 <<
", at file position " <<
is_.tellg();
191 if (query && query->size() !=
N_+1)
192 KALDI_ERR <<
"Invalid query size \"" << query->size() <<
"\"! Expected \"" 194 out_ <<
"digraph EventMap {\n";
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
fst::SymbolTable & phone_syms_
void ReadBasicType(std::istream &is, bool binary, T *t)
ReadBasicType is the name of the read function for bool, integer types, and floating-point types...
void RenderSplit(const EventType *query, int32 id)
int Peek(std::istream &is, bool binary)
Peek consumes whitespace (if binary == false) and then returns the peek() value of the stream...
static const EventKeyType kPdfClass
std::vector< std::pair< EventKeyType, EventValueType > > EventType
void ExpectToken(std::istream &is, bool binary, const char *token)
ExpectToken tries to read in the given token, and throws an exception on failure. ...
int32 EventKeyType
Things of type EventKeyType can take any value.
void RenderConstant(const EventType *query, int32 id)
std::string CharToString(const char &c)
void Read(std::istream &is, bool binary)
static const int32 kEdgeWidth
static bool Lookup(const EventType &event, EventKeyType key, EventValueType *ans)
void RenderNonLeaf(int32 id, const EventKeyType &key, bool in_query)
void RenderSubTree(const EventType *query, int32 id)
std::string MakeEdgeLabel(const EventKeyType &key, const ConstIntegerSet< EventValueType > &intset)
static const std::string kEdgeColorQuery
static const int32 kEdgeWidthQuery
void RenderTable(const EventType *query, int32 id)
static const std::string kEdgeColor
int32 EventAnswerType
As far as the event-map code itself is concerned, things of type EventAnswerType may take any value e...
int32 EventValueType
Given current code, things of type EventValueType should generally be nonnegative and in a reasonably...
void Render(const EventType *query)