Phonetisaurus
Phonetisaurus是用于做g2p(grapheme to phoneme)的工具,它的源码地址在这里。
编译
它的编译依赖openfst,在编译openfst时,如果不指定构建路径在系统路径下,生成的include和lib可能就无法被直接引用到。所以在编译Phonetisaurus时,特别是在configure步骤,会提示依赖的openfst找不到。
checking for openfst libraries...
configure: error: Can't find OpenFST or one or more of its extensions.
Use --with-openfst-includes and --with-openfst-libs to specify where you have installed OpenFst.
OpenFst should have been configured with the following flags:
--enable-static --enable-shared --enable-far --enable-ngram-fsts
起始这里的报错信息说的已经很明显了,需要注意两点
- 在编译openfst时,一定要在configure时加上==–enable-static --enable-shared --enable-far --enable-ngram-fsts==这些参数
- 如果openfst不是build在系统路径下,那么在编译Phonetisaurus时,通过 --with-openfst-includes和 --with-openfst-libs可以显示地指定openfst的头文件和库文件的位置,从而在configure可以找到他们。
比如,openfst构建位置在/home/xxx/openfst/build下,那么需要指定 --with-openfst-includes=/home/xxx/openfst/build/include --with-openfst-libs=/home/xxx/openfst/build/lib即可。