25 int main(
int argc,
char *argv[]) {
27 using namespace kaldi;
30 "Print dimension info on an input matrix (rows then cols, separated by tab), to\n" 31 "standard output. Output for single filename: rows[tab]cols. Output per line for\n" 32 "archive of files: key[tab]rows[tab]cols\n" 33 "Usage: matrix-dim [options] <matrix-in>|<in-rspecifier>\n" 34 "e.g.: matrix-dim final.mat | cut -f 2\n" 35 "See also: feat-to-len, feat-to-dim\n";
47 std::string matrix_rspecifier = po.
GetArg(1);
50 for (; !matrix_reader.
Done(); matrix_reader.
Next(), num_read++) {
52 std::cout << matrix_reader.
Key() <<
'\t' 56 KALDI_WARN <<
"No features read from rspecifier '" 57 << matrix_rspecifier <<
"'";
58 return (num_read == 0 ? 1 : 0);
60 std::string matrix_rxfilename = po.
GetArg(1);
66 }
catch(
const std::exception &e) {
67 std::cerr << e.what();
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
MatrixIndexT NumCols() const
Returns number of columns (or zero for empty matrix).
void PrintUsage(bool print_command_line=false)
Prints the usage documentation [provided in the constructor].
RspecifierType ClassifyRspecifier(const std::string &rspecifier, std::string *rxfilename, RspecifierOptions *opts)
void ReadKaldiObject(const std::string &filename, Matrix< float > *m)
The class ParseOptions is for parsing command-line options; see Parsing command-line options for more...
A templated class for reading objects sequentially from an archive or script file; see The Table conc...
int Read(int argc, const char *const *argv)
Parses the command line options and fills the ParseOptions-registered variables.
std::string GetArg(int param) const
Returns one of the positional parameters; 1-based indexing for argc/argv compatibility.
int main(int argc, char *argv[])
int NumArgs() const
Number of positional parameters (c.f. argc-1).
MatrixIndexT NumRows() const
Returns number of rows (or zero for empty matrix).