FST  openfst-1.7.2
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 
12  const SymbolTable *old_isyms, const SymbolTable *relabel_isyms,
13  const string &unknown_isymbol, bool attach_new_isyms,
14  const SymbolTable *old_osyms, const SymbolTable *relabel_osyms,
15  const string &unknown_osymbol, bool attach_new_osyms) {
16  RelabelArgs1 args(ofst, old_isyms, relabel_isyms, unknown_isymbol,
17  attach_new_isyms, old_osyms, relabel_osyms,
18  unknown_osymbol, attach_new_osyms);
19  Apply<Operation<RelabelArgs1>>("Relabel", ofst->ArcType(), &args);
20 }
21 
22 void Relabel(MutableFstClass *ofst, const std::vector<LabelPair> &ipairs,
23  const std::vector<LabelPair> &opairs) {
24  RelabelArgs2 args(ofst, ipairs, opairs);
25  Apply<Operation<RelabelArgs2>>("Relabel", ofst->ArcType(), &args);
26 }
27 
31 
35 
36 } // namespace script
37 } // namespace fst
const string & ArcType() const final
Definition: fst-class.h:290
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 string &, bool, const SymbolTable *, const SymbolTable *, const string &, bool > RelabelArgs1
Definition: relabel.h:21