FST  openfst-1.6.1
OpenFst Library
relabel.cc
Go to the documentation of this file.
1 // See www.openfst.org for extensive documentation on this weighted
2 // finite-state transducer library.
3 
4 #include <fst/script/fst-class.h>
5 #include <fst/script/relabel.h>
7 
8 namespace fst {
9 namespace script {
10 
11 // 1
13  const SymbolTable *old_isyms, const SymbolTable *relabel_isyms,
14  const string &unknown_isymbol, bool attach_new_isyms,
15  const SymbolTable *old_osyms, const SymbolTable *relabel_osyms,
16  const string &unknown_osymbol, bool attach_new_osyms) {
17  RelabelArgs1 args(
18  ofst,
19  old_isyms, relabel_isyms, unknown_isymbol, attach_new_isyms,
20  old_osyms, relabel_osyms, unknown_osymbol, attach_new_osyms);
21  Apply<Operation<RelabelArgs1>>("Relabel", ofst->ArcType(), &args);
22 }
23 
24 // 2
25 void Relabel(MutableFstClass *ofst, const std::vector<LabelPair> &ipairs,
26  const std::vector<LabelPair> &opairs) {
27  RelabelArgs2 args(ofst, ipairs, opairs);
28  Apply<Operation<RelabelArgs2>>("Relabel", ofst->ArcType(), &args);
29 }
30 
31 // 3
32 void Relabel(MutableFstClass *fst, const SymbolTable *new_isymbols,
33  const SymbolTable *new_osymbols) {
34  RelabelArgs3 args(fst, new_isymbols, new_osymbols);
35  Apply<Operation<RelabelArgs3>>("Relabel", fst->ArcType(), &args);
36 }
37 
38 // 1
42 
43 // 2
47 
48 // 3
52 
53 } // namespace script
54 } // namespace fst
const string & ArcType() const override
Definition: fst-class.h:289
REGISTER_FST_OPERATION(Compress, StdArc, CompressArgs)
void Relabel(RelabelArgs1 *args)
Definition: relabel.h:27