FST  openfst-1.6.1
OpenFst Library
shortest-distance.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>
7 
8 namespace fst {
9 namespace script {
10 
11 // 1
12 void ShortestDistance(const FstClass &fst, std::vector<WeightClass> *distance,
13  const ShortestDistanceOptions &opts) {
14  ShortestDistanceArgs1 args(fst, distance, opts);
15  Apply<Operation<ShortestDistanceArgs1>>("ShortestDistance", fst.ArcType(),
16  &args);
17 }
18 
19 // 2
20 void ShortestDistance(const FstClass &ifst, std::vector<WeightClass> *distance,
21  bool reverse, double delta) {
22  ShortestDistanceArgs2 args(ifst, distance, reverse, delta);
23  Apply<Operation<ShortestDistanceArgs2>>("ShortestDistance", ifst.ArcType(),
24  &args);
25 }
26 
30 
34 
35 } // namespace script
36 } // namespace fst
const string & ArcType() const override
Definition: fst-class.h:289
REGISTER_FST_OPERATION(Compress, StdArc, CompressArgs)
void ShortestDistance(ShortestDistanceArgs1 *args)