FST  openfst-1.7.3
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 std::string &,
18  const std::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 std::string &arc_filter, const std::string &info_type,
31  bool pipe, bool verify);
32 
33 using GetInfoArgs = std::tuple<const FstClass &, bool, const std::string &,
34  const std::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 std::string &arc_filter, const std::string &info_type,
45  bool verify, FstInfo *info);
46 
47 } // namespace script
48 } // namespace fst
49 
50 #endif // FST_SCRIPT_INFO_H_
std::tuple< const FstClass &, bool, const std::string &, const std::string &, bool, FstInfo * > GetInfoArgs
Definition: info.h:34
virtual bool Write(std::ostream &strm, const FstWriteOptions &opts) const
Definition: fst.h:269
std::tuple< const FstClass &, bool, const std::string &, const std::string &, bool, bool > InfoArgs
Definition: info.h:18
void GetFstInfo(GetInfoArgs *args)
Definition: info.h:37
void PrintFstInfo(InfoArgs *args)
Definition: info.h:21
void PrintFstInfoImpl(const FstInfo &fstinfo, bool pipe=false)
Definition: info-impl.cc:5