GRM-SFST  sfst-1.2.1
OpenGrm SFst Library
sfstlib.h
Go to the documentation of this file.
1 // Copyright 2018-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 // See sfst.opengrm.org for documentation of this library for
15 // stochastic finite-state transducers.
16 
17 // SFst is a library for normalizing, sampling, combining, and
18 // approximating stochastic (or probabilistic) finite-state
19 // transducers. These are weighted finite-state transducers,
20 // represented in OpenFst library format, that have the following two
21 // properties:
22 //
23 // 1. normalized: the paths into the future from each state sum to
24 // Weight::One().
25 //
26 // 2. canonical topology:
27 // * the states are sorted by input label
28 // * there may be failure transitions (see phi-labeled transitions) but
29 // * there is at most one such transition per state
30 // * there are no failure-transition (and/or epsilon-transition) cycles
31 // * no assumption is made of general determinism or what transitions must be
32 // present on failure (unlike in a canonical n-gram model).
33 //
34 //
35 // For example, an n-gram model produced by the OpenGrm NGram Library
36 // is a stochastic FST (provided the phi_label is specified to match
37 // the backoff label, typically 0, of the n-gram model), but many
38 // other topologies are possible.
39 //
40 // If the input automaton is a transducer, then unless otherwise
41 // stated, the algorithms here only examine the input labels.
42 //
43 // Computation is done internally with Log64Weight (or sometimes
44 // SignedLog64Weight). Conversion from the input weight type is done
45 // using a fst::WeightConvert functor, pre-defined for common
46 // weight types like TropicalWeight and LogWeight.
47 
48 // This convenience file includes all other SFST header files.
49 
50 #ifndef NLP_GRM2_SFST_SFSTLIB_H_
51 #define NLP_GRM2_SFST_SFSTLIB_H_
52 
53 #include <sfst/equal.h>
54 #include <sfst/sfst.h>
55 
56 #endif // NLP_GRM2_SFST_SFSTLIB_H_