Skip to content

Commit 5ccce55

Browse files
georgthegreatjtrmal
authored andcommitted
Support openfst-1.8.1
1 parent e460d8a commit 5ccce55

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

src/fstext/kaldi-fst-io-inl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ void ReadFstKaldi(std::istream &is, bool binary,
9999
fst->DeleteStates();
100100
string line;
101101
size_t nline = 0;
102-
string separator = FLAGS_fst_field_separator + "\r\n";
102+
string separator = FST_FLAGS_fst_field_separator + "\r\n";
103103
while (std::getline(is, line)) {
104104
nline++;
105105
vector<string> col;

src/fstext/lattice-weight.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -396,18 +396,18 @@ inline bool ApproxEqual(const LatticeWeightTpl<FloatType> &w1,
396396
template <class FloatType>
397397
inline std::ostream &operator <<(std::ostream &strm, const LatticeWeightTpl<FloatType> &w) {
398398
LatticeWeightTpl<FloatType>::WriteFloatType(strm, w.Value1());
399-
CHECK(FLAGS_fst_weight_separator.size() == 1);
400-
strm << FLAGS_fst_weight_separator[0]; // comma by default;
399+
CHECK(FST_FLAGS_fst_weight_separator.size() == 1);
400+
strm << FST_FLAGS_fst_weight_separator[0]; // comma by default;
401401
// may or may not be settable from Kaldi programs.
402402
LatticeWeightTpl<FloatType>::WriteFloatType(strm, w.Value2());
403403
return strm;
404404
}
405405

406406
template <class FloatType>
407407
inline std::istream &operator >>(std::istream &strm, LatticeWeightTpl<FloatType> &w1) {
408-
CHECK(FLAGS_fst_weight_separator.size() == 1);
408+
CHECK(FST_FLAGS_fst_weight_separator.size() == 1);
409409
// separator defaults to ','
410-
return w1.ReadNoParen(strm, FLAGS_fst_weight_separator[0]);
410+
return w1.ReadNoParen(strm, FST_FLAGS_fst_weight_separator[0]);
411411
}
412412

413413

@@ -726,8 +726,8 @@ inline CompactLatticeWeightTpl<WeightType, IntType> Divide(const CompactLatticeW
726726
template <class WeightType, class IntType>
727727
inline std::ostream &operator <<(std::ostream &strm, const CompactLatticeWeightTpl<WeightType, IntType> &w) {
728728
strm << w.Weight();
729-
CHECK(FLAGS_fst_weight_separator.size() == 1);
730-
strm << FLAGS_fst_weight_separator[0]; // comma by default.
729+
CHECK(FST_FLAGS_fst_weight_separator.size() == 1);
730+
strm << FST_FLAGS_fst_weight_separator[0]; // comma by default.
731731
for(size_t i = 0; i < w.String().size(); i++) {
732732
strm << w.String()[i];
733733
if (i+1 < w.String().size())
@@ -743,8 +743,8 @@ inline std::istream &operator >>(std::istream &strm, CompactLatticeWeightTpl<Wei
743743
if (strm.fail()) {
744744
return strm;
745745
}
746-
CHECK(FLAGS_fst_weight_separator.size() == 1);
747-
size_t pos = s.find_last_of(FLAGS_fst_weight_separator); // normally ","
746+
CHECK(FST_FLAGS_fst_weight_separator.size() == 1);
747+
size_t pos = s.find_last_of(FST_FLAGS_fst_weight_separator); // normally ","
748748
if (pos == std::string::npos) {
749749
strm.clear(std::ios::badbit);
750750
return strm;

src/lat/kaldi-lattice.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class LatticeReader {
114114
CompactLattice *cfst = new CompactLattice();
115115
string line;
116116
size_t nline = 0;
117-
string separator = FLAGS_fst_field_separator + "\r\n";
117+
string separator = FST_FLAGS_fst_field_separator + "\r\n";
118118
while (std::getline(is, line)) {
119119
nline++;
120120
vector<string> col;

src/lat/lattice-functions-transition-model.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,13 +248,13 @@ bool TestWordAlignedLattice(const WordAlignLatticeLexiconInfo &lexicon_info,
248248
int32 num_paths = 5, seed = Rand(), max_path_length = -1;
249249
BaseFloat delta = 0.2; // some lattices have large costs -> use large delta.
250250

251-
FLAGS_v = GetVerboseLevel(); // set the OpenFst verbose level to the Kaldi
251+
FST_FLAGS_v = GetVerboseLevel(); // set the OpenFst verbose level to the Kaldi
252252
// verbose level.
253253
if (!RandEquivalent(clat, aligned_clat, num_paths, delta, seed, max_path_length)) {
254254
KALDI_WARN << "Equivalence test failed during lattice alignment.";
255255
return false;
256256
}
257-
FLAGS_v = 0;
257+
FST_FLAGS_v = 0;
258258

259259
return (num_err == 0);
260260
}

0 commit comments

Comments
 (0)