FST  openfst-1.6.1
OpenFst Library
fstscript.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 // The FST script interface permits users to interact with FSTs without knowing
5 // their arc type. It does this by mapping compile-time polymorphism (in the
6 // form of a arc-templated FST types) onto a shared virtual interface. It also
7 // supports arc extension via a DSO interface. Due to the overhead of virtual
8 // dispatch and registered function lookups, the script API is somewhat slower
9 // then library API provided by types like StdVectorFst, but has the advantage
10 // that it is designed not to crash (and to provide useful debugging
11 // information) upon common user errors like passing invalid indices or
12 // attempting comparison of incompatible FSTs. It is used both by the FST
13 // binaries and the Python extension.
14 //
15 // This header includes all of the FST script functionality.
16 
17 #ifndef FST_SCRIPT_FSTSCRIPT_H_
18 #define FST_SCRIPT_FSTSCRIPT_H_
19 
20 // Major classes
23 #include <fst/script/fst-class.h>
25 #include <fst/script/text-io.h>
27 
28 // Flag-to-enum parsers.
29 #include <fst/script/getters.h>
30 // Templates like Operation<> and Apply<>.
31 #include <fst/script/script-impl.h>
32 
33 // Operations.
34 #include <fst/script/arcsort.h>
35 #include <fst/script/closure.h>
36 #include <fst/script/compile.h>
37 #include <fst/script/compose.h>
38 #include <fst/script/concat.h>
39 #include <fst/script/connect.h>
40 #include <fst/script/convert.h>
41 #include <fst/script/decode.h>
42 #include <fst/script/determinize.h>
43 #include <fst/script/difference.h>
45 #include <fst/script/draw.h>
46 #include <fst/script/encode.h>
48 #include <fst/script/equal.h>
49 #include <fst/script/equivalent.h>
50 #include <fst/script/info.h>
51 #include <fst/script/intersect.h>
52 #include <fst/script/invert.h>
53 #include <fst/script/isomorphic.h>
54 #include <fst/script/map.h>
55 #include <fst/script/minimize.h>
56 #include <fst/script/print.h>
57 #include <fst/script/project.h>
58 #include <fst/script/prune.h>
59 #include <fst/script/push.h>
61 #include <fst/script/randgen.h>
62 #include <fst/script/relabel.h>
63 #include <fst/script/replace.h>
64 #include <fst/script/reverse.h>
65 #include <fst/script/reweight.h>
66 #include <fst/script/rmepsilon.h>
69 #include <fst/script/synchronize.h>
70 #include <fst/script/topsort.h>
71 #include <fst/script/union.h>
72 #include <fst/script/verify.h>
73 
74 // This class is necessary because registering each of the operations
75 // separately overfills the stack, as there's so many of them.
76 namespace fst {
77 namespace script {
78 
79 template <class Arc>
81  public:
83  RegisterBatch1();
84  RegisterBatch2();
85  }
86 
87  private:
88  void RegisterBatch1() {
121  }
122 
123  void RegisterBatch2() {
157  }
158 };
159 } // namespace script
160 } // namespace fst
161 
162 #define REGISTER_FST_OPERATIONS(Arc) \
163  AllFstOperationsRegisterer<Arc> register_all_fst_operations##Arc;
164 
165 #endif // FST_SCRIPT_FSTSCRIPT_H_
void Minimize(MinimizeArgs *args)
Definition: minimize.h:18
void Synchronize(SynchronizeArgs *args)
Definition: synchronize.h:17
void Decode(DecodeArgs1 *args)
Definition: decode.h:22
void Encode(EncodeArgs1 *args)
Definition: encode.h:23
void RmEpsilon(RmEpsilonArgs1 *args)
Definition: rmepsilon.h:99
void Equivalent(EquivalentArgs *args)
Definition: equivalent.h:19
void Replace(ReplaceArgs *args)
Definition: replace.h:36
void EpsNormalize(EpsNormalizeArgs *args)
Definition: epsnormalize.h:18
void TopSort(TopSortArgs *args)
Definition: topsort.h:17
void Compose(ComposeArgs1 *args)
Definition: compose.h:18
REGISTER_FST_OPERATION(Compress, StdArc, CompressArgs)
void ArcSort(ArcSortArgs *args)
Definition: arcsort.h:19
void Intersect(IntersectArgs1 *args)
Definition: intersect.h:19
void InitEncodeMapperClass(InitEncodeMapperClassArgs *args)
void Verify(VerifyArgs *args)
Definition: verify.h:17
void PrintFstInfo(InfoArgs *args)
Definition: info.h:18
void Equal(EqualArgs *args)
Definition: equal.h:19
void Relabel(RelabelArgs1 *args)
Definition: relabel.h:27
void Invert(MutableFstClass *fst)
Definition: invert.h:15
void PrintFst(FstPrinterArgs *args)
Definition: print.h:52
void ShortestDistance(ShortestDistanceArgs1 *args)
void Determinize(DeterminizeArgs1 *args)
Definition: determinize.h:39
void Union(UnionArgs *args)
Definition: union.h:17
void Disambiguate(DisambiguateArgs1 *args)
Definition: disambiguate.h:32
void Reweight(ReweightArgs *args)
Definition: reweight.h:22
void Reverse(ReverseArgs *args)
Definition: reverse.h:17
void Project(ProjectArgs *args)
Definition: project.h:17
void Prune(PruneArgs1 *args)
Definition: prune.h:57
void Push(PushArgs1 *args)
Definition: push.h:18
void InitStateIteratorClass(InitStateIteratorClassArgs *args)
void Difference(DifferenceArgs1 *args)
Definition: difference.h:19
void RandGen(RandGenArgs *args)
Definition: randgen.h:21
void DrawFst(FstDrawerArgs *args)
Definition: draw.h:67
void InitArcIteratorClass(InitArcIteratorClassArgs *args)
void Convert(ConvertArgs *args)
Definition: convert.h:21
void Map(MapArgs *args)
Definition: map.h:59
void RandEquivalent(RandEquivalentArgs1 *args)
void CompileFstInternal(CompileFstArgs *args)
Definition: compile.h:62
void Connect(MutableFstClass *fst)
Definition: connect.h:16
void ShortestPath(ShortestPathArgs1 *args)
Definition: shortest-path.h:41
void Closure(ClosureArgs *args)
Definition: closure.h:17
void Concat(ConcatArgs1 *args)
Definition: concat.h:17
void InitMutableArcIteratorClass(InitMutableArcIteratorClassArgs *args)