安装sequitor g2p转换器时出错

时间:2016-02-08 05:42:49

标签: python

我想安装sequitor g2p数据驱动的字形到音素转换器

在构建sequitor-g2p时出错

我发出命令$ python setup.py install --prefix /usr/local/

收到错误如下:

Utility.cc:43:21: error: ‘EOF’ was not declared in this scope
     if (is.get() == EOF) return EOF;
                     ^
Utility.cc:48:35: error: ‘EOF’ was not declared in this scope
     while (((token = is.get()) != EOF) &&
                                   ^
error: command 'i686-linux-gnu-gcc' failed with exit status 1

提前感谢。

1 个答案:

答案 0 :(得分:2)

另见fcgio.cpp:50: error: 'EOF' was not declared in this scope

最简单的选择是添加

#include <stdio.h>

到Utility.cc。

您可以自动执行此操作,例如使用提供的链接中的patch或使用sed

wget http://www-i6.informatik.rwth-aachen.de/web/Software/g2p-r1668.tar.gz
tar xvf  g2p-r1668.tar.gz
rm -r g2p-r1668.tar.gz
cd g2p

sed -i "27 a #include <stdio.h>" Utility.cc 
python setup.py install --prefix  /usr/local