simple-io-funcs.h
Go to the documentation of this file.
1 // util/simple-io-funcs.h
2 
3 // Copyright 2009-2011 Microsoft Corporation; Jan Silovsky
4 
5 // See ../../COPYING for clarification regarding multiple authors
6 //
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
10 
11 // http://www.apache.org/licenses/LICENSE-2.0
12 
13 // THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 // KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
15 // WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
16 // MERCHANTABLITY OR NON-INFRINGEMENT.
17 // See the Apache 2 License for the specific language governing permissions and
18 // limitations under the License.
19 #ifndef KALDI_UTIL_SIMPLE_IO_FUNCS_H_
20 #define KALDI_UTIL_SIMPLE_IO_FUNCS_H_
21 
22 #include <string>
23 #include <vector>
24 #include "util/kaldi-io.h"
25 
26 // This header contains some utilities for reading some common, simple text
27 // formats:integers in files, one per line, and integers in files, possibly
28 // multiple per line. these are not really fully native Kaldi formats; they are
29 // mostly for small files that might be generated by scripts, and can be read
30 // all at one time. for longer files of this type, we would probably use the
31 // Table code.
32 
33 namespace kaldi {
34 
38 bool WriteIntegerVectorSimple(const std::string &wxfilename,
39  const std::vector<int32> &v);
40 
44 bool ReadIntegerVectorSimple(const std::string &rxfilename,
45  std::vector<int32> *v);
46 
47 // This is a file format like:
48 // 1 2
49 // 3
50 //
51 // 4 5 6
52 // etc.
53 bool WriteIntegerVectorVectorSimple(const std::string &wxfilename,
54  const std::vector<std::vector<int32> > &v);
55 
56 bool ReadIntegerVectorVectorSimple(const std::string &rxfilename,
57  std::vector<std::vector<int32> > *v);
58 
59 
60 } // end namespace kaldi.
61 
62 
63 #endif // KALDI_UTIL_SIMPLE_IO_FUNCS_H_
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
Definition: chain.dox:20
bool ReadIntegerVectorVectorSimple(const std::string &rxfilename, std::vector< std::vector< int32 > > *list)
bool WriteIntegerVectorVectorSimple(const std::string &wxfilename, const std::vector< std::vector< int32 > > &list)
bool WriteIntegerVectorSimple(const std::string &wxfilename, const std::vector< int32 > &list)
WriteToList attempts to write this list of integers, one per line, to the given file, in text format.
bool ReadIntegerVectorSimple(const std::string &rxfilename, std::vector< int32 > *list)
ReadFromList attempts to read this list of integers, one per line, from the given file...