FST  openfst-1.8.3
OpenFst Library
fstlinear-main.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 // See www.openfst.org for extensive documentation on this weighted
16 // finite-state transducer library.
17 
18 #include <fst/flags.h>
20 
21 DECLARE_string(arc_type);
22 DECLARE_string(epsilon_symbol);
23 DECLARE_string(unknown_symbol);
24 DECLARE_string(vocab);
25 DECLARE_string(out);
26 DECLARE_string(save_isymbols);
27 DECLARE_string(save_fsymbols);
28 DECLARE_string(save_osymbols);
29 
30 int fstlinear_main(int argc, char **argv) {
31  // TODO(wuke): more detailed usage
32  SET_FLAGS(argv[0], &argc, &argv, true);
35 
36  if (argc == 1) {
37  ShowUsage();
38  return 1;
39  }
40 
42  FST_FLAGS_arc_type, FST_FLAGS_epsilon_symbol,
43  FST_FLAGS_unknown_symbol, FST_FLAGS_vocab, argv + 1,
44  argc - 1, FST_FLAGS_out, FST_FLAGS_save_isymbols,
45  FST_FLAGS_save_fsymbols, FST_FLAGS_save_osymbols);
46 
47  return 0;
48 }
void ShowUsage(bool long_usage=true)
Definition: flags.cc:138
#define SET_FLAGS(usage, argc, argv, rmflags)
Definition: flags.h:226
bool ValidateEmptySymbol()
Definition: linearscript.cc:59
void LinearCompile(const std::string &arc_type, const std::string &epsilon_symbol, const std::string &unknown_symbol, const std::string &vocab, char **models, int models_len, const std::string &out, const std::string &save_isymbols, const std::string &save_fsymbols, const std::string &save_osymbols)
Definition: linearscript.cc:68
int fstlinear_main(int argc, char **argv)
DECLARE_string(arc_type)
bool ValidateDelimiter()
Definition: linearscript.cc:54