FST  openfst-1.7.3
OpenFst Library
sttable.cc
Go to the documentation of this file.
1 // See www.openfst.org for extensive documentation on this weighted
2 // finite-state transducer library.
3 
4 #include <fstream>
6 
7 namespace fst {
8 
9 bool IsSTTable(const std::string &filename) {
10  std::ifstream strm(filename);
11  if (!strm.good()) return false;
12 
13  int32 magic_number = 0;
14  ReadType(strm, &magic_number);
15  return magic_number == kSTTableMagicNumber;
16 }
17 
18 } // namespace fst
bool IsSTTable(const std::string &filename)
Definition: sttable.cc:9
int32_t int32
Definition: types.h:26
std::istream & ReadType(std::istream &strm, T *t)
Definition: util.h:47