AccumulateTreeStatsInfo Struct Reference

#include <tree-accu.h>

Collaboration diagram for AccumulateTreeStatsInfo:

Public Member Functions

 AccumulateTreeStatsInfo (const AccumulateTreeStatsOptions &opts)
 

Public Attributes

BaseFloat var_floor
 
std::vector< int32ci_phones
 
std::vector< int32phone_map
 
int32 context_width
 
int32 central_position
 

Detailed Description

Definition at line 63 of file tree-accu.h.

Constructor & Destructor Documentation

◆ AccumulateTreeStatsInfo()

Definition at line 137 of file tree-accu.cc.

References AccumulateTreeStatsInfo::central_position, AccumulateTreeStatsInfo::ci_phones, AccumulateTreeStatsOptions::ci_phones_str, AccumulateTreeStatsInfo::context_width, kaldi::IsSortedAndUniq(), KALDI_ERR, AccumulateTreeStatsInfo::phone_map, AccumulateTreeStatsOptions::phone_map_rxfilename, kaldi::ReadPhoneMap(), and kaldi::SplitStringToIntegers().

138  :
139  var_floor(opts.var_floor),
140  context_width(opts.context_width),
141  central_position(opts.central_position) {
143  KALDI_ERR << "Invalid options: --central-position=" << central_position
144  << ", --context-width=" << context_width;
145  if (!opts.phone_map_rxfilename.empty())
146  ReadPhoneMap(opts.phone_map_rxfilename, &phone_map);
147 
148  if (!opts.ci_phones_str.empty()) {
149  SplitStringToIntegers(opts.ci_phones_str, ":", false, &ci_phones);
150  std::sort(ci_phones.begin(), ci_phones.end());
151  if (!IsSortedAndUniq(ci_phones) || ci_phones.empty() || ci_phones[0] == 0)
152  KALDI_ERR << "Invalid --ci-phones option: " << opts.ci_phones_str;
153  }
154 }
bool SplitStringToIntegers(const std::string &full, const char *delim, bool omit_empty_strings, std::vector< I > *out)
Split a string (e.g.
Definition: text-utils.h:68
std::vector< int32 > phone_map
Definition: tree-accu.h:67
void ReadPhoneMap(std::string phone_map_rxfilename, std::vector< int32 > *phone_map)
Definition: tree-accu.cc:106
#define KALDI_ERR
Definition: kaldi-error.h:147
std::vector< int32 > ci_phones
Definition: tree-accu.h:65
bool IsSortedAndUniq(const std::vector< T > &vec)
Returns true if the vector is sorted and contains each element only once.
Definition: stl-utils.h:63

Member Data Documentation

◆ central_position

◆ ci_phones

◆ context_width

◆ phone_map

◆ var_floor

BaseFloat var_floor

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