FST  openfst-1.7.1
OpenFst Library
map.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/map.h>
7 
8 namespace fst {
9 namespace script {
10 
11 FstClass *Map(const FstClass &ifst, MapType map_type, float delta, double power,
12  const WeightClass &weight) {
13  if (!ifst.WeightTypesMatch(weight, "Map")) return nullptr;
14  MapInnerArgs iargs(ifst, map_type, delta, power, weight);
15  MapArgs args(iargs);
16  Apply<Operation<MapArgs>>("Map", ifst.ArcType(), &args);
17  return args.retval;
18 }
19 
23 
24 } // namespace script
25 } // namespace fst
MapType
Definition: map.h:37
bool WeightTypesMatch(const WeightClass &weight, const string &op_name) const
Definition: fst-class.cc:93
std::tuple< const FstClass &, MapType, float, double, const WeightClass & > MapInnerArgs
Definition: map.h:56
const string & ArcType() const final
Definition: fst-class.h:290
REGISTER_FST_OPERATION(Compress, StdArc, CompressArgs)
void Map(MapArgs *args)
Definition: map.h:61