BaumWelch  baumwelch-0.3.8
OpenGrm-BaumWelch library
decodescript.cc
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 #include <baumwelch/decodescript.h>
16 
17 #include <fst/extensions/far/far-class.h>
18 #include <fst/script/fst-class.h>
19 #include <fst/script/script-impl.h>
20 
21 namespace fst {
22 namespace script {
23 
24 void Decode(FarReaderClass &input, FarReaderClass &output,
25  const FstClass &model, FarWriterClass &hypotext) {
26  if (!internal::ArcTypesMatch(input, model, "Decode") ||
27  !internal::ArcTypesMatch(output, model, "Decode") ||
28  !internal::ArcTypesMatch(hypotext, model, "Decode")) {
29  return;
30  }
31  BaumWelchDecodeArgs args{input, output, model, hypotext};
32  Apply<Operation<BaumWelchDecodeArgs>>("Decode", model.ArcType(), &args);
33 }
34 
36 
37 } // namespace script
38 } // namespace fst
39 
Definition: a-star.h:30
REGISTER_FST_OPERATION_3ARCS(Decode, BaumWelchDecodeArgs)
void Decode(BaumWelchDecodeArgs *args)
Definition: decodescript.h:33
std::tuple< FarReaderClass &, FarReaderClass &, const FstClass &, FarWriterClass & > BaumWelchDecodeArgs
Definition: decodescript.h:30