FST  openfst-1.8.2
OpenFst Library
fst-decl.h
Go to the documentation of this file.
1 // Copyright 2005-2020 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the 'License');
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an 'AS IS' BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 //
15 // See www.openfst.org for extensive documentation on this weighted
16 // finite-state transducer library.
17 //
18 // This file contains declarations of classes in the Fst template library.
19 
20 #ifndef FST_FST_DECL_H_
21 #define FST_FST_DECL_H_
22 
23 #include <sys/types.h>
24 
25 #include <cstdint>
26 #include <memory> // for allocator<>
27 
28 #include <fst/windows_defs.inc>
29 
30 namespace fst {
31 
32 // Symbol table and iterator.
33 
34 class SymbolTable;
35 
36 class SymbolTableIterator;
37 
38 // Weight templates and weights.
39 
40 template <class T>
41 class FloatWeightTpl;
42 
43 template <class T>
44 class TropicalWeightTpl;
45 
46 template <class T>
47 class LogWeightTpl;
48 
49 template <class T>
50 class MinMaxWeightTpl;
51 
52 using FloatWeight = FloatWeightTpl<float>;
53 
54 using TropicalWeight = TropicalWeightTpl<float>;
55 
56 using LogWeight = LogWeightTpl<float>;
57 
58 using MinMaxWeight = MinMaxWeightTpl<float>;
59 
60 // Arc templates and arcs.
61 
62 template <class Weight>
63 struct ArcTpl;
64 
65 using StdArc = ArcTpl<TropicalWeight>;
66 
67 using LogArc = ArcTpl<LogWeight>;
68 
69 // Stores.
70 
71 template <class Element, class U>
72 class CompactArcStore;
73 
74 template <class Arc>
75 class DefaultCacheStore;
76 
77 // Compactors.
78 
79 template <class AC, class U, class S = CompactArcStore<typename AC::Element, U>>
80 class CompactArcCompactor;
81 
82 // FST templates.
83 
84 template <class Arc, class Compactor, class CacheStore = DefaultCacheStore<Arc>>
85 class CompactFst;
86 
87 // The Unsigned type is used to represent indices into the compact arc array.
88 template <class Arc, class ArcCompactor, class Unsigned = uint32_t,
89  class CompactStore =
90  CompactArcStore<typename ArcCompactor::Element, Unsigned>,
91  class CacheStore = DefaultCacheStore<Arc>>
92 using CompactArcFst =
93  CompactFst<Arc, CompactArcCompactor<ArcCompactor, Unsigned, CompactStore>,
94  CacheStore>;
95 
96 template <class Arc, class U = uint32_t>
97 class ConstFst;
98 
99 template <class Arc, class Weight, class Matcher>
100 class EditFst;
101 
102 template <class Arc>
103 class ExpandedFst;
104 
105 template <class Arc>
106 class Fst;
107 
108 template <class Arc>
110 
111 template <class Arc, class Allocator = std::allocator<Arc>>
113 
114 template <class Arc, class State = VectorState<Arc>>
115 class VectorFst;
116 
117 template <class Arc, class U = ssize_t>
119 
120 // On-the-fly operations.
121 
122 template <class Arc, class Compare>
123 class ArcSortFst;
124 
125 template <class Arc>
126 class ClosureFst;
127 
128 template <class Arc, class Store = DefaultCacheStore<Arc>>
129 class ComposeFst;
130 
131 template <class Arc>
132 class ConcatFst;
133 
134 template <class Arc>
135 class DeterminizeFst;
136 
137 template <class Arc>
138 class DifferenceFst;
139 
140 template <class Arc>
142 
143 template <class Arc>
144 class InvertFst;
145 
146 template <class AArc, class BArc, class Mapper>
147 class ArcMapFst;
148 
149 template <class Arc>
151 
152 template <class AArc, class BArc, class Selector>
154 
155 template <class Arc>
157 
158 template <class Arc, class StateTable = DefaultReplaceStateTable<Arc>,
159  class Store = DefaultCacheStore<Arc>>
161 
162 template <class Arc>
164 
165 template <class Arc>
166 class UnionFst;
167 
168 // Heap.
169 
170 template <class T, class Compare>
171 class Heap;
172 
173 // ArcCompactors.
174 
175 template <class Arc>
176 class AcceptorCompactor;
177 
178 template <class Arc>
179 class StringCompactor;
180 
181 template <class Arc>
183 
184 template <class Arc>
185 class UnweightedCompactor;
186 
187 template <class Arc>
189 
190 // Compact Arc FSTs.
191 
192 template <class Arc, class U = uint32_t>
194 
195 template <class Arc, class U = uint32_t>
198 
199 template <class Arc, class U = uint32_t>
201 
202 template <class Arc, class U = uint32_t>
204 
205 template <class Arc, class U = uint32_t>
208 
209 // StdArc aliases for FSTs.
210 
216 
217 // StdArc aliases for on-the-fly operations.
218 
219 template <class Compare>
221 
223 
225 
227 
229 
231 
233 
235 
237 
239 
241 
243 
245 
246 // Filter states.
247 
248 template <class T>
249 class IntegerFilterState;
250 
252 
254 
256 
257 // Matchers and filters.
258 
259 template <class FST>
260 class Matcher;
261 
262 template <class Matcher1, class Matcher2 = Matcher1>
263 class NullComposeFilter;
264 
265 template <class Matcher1, class Matcher2 = Matcher1>
267 
268 template <class Matcher1, class Matcher2 = Matcher1>
270 
271 template <class Matcher1, class Matcher2 = Matcher1>
273 
274 template <class Matcher1, class Matcher2 = Matcher1>
275 class MatchComposeFilter;
276 
277 template <class Matcher1, class Matcher2 = Matcher1>
279 
280 } // namespace fst
281 
282 #endif // FST_FST_DECL_H_
ArcTpl< TropicalWeight > StdArc
Definition: arc.h:75
LogWeightTpl< float > LogWeight
Definition: float-weight.h:465
TropicalWeightTpl< float > TropicalWeight
Definition: float-weight.h:264
CompactFst< Arc, CompactArcCompactor< ArcCompactor, Unsigned, CompactStore >, CacheStore > CompactArcFst
Definition: fst-decl.h:94
MinMaxWeightTpl< float > MinMaxWeight
Definition: float-weight.h:908
FloatWeightTpl< float > FloatWeight
Definition: float-weight.h:110
ArcTpl< LogWeight > LogArc
Definition: arc.h:76