FST  openfst-1.7.3
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/relabel.h>
5 
6 #include <fst/script/fst-class.h>
8 
9 namespace fst {
10 namespace script {
11 
12 void Relabel(MutableFstClass *ofst, const SymbolTable *old_isyms,
13  const SymbolTable *relabel_isyms,
14  const std::string &unknown_isymbol, bool attach_new_isyms,
15  const SymbolTable *old_osyms, const SymbolTable *relabel_osyms,
16  const std::string &unknown_osymbol, bool attach_new_osyms) {
17  RelabelArgs1 args(ofst, old_isyms, relabel_isyms, unknown_isymbol,
18  attach_new_isyms, old_osyms, relabel_osyms,
19  unknown_osymbol, attach_new_osyms);
20  Apply<Operation<RelabelArgs1>>("Relabel", ofst->ArcType(), &args);
21 }
22 
23 void Relabel(MutableFstClass *ofst, const std::vector<LabelPair> &ipairs,
24  const std::vector<LabelPair> &opairs) {
25  RelabelArgs2 args(ofst, ipairs, opairs);
26  Apply<Operation<RelabelArgs2>>("Relabel", ofst->ArcType(), &args);
27 }
28 
32 
36 
37 } // namespace script
38 } // namespace fst
const std::string & ArcType() const final
Definition: fst-class.h:298
REGISTER_FST_OPERATION(Compress, StdArc, CompressArgs)
std::tuple< MutableFstClass *, const std::vector< LabelPair > &, const std::vector< LabelPair > & > RelabelArgs2
Definition: relabel.h:35
void Relabel(RelabelArgs1 *args)
Definition: relabel.h:24
std::tuple< MutableFstClass *, const SymbolTable *, const SymbolTable *, const std::string &, bool, const SymbolTable *, const SymbolTable *, const std::string &, bool > RelabelArgs1
Definition: relabel.h:21