32 VectorFst<LogArc> *
fst = RandFst<LogArc>(opts);
33 VectorFst<LogArc> fst2(*fst);
36 std::vector<char> info;
38 for (
size_t i = 0;
i < info.size();
i++) {
45 assert(RandEquivalent(fst2, *fst, 5, 0.01,
kaldi::Rand(), 10));
54 for (
int i = 0;
i < 2;
i++) {
57 std::cout <<
"Test OK\n";
void EnsureEpsilonProperty(VectorFst< Arc > *fst)
This function modifies the fst (while maintaining equivalence) in such a way that, after the modification, all states of the FST which have epsilon-arcs entering them, have no non-epsilon arcs entering them, and all states which have epsilon-arcs leaving them, have no non-epsilon arcs leaving them.
For an extended explanation of the framework of which grammar-fsts are a part, please see Support for...
void TestEnsureEpsilonProperty()
void ComputeStateInfo(const VectorFst< Arc > &fst, std::vector< char > *epsilon_info)
This function will set epsilon_info to have size equal to the NumStates() of the FST, containing a logical-or of the enum values kStateHasEpsilonArcsEntering, kStateHasNonEpsilonArcsEntering, kStateHasEpsilonArcsLeaving, and kStateHasNonEpsilonArcsLeaving.
int Rand(struct RandomState *state)