// See www.openfst.org for extensive documentation on this weighted // finite-state transducer library. #include #include #include #include namespace fst { namespace script { void Encode(MutableFstClass *fst, uint32 flags, bool reuse_encoder, const string &coder_fname) { EncodeArgs1 args(fst, flags, reuse_encoder, coder_fname); Apply>("Encode", fst->ArcType(), &args); } void Encode(MutableFstClass *fst, EncodeMapperClass *encoder) { if (!internal::ArcTypesMatch(*fst, *encoder, "Encode")) { fst->SetProperties(kError, kError); return; } EncodeArgs2 args(fst, encoder); Apply>("Encode", fst->ArcType(), &args); } REGISTER_FST_OPERATION(Encode, StdArc, EncodeArgs1); REGISTER_FST_OPERATION(Encode, LogArc, EncodeArgs1); REGISTER_FST_OPERATION(Encode, Log64Arc, EncodeArgs1); REGISTER_FST_OPERATION(Encode, StdArc, EncodeArgs2); REGISTER_FST_OPERATION(Encode, LogArc, EncodeArgs2); REGISTER_FST_OPERATION(Encode, Log64Arc, EncodeArgs2); } // namespace script } // namespace fst