BaumWelch  baumwelch-0.3.8
OpenGrm-BaumWelch library
decodescript.h
Go to the documentation of this file.
1 // Licensed under the Apache License, Version 2.0 (the "License");
2 // you may not use this file except in compliance with the License.
3 // You may obtain a copy of the License at
4 //
5 // http://www.apache.org/licenses/LICENSE-2.0
6 //
7 // Unless required by applicable law or agreed to in writing, software
8 // distributed under the License is distributed on an "AS IS" BASIS,
9 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 // See the License for the specific language governing permissions and
11 // limitations under the License.
12 //
13 // Copyright 2017 and onwards Google, Inc.
14 
15 #ifndef NLP_GRM2_BAUMWELCH_DECODESCRIPT_H_
16 #define NLP_GRM2_BAUMWELCH_DECODESCRIPT_H_
17 
18 #include <tuple>
19 
20 #include <fst/extensions/far/far-class.h>
21 #include <fst/extensions/far/far.h>
22 #include <fst/fst.h>
23 #include <fst/script/fst-class.h>
24 #include <baumwelch/decode.h>
25 
26 namespace fst {
27 namespace script {
28 
29 using BaumWelchDecodeArgs = std::tuple<FarReaderClass &, FarReaderClass &,
30  const FstClass &, FarWriterClass &>;
31 
32 template <class Arc>
34  FarReader<Arc> &input = *std::get<0>(*args).GetFarReader<Arc>();
35  FarReader<Arc> &output = *std::get<1>(*args).GetFarReader<Arc>();
36  const Fst<Arc> &model = *std::get<2>(*args).GetFst<Arc>();
37  FarWriter<Arc> &hypotext = *std::get<3>(*args).GetFarWriter<Arc>();
38  Decode(input, output, model, hypotext);
39 }
40 
41 void Decode(FarReaderClass &input, FarReaderClass &output,
42  const FstClass &model, FarWriterClass &hypotext);
43 
44 } // namespace script
45 } // namespace fst
46 
47 #endif // NLP_GRM2_BAUMWELCH_DECODESCRIPT_H_
48 
Definition: a-star.h:30
void Decode(BaumWelchDecodeArgs *args)
Definition: decodescript.h:33
std::tuple< FarReaderClass &, FarReaderClass &, const FstClass &, FarWriterClass & > BaumWelchDecodeArgs
Definition: decodescript.h:30