Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Shim code to create shared object o register Kaldi lattice with OpenFst command line tools
//Compile something like (assumes the Kaldi/OpenFst headers are on the include path)
// g++ -g -o \
// -shared -I/path/to/kaldi/src -DHAVE_ATLAS -fPIC
//Add the dir containing to the LD_LIBRARY_PATH
#include <fst/const-fst.h>
#include <fst/edit-fst.h>
#include <fst/vector-fst.h>
#include <fst/script/register.h>
#include <fst/script/fstscript.h>
#include <lat/kaldi-lattice.h>
using namespace fst;
using kaldi::LatticeArc;
namespace fst {
namespace script {
REGISTER_FST(VectorFst, LatticeArc);
REGISTER_FST(ConstFst, LatticeArc);
REGISTER_FST(EditFst, LatticeArc);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment