OpenFst for .net/C#

Recently I have been writing .net wrapper around OpenFst. I want to be able to OpenFst in .net and managed languages and I often prototype in C# because not only is the less typing but the compile are way faster. The heavy templated in OpenFst can sometime lead to long compilations time.

My approach is create C wrapper function then PInvoke the wrapper in C# to expose to. This have the advantage of managed c++ in that I can use the wrapper with other languages and platforms for example Python and Unix. One disadvantage is the OpenFst.net library will be distributed as two dlls, the native library and the managed wrapper. I’ve found two solutions to enable the library to distributed as a single file. 1) embed the un-managed dll as resource and then at run-time pull out the dll to a temp directory and load the library manually as describe here here. 2) Use mergebin a tool that is included in sqlite.

This entry was posted by Edobashira. Bookmark the permalink.

3 thoughts on “OpenFst for .net/C#”

Leave a Reply

Note: only a member of this blog may post a comment.