FST  openfst-1.8.3
OpenFst Library
fstrandgen.cc
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 #include <cstdint>
16 #include <limits>
17 
18 #include <fst/flags.h>
19 #include <fst/script/getters.h>
20 
21 DEFINE_int32(max_length, std::numeric_limits<int32_t>::max(),
22  "Maximum path length");
23 DEFINE_int32(npath, 1, "Number of paths to generate");
24 DEFINE_uint64(seed, ::fst::script::kDefaultSeed, "Random seed");
25 DEFINE_string(select, "uniform",
26  "Selection type: one of "
27  " \"uniform\", \"log_prob\" (when appropriate),"
28  " \"fast_log_prob\" (when appropriate)");
29 DEFINE_bool(weighted, false,
30  "Output tree weighted by path count vs. unweighted paths");
31 DEFINE_bool(remove_total_weight, false,
32  "Remove total weight when output weighted");
33 
34 int fstrandgen_main(int argc, char **argv);
35 
36 int main(int argc, char **argv) { return fstrandgen_main(argc, argv); }
int fstrandgen_main(int argc, char **argv)
constexpr uint64_t kDefaultSeed
Definition: getters.h:49
DEFINE_string(select,"uniform","Selection type: one of "" \"uniform\", \"log_prob\" (when appropriate),"" \"fast_log_prob\" (when appropriate)")
DEFINE_bool(weighted, false,"Output tree weighted by path count vs. unweighted paths")
int main(int argc, char **argv)
Definition: fstrandgen.cc:36
DEFINE_uint64(seed,::fst::script::kDefaultSeed,"Random seed")
DEFINE_int32(max_length, std::numeric_limits< int32_t >::max(),"Maximum path length")