FST  openfst-1.7.2
OpenFst Library
info.h
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 #ifndef FST_SCRIPT_INFO_H_
5 #define FST_SCRIPT_INFO_H_
6 
7 #include <string>
8 #include <tuple>
9 
10 #include <fst/script/arg-packs.h>
11 #include <fst/script/fst-class.h>
12 #include <fst/script/info-impl.h>
13 
14 namespace fst {
15 namespace script {
16 
17 using InfoArgs = std::tuple<const FstClass &, bool, const string &,
18  const string &, bool, bool>;
19 
20 template <class Arc>
21 void PrintFstInfo(InfoArgs *args) {
22  const Fst<Arc> &fst = *(std::get<0>(*args).GetFst<Arc>());
23  const FstInfo fstinfo(fst, std::get<1>(*args), std::get<2>(*args),
24  std::get<3>(*args), std::get<4>(*args));
25  PrintFstInfoImpl(fstinfo, std::get<5>(*args));
26  if (std::get<5>(*args)) fst.Write("");
27 }
28 
29 void PrintFstInfo(const FstClass &f, bool test_properties,
30  const string &arc_filter, const string &info_type, bool pipe,
31  bool verify);
32 
33 using GetInfoArgs = std::tuple<const FstClass &, bool, const string &,
34  const string &, bool, FstInfo *>;
35 
36 template <class Arc>
37 void GetFstInfo(GetInfoArgs *args) {
38  const Fst<Arc> &fst = *(std::get<0>(*args).GetFst<Arc>());
39  *(std::get<5>(*args)) = FstInfo(fst, std::get<1>(*args), std::get<2>(*args),
40  std::get<3>(*args), std::get<4>(*args));
41 }
42 
43 void GetFstInfo(const FstClass &fst, bool test_properties,
44  const string &arc_filter, const string &info_type, bool verify,
45  FstInfo *info);
46 
47 } // namespace script
48 } // namespace fst
49 
50 #endif // FST_SCRIPT_INFO_H_
virtual bool Write(std::ostream &strm, const FstWriteOptions &opts) const
Definition: fst.h:270
void GetFstInfo(GetInfoArgs *args)
Definition: info.h:37
void PrintFstInfo(InfoArgs *args)
Definition: info.h:21
std::tuple< const FstClass &, bool, const string &, const string &, bool, bool > InfoArgs
Definition: info.h:18
void PrintFstInfoImpl(const FstInfo &fstinfo, bool pipe=false)
Definition: info-impl.cc:5
std::tuple< const FstClass &, bool, const string &, const string &, bool, FstInfo * > GetInfoArgs
Definition: info.h:34