FST  openfst-1.8.3
OpenFst Library
fst-decl.h
Go to the documentation of this file.
1 // Copyright 2005-2024 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 // Do not let Include-What-You-Use suggest this file.
24 
25 
26 #include <sys/types.h>
27 
28 #include <cstdint>
29 #include <memory> // for allocator<>
30 
31 #include <fst/windows_defs.inc>
32 
33 namespace fst {
34 
35 // Symbol table and iterator.
36 
37 class SymbolTable;
38 
39 class SymbolTableIterator;
40 
41 // Weight templates and weights.
42 
43 template <class T>
44 class FloatWeightTpl;
45 
46 template <class T>
47 class TropicalWeightTpl;
48 
49 template <class T>
50 class LogWeightTpl;
51 
52 template <class T>
53 class MinMaxWeightTpl;
54 
55 using FloatWeight = FloatWeightTpl<float>;
56 
57 using TropicalWeight = TropicalWeightTpl<float>;
58 
59 using LogWeight = LogWeightTpl<float>;
60 
61 using MinMaxWeight = MinMaxWeightTpl<float>;
62 
63 // Arc templates and arcs.
64 
65 template <class Weight, class Label = int, class StateId = int>
66 struct ArcTpl;
67 
68 using StdArc = ArcTpl<TropicalWeight>;
69 
70 using LogArc = ArcTpl<LogWeight>;
71 
72 // Stores.
73 
74 template <class Element, class U>
75 class CompactArcStore;
76 
77 template <class Arc>
78 class DefaultCacheStore;
79 
80 // Compactors.
81 
82 template <class AC, class U, class S = CompactArcStore<typename AC::Element, U>>
83 class CompactArcCompactor;
84 
85 // FST templates.
86 
87 template <class Arc, class Compactor, class CacheStore = DefaultCacheStore<Arc>>
88 class CompactFst;
89 
90 // The Unsigned type is used to represent indices into the compact arc array.
91 template <class Arc, class ArcCompactor, class Unsigned = uint32_t,
92  class CompactStore =
93  CompactArcStore<typename ArcCompactor::Element, Unsigned>,
94  class CacheStore = DefaultCacheStore<Arc>>
95 using CompactArcFst =
96  CompactFst<Arc, CompactArcCompactor<ArcCompactor, Unsigned, CompactStore>,
97  CacheStore>;
98 
99 template <class Arc, class U = uint32_t>
100 class ConstFst;
101 
102 template <class Arc, class Weight, class Matcher>
103 class EditFst;
104 
105 template <class Arc>
106 class ExpandedFst;
107 
108 template <class Arc>
109 class Fst;
110 
111 template <class Arc>
113 
114 template <class Arc, class Allocator = std::allocator<Arc>>
116 
117 template <class Arc, class State = VectorState<Arc>>
118 class VectorFst;
119 
120 template <class Arc, class U = ssize_t>
122 
123 // On-the-fly operations.
124 
125 template <class Arc, class Compare>
126 class ArcSortFst;
127 
128 template <class Arc>
129 class ClosureFst;
130 
131 template <class Arc, class Store = DefaultCacheStore<Arc>>
132 class ComposeFst;
133 
134 template <class Arc>
135 class ConcatFst;
136 
137 template <class Arc>
138 class DeterminizeFst;
139 
140 template <class Arc>
141 class DifferenceFst;
142 
143 template <class Arc>
145 
146 template <class Arc>
147 class InvertFst;
148 
149 template <class AArc, class BArc, class Mapper>
150 class ArcMapFst;
151 
152 template <class Arc>
154 
155 template <class AArc, class BArc, class Selector>
157 
158 template <class Arc>
160 
161 template <class Arc, class StateTable = DefaultReplaceStateTable<Arc>,
162  class Store = DefaultCacheStore<Arc>>
164 
165 template <class Arc>
167 
168 template <class Arc>
169 class UnionFst;
170 
171 // Heap.
172 
173 template <class T, class Compare>
174 class Heap;
175 
176 // ArcCompactors.
177 
178 template <class Arc>
179 class AcceptorCompactor;
180 
181 template <class Arc>
182 class StringCompactor;
183 
184 template <class Arc>
186 
187 template <class Arc>
188 class UnweightedCompactor;
189 
190 template <class Arc>
192 
193 // Compact Arc FSTs.
194 
195 template <class Arc, class U = uint32_t>
197 
198 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>
207 
208 template <class Arc, class U = uint32_t>
211 
212 // StdArc aliases for FSTs.
213 
219 
220 // StdArc aliases for on-the-fly operations.
221 
222 template <class Compare>
224 
226 
228 
230 
232 
234 
236 
238 
240 
242 
244 
246 
248 
249 // Filter states.
250 
251 template <class T>
252 class IntegerFilterState;
253 
255 
257 
259 
260 // Matchers and filters.
261 
262 template <class FST>
263 class Matcher;
264 
265 template <class Matcher1, class Matcher2 = Matcher1>
266 class NullComposeFilter;
267 
268 template <class Matcher1, class Matcher2 = Matcher1>
270 
271 template <class Matcher1, class Matcher2 = Matcher1>
273 
274 template <class Matcher1, class Matcher2 = Matcher1>
276 
277 template <class Matcher1, class Matcher2 = Matcher1>
278 class MatchComposeFilter;
279 
280 template <class Matcher1, class Matcher2 = Matcher1>
282 
283 } // namespace fst
284 
285 #endif // FST_FST_DECL_H_
ArcTpl< TropicalWeight > StdArc
Definition: arc.h:75
LogWeightTpl< float > LogWeight
Definition: float-weight.h:469
TropicalWeightTpl< float > TropicalWeight
Definition: float-weight.h:268
CompactFst< Arc, CompactArcCompactor< ArcCompactor, Unsigned, CompactStore >, CacheStore > CompactArcFst
Definition: fst-decl.h:97
MinMaxWeightTpl< float > MinMaxWeight
Definition: float-weight.h:910
FloatWeightTpl< float > FloatWeight
Definition: float-weight.h:114
ArcTpl< LogWeight > LogArc
Definition: arc.h:76