FST  openfst-1.6.1
OpenFst Library
convert.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_CONVERT_H_
5 #define FST_SCRIPT_CONVERT_H_
6 
7 #include <memory>
8 #include <string>
9 
10 #include <fst/script/arg-packs.h>
11 #include <fst/script/fst-class.h>
12 
13 namespace fst {
14 namespace script {
15 
17 
19 
20 template <class Arc>
21 void Convert(ConvertArgs *args) {
22  const Fst<Arc> &fst = *(args->args.arg1.GetFst<Arc>());
23  const string &new_type = args->args.arg2;
24  std::unique_ptr<Fst<Arc>> result(Convert(fst, new_type));
25  args->retval = result ? new FstClass(*result) : nullptr;
26 }
27 
28 FstClass *Convert(const FstClass &f, const string &new_type);
29 
30 } // namespace script
31 } // namespace fst
32 
33 #endif // FST_SCRIPT_CONVERT_H_
void Convert(ConvertArgs *args)
Definition: convert.h:21