AdolfVonKleist / Phonetisaurus

Phonetisaurus G2P
BSD 3-Clause "New" or "Revised" License
449 stars 122 forks source link

C++ project embed #74

Open no-execution opened 2 years ago

no-execution commented 2 years ago

Thanks for your work.

I want to embed your g2p tool in my c++ project, and I attempt to use Phonetisaurus.so directly to build my project but failed.

Do you have some advice to make this tool a library that can be used directly?

Thank you !

seanghay commented 10 months ago

Just made this for easy installation. Just run pip install sosap https://github.com/seanghay/sosap

jpetso commented 10 months ago

I've previously integrated it into a pure C++ codebase. What I did was to take just PhonetisaurusRex.h and PhonetisaurusScript.h, adapt the latter to our needs (like adding a constructor for loading from memory, std:: prefixes to avoid using namespace std;, better conversion to linear probability values) and link just against OpenFst.

Too bad I don't have access to the source code anymore. Should have upstreamed it when I had the chance. Sorry.