Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/bin/align-text.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@ bool IsNotToken(const std::string &token) {
return ! kaldi::IsToken(token);
}

int main(int argc, char *argv[]) {
using namespace kaldi;
typedef kaldi::int32 int32;
namespace kaldi {

int main(int argc, char *argv[]) {
try {
const char *usage =
"Computes alignment between two sentences with the same key in the\n"
Expand Down Expand Up @@ -133,3 +132,10 @@ int main(int argc, char *argv[]) {
return -1;
}
}

} //namespace kaldi


int main(int argc, char *argv[]) {
return kaldi::main(argc, argv);
}
7 changes: 6 additions & 1 deletion src/bin/extract-ctx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "tree/build-tree-questions.h"
#include "fst/fstlib.h"

using namespace kaldi;
namespace kaldi {

using std::vector;

Expand Down Expand Up @@ -212,4 +212,9 @@ int main(int argc, char *argv[]) {
}
}

} //namespace kaldi


int main(int argc, char *argv[]) {
return kaldi::main(argc, argv);
}
9 changes: 7 additions & 2 deletions src/bin/phones-to-prons.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include "fst/fstlib.h"
#include "fstext/fstext-lib.h"

namespace kaldi {

// Create FST that accepts the phone sequence, with any number
// of word-start and word-end symbol in between each phone.
void CreatePhonesAltFst(const std::vector<int32> &phones,
Expand Down Expand Up @@ -60,10 +62,8 @@ void CreatePhonesAltFst(const std::vector<int32> &phones,
}

int main(int argc, char *argv[]) {
using namespace kaldi;
using fst::VectorFst;
using fst::StdArc;
typedef kaldi::int32 int32;
try {
const char *usage =
"Convert pairs of (phone-level, word-level) transcriptions to\n"
Expand Down Expand Up @@ -220,4 +220,9 @@ int main(int argc, char *argv[]) {
}
}

} //namespace kaldi


int main(int argc, char *argv[]) {
return kaldi::main(argc, argv);
}
11 changes: 8 additions & 3 deletions src/bin/post-to-phone-post.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@
#include "hmm/transition-model.h"
#include "hmm/posterior.h"

namespace kaldi {

int main(int argc, char *argv[]) {
try {
using namespace kaldi;
typedef kaldi::int32 int32;

const char *usage =
"Convert posteriors to phone-level posteriors\n"
"See also: post-to-pdf-post, post-to-weights, get-post-on-ali\n"
Expand Down Expand Up @@ -75,3 +74,9 @@ int main(int argc, char *argv[]) {
}
}

} //namespace kaldi


int main(int argc, char *argv[]) {
return kaldi::main(argc, argv);
}
9 changes: 6 additions & 3 deletions src/gmmbin/gmm-decode-nbest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include "lat/kaldi-lattice.h" // for CompactLatticeArc
#include "fstext/lattice-utils.h" // for ConvertLattice

using namespace kaldi;
namespace kaldi {

fst::Fst<fst::StdArc> *ReadNetwork(std::string filename) {
// read decoding network FST
Expand Down Expand Up @@ -67,8 +67,6 @@ fst::Fst<fst::StdArc> *ReadNetwork(std::string filename) {

int main(int argc, char *argv[]) {
try {
typedef kaldi::int32 int32;

const char *usage =
"Decode features using GMM-based model, producing N-best lattice output.\n"
"Note: this program was mainly intended to validate the lattice generation\n"
Expand Down Expand Up @@ -245,4 +243,9 @@ int main(int argc, char *argv[]) {
}
}

} //namespace kaldi


int main(int argc, char *argv[]) {
return kaldi::main(argc, argv);
}
16 changes: 8 additions & 8 deletions src/kwsbin/generate-proxy-keywords.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
// See the Apache 2 License for the specific language governing permissions and
// limitations under the License.


#include "base/kaldi-common.h"
#include "util/common-utils.h"
#include "fstext/fstext-utils.h"
Expand Down Expand Up @@ -53,15 +52,16 @@ bool PrintProxyFstPath(const VectorFst<StdArc> &proxy,
}
}

using namespace fst;
using kaldi::int32;
using kaldi::uint64;
using kaldi::BasicVectorHolder;
using kaldi::ParseOptions;
using kaldi::SequentialInt32VectorReader;
using kaldi::TableWriter;

int main(int argc, char *argv[]) {
try {
using namespace kaldi;
using namespace fst;
typedef kaldi::int32 int32;
typedef kaldi::uint64 uint64;
typedef StdArc::StateId StateId;
typedef StdArc::Weight Weight;

const char *usage =
"Convert the keywords into in-vocabulary words using the given phone\n"
"level edit distance fst (E.fst). The large lexicon (L2.fst) and\n"
Expand Down
14 changes: 9 additions & 5 deletions src/kwsbin/kws-index-union.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,17 @@
#include "lat/kaldi-kws.h"
#include "lat/kws-functions.h"

using namespace fst;
using kaldi::int32;
using kaldi::uint64;
using kaldi::KwsLexicographicArc;
using kaldi::KwsLexicographicFst;
using kaldi::ParseOptions;
using kaldi::SequentialTableReader;
using kaldi::TableWriter;

int main(int argc, char *argv[]) {
try {
using namespace kaldi;
using namespace fst;
typedef kaldi::int32 int32;
typedef kaldi::uint64 uint64;

const char *usage =
"Take a union of the indexed lattices. The input index is in the T*T*T semiring and\n"
"the output index is also in the T*T*T semiring. At the end of this program, encoded\n"
Expand Down
26 changes: 17 additions & 9 deletions src/kwsbin/kws-search.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,25 @@ class VectorFstToKwsLexicographicFstMapper {

}

using namespace fst;
using kaldi::int32;
using kaldi::uint64;
using kaldi::BasicVectorHolder;
using kaldi::DecodeLabelUid;
using kaldi::EncodeLabel;
using kaldi::KwsLexicographicArc;
using kaldi::KwsLexicographicFst;
using kaldi::ParseOptions;
using kaldi::RandomAccessTableReader;
using kaldi::SequentialTableReader;
using kaldi::TableWriter;
using kaldi::VectorFstToKwsLexicographicFstMapper;

int main(int argc, char *argv[]) {
typedef KwsLexicographicArc Arc;
typedef Arc::Weight Weight;
typedef Arc::StateId StateId;
try {
using namespace kaldi;
using namespace fst;
typedef kaldi::int32 int32;
typedef kaldi::uint32 uint32;
typedef kaldi::uint64 uint64;
typedef KwsLexicographicArc Arc;
typedef Arc::Weight Weight;
typedef Arc::StateId StateId;

const char *usage =
"Search the keywords over the index. This program can be executed parallely, either\n"
"on the index side or the keywords side; we use a script to combine the final search\n"
Expand Down
29 changes: 24 additions & 5 deletions src/kwsbin/lattice-to-kws-index.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,32 @@
#include "lat/kws-functions.h"
#include "fstext/epsilon-property.h"

using fst::VectorFst;
using kaldi::int32;
using kaldi::uint64;
using kaldi::BaseFloat;
using kaldi::ClusterLattice;
using kaldi::CompactLattice;
using kaldi::CompactLatticeStateTimes;
using kaldi::CompactLatticeStateTimes;
using kaldi::CreateFactorTransducer;
using kaldi::DoFactorDisambiguation;
using kaldi::DoFactorMerging;
using kaldi::KwsLexicographicArc;
using kaldi::KwsLexicographicFst;
using kaldi::KwsProductFst;
using kaldi::MaybeDoSanityCheck;
using kaldi::OptimizeFactorTransducer;
using kaldi::ParseOptions;
using kaldi::RandomAccessInt32Reader;
using kaldi::RandomAccessTableReader;
using kaldi::RemoveLongSilences;
using kaldi::SequentialCompactLatticeReader;
using kaldi::SequentialTableReader;
using kaldi::TableWriter;

int main(int argc, char *argv[]) {
try {
using namespace kaldi;
using fst::VectorFst;
typedef kaldi::int32 int32;
typedef kaldi::uint64 uint64;

const char *usage =
"Create an inverted index of the given lattices. The output index is in the T*T*T\n"
"semiring. For details for the semiring, please refer to Dogan Can and Muran Saraclar's"
Expand Down
12 changes: 9 additions & 3 deletions src/latbin/lattice-add-trans-probs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@
#include "hmm/transition-model.h"
#include "hmm/hmm-utils.h"

namespace kaldi {

int main(int argc, char *argv[]) {
try {
using namespace kaldi;
typedef kaldi::int32 int32;
typedef kaldi::int64 int64;
using fst::SymbolTable;
using fst::VectorFst;
using fst::StdArc;
Expand Down Expand Up @@ -90,3 +89,10 @@ int main(int argc, char *argv[]) {
return -1;
}
}

} //namespace kaldi


int main(int argc, char *argv[]) {
return kaldi::main(argc, argv);
}
12 changes: 9 additions & 3 deletions src/latbin/lattice-arcgraph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include "lat/kaldi-lattice.h"
#include "hmm/transition-model.h"

namespace kaldi {

typedef fst::StdArc::StateId StateId;
typedef fst::StdArc::Weight Weight;
typedef fst::StdArc::Label Label;
Expand Down Expand Up @@ -135,9 +137,6 @@ void MapTransitionIdsToTransitionStates(kaldi::CompactLattice *lat,

int main(int argc, char *argv[]) {
try {
using namespace kaldi;
typedef kaldi::int32 int32;
typedef kaldi::int64 int64;
using fst::SymbolTable;
using fst::VectorFst;
using fst::StdArc;
Expand Down Expand Up @@ -263,3 +262,10 @@ int main(int argc, char *argv[]) {
return -1;
}
}

} //namespace kaldi


int main(int argc, char *argv[]) {
return kaldi::main(argc, argv);
}
12 changes: 9 additions & 3 deletions src/latbin/lattice-compose.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@
#include "fstext/fstext-lib.h"
#include "lat/kaldi-lattice.h"

namespace kaldi {

int main(int argc, char *argv[]) {
try {
using namespace kaldi;
typedef kaldi::int32 int32;
typedef kaldi::int64 int64;
using fst::SymbolTable;
using fst::VectorFst;
using fst::StdArc;
Expand Down Expand Up @@ -164,3 +163,10 @@ int main(int argc, char *argv[]) {
return -1;
}
}

} //namespace kaldi


int main(int argc, char *argv[]) {
return kaldi::main(argc, argv);
}
12 changes: 9 additions & 3 deletions src/latbin/lattice-determinize-pruned.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@
#include "lat/push-lattice.h"
#include "lat/minimize-lattice.h"

namespace kaldi {

int main(int argc, char *argv[]) {
try {
using namespace kaldi;
typedef kaldi::int32 int32;

const char *usage =
"Determinize lattices, keeping only the best path (sequence of acoustic states)\n"
"for each input-symbol sequence. This version does pruning as part of the\n"
Expand Down Expand Up @@ -117,3 +116,10 @@ int main(int argc, char *argv[]) {
return -1;
}
}

} //namespace kaldi


int main(int argc, char *argv[]) {
return kaldi::main(argc, argv);
}
12 changes: 9 additions & 3 deletions src/latbin/lattice-interp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@
#include "fstext/fstext-lib.h"
#include "lat/kaldi-lattice.h"

namespace kaldi {

int main(int argc, char *argv[]) {
try {
using namespace kaldi;
typedef kaldi::int32 int32;
typedef kaldi::int64 int64;
using fst::SymbolTable;
using fst::VectorFst;
using fst::StdArc;
Expand Down Expand Up @@ -111,3 +110,10 @@ int main(int argc, char *argv[]) {
return -1;
}
}

} //namespace kaldi


int main(int argc, char *argv[]) {
return kaldi::main(argc, argv);
}
Loading