Created
August 10, 2012 05:39
-
-
Save edobashira/3311387 to your computer and use it in GitHub Desktop.
Shim code to create shared object o register Kaldi lattice with OpenFst command line tools
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Compile something like (assumes the Kaldi/OpenFst headers are on the include path) | |
// g++ -g kaldi-arc.cc -o lattice4-arc.so \ | |
// -shared -I/path/to/kaldi/src -DHAVE_ATLAS -fPIC | |
//Add the dir containing lattice4-arc.so 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); | |
REGISTER_FST_CLASSES(LatticeArc); | |
REGISTER_FST_OPERATIONS(LatticeArc); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment