FST  openfst-1.7.7
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 
7 
8 namespace fst {
9 namespace script {
10 
11 void Relabel(MutableFstClass *ofst, const SymbolTable *old_isyms,
12  const SymbolTable *relabel_isyms,
13  const std::string &unknown_isymbol, bool attach_new_isyms,
14  const SymbolTable *old_osyms, const SymbolTable *relabel_osyms,
15  const std::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 
23  const std::vector<std::pair<int64, int64>> &ipairs,
24  const std::vector<std::pair<int64, int64>> &opairs) {
25  RelabelArgs2 args(ofst, ipairs, opairs);
26  Apply<Operation<RelabelArgs2>>("Relabel", ofst->ArcType(), &args);
27 }
28 
31 
32 } // namespace script
33 } // namespace fst
REGISTER_FST_OPERATION_3ARCS(Compress, CompressArgs)
const std::string & ArcType() const final
Definition: fst-class.h:300
void Relabel(RelabelArgs1 *args)
Definition: relabel.h:25
std::tuple< MutableFstClass *, const SymbolTable *, const SymbolTable *, const std::string &, bool, const SymbolTable *, const SymbolTable *, const std::string &, bool > RelabelArgs1
Definition: relabel.h:22
std::tuple< MutableFstClass *, const std::vector< std::pair< int64, int64 >> &, const std::vector< std::pair< int64, int64 >> & > RelabelArgs2
Definition: relabel.h:34