44 std::vector<CompactLattice*> lat_vec(N);
45 for (
int i = 0;
i < N;
i++) {
49 std::string key =
"key" + std::string(buf);
52 writer.
Write(key, *fst);
57 for (
int i = 0;
i < N;
i++) {
61 std::string key =
"key" + std::string(buf);
72 std::vector<CompactLattice*> lat_vec(N);
73 for (
int i = 0;
i < N;
i++) {
77 std::string key =
"key" + std::string(buf);
80 writer.
Write(key, *fst);
85 for (
int i = 0;
i < N;
i++) {
89 std::string key =
"key" + std::string(buf);
102 std::vector<Lattice*> lat_vec(N);
103 for (
int i = 0;
i < N;
i++) {
107 std::string key =
"key" + std::string(buf);
110 writer.
Write(key, *fst);
115 for (
int i = 0;
i < N;
i++) {
119 std::string key =
"key" + std::string(buf);
131 std::vector<Lattice*> lat_vec(N);
132 for (
int i = 0;
i < N;
i++) {
136 std::string key =
"key" + std::string(buf);
139 writer.
Write(key, *fst);
144 for (
int i = 0;
i < N;
i++) {
148 std::string key =
"key" + std::string(buf);
162 using namespace kaldi;
163 for (
int i = 0;
i < 2;
i++) {
164 bool binary = (
i%2 == 0);
170 std::cout <<
"Test OK\n";
This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for...
For an extended explanation of the framework of which grammar-fsts are a part, please see Support for...
CompactLattice * RandCompactLattice()
A templated class for writing objects to an archive or script file; see The Table concept...
void Write(const std::string &key, const T &value) const
void TestLatticeTableCross(bool binary)
Allows random access to a collection of objects in an archive or script file; see The Table concept...
const T & Value(const std::string &key)
void ConvertLattice(const ExpandedFst< ArcTpl< Weight > > &ifst, MutableFst< ArcTpl< CompactLatticeWeightTpl< Weight, Int > > > *ofst, bool invert)
Convert lattice from a normal FST to a CompactLattice FST.
fst::VectorFst< LatticeArc > Lattice
int Rand(struct RandomState *state)
fst::VectorFst< CompactLatticeArc > CompactLattice
void TestCompactLatticeTableCross(bool binary)
void TestCompactLatticeTable(bool binary)
#define KALDI_ASSERT(cond)
void TestLatticeTable(bool binary)