Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/341.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在python中使用FST库_Python_Nlp_State Machine_Openfst_Fst - Fatal编程技术网

在python中使用FST库

在python中使用FST库,python,nlp,state-machine,openfst,fst,Python,Nlp,State Machine,Openfst,Fst,如何安装? 我一直在这样做: wget http://www.openfst.org/twiki/pub/FST/FstDownload/openfst-1.4.1.tar.gz tar -zxvf openfst-1.4.1.tar.gz cd openfst-1.4.1 ./configure make make install 还有其他安装方法吗? 实际上,我最终想要的是在python中使用OpenFST,我一直在使用这个包装器: 安装OpenFST之后,在安装pyfst时,我遇到了以下

如何安装?

我一直在这样做:

wget http://www.openfst.org/twiki/pub/FST/FstDownload/openfst-1.4.1.tar.gz
tar -zxvf openfst-1.4.1.tar.gz
cd openfst-1.4.1
./configure
make
make install
还有其他安装方法吗?

实际上,我最终想要的是在python中使用OpenFST,我一直在使用这个包装器:

安装
OpenFST
之后,在安装
pyfst
时,我遇到了以下问题。有人知道如何解决这个问题吗

$ sudo pip install pyfst
 ....

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/pyfst/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-O7BSyr-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/pyfst
Traceback (most recent call last):
  File "/usr/local/bin/pip", line 9, in <module>
    load_entry_point('pip==1.5.5', 'console_scripts', 'pip')()
  File "/usr/local/lib/python2.7/dist-packages/pip-1.5.5-py2.7.egg/pip/__init__.py", line 185, in main
    return command.main(cmd_args)
  File "/usr/local/lib/python2.7/dist-packages/pip-1.5.5-py2.7.egg/pip/basecommand.py", line 161, in main
    text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 42: ordinal not in range(128)
$sudo pip安装pyfst
....
错误:命令“x86_64-linux-gnu-gcc”失败,退出状态为1
----------------------------------------
清理。。。
Command/usr/bin/python-c“导入setuptools,tokenize;_文件_=”/tmp/pip_构建_根/pyfst/setup.py';exec(compile(getattr(tokenize,'open',open)(__u文件__u)。read().replace('\r\n','\n'),_u文件‘,'exec'))”安装--record/tmp/pip-O7BSyr-record/install-record.txt--外部管理的单一版本--编译失败,错误代码为/tmp/pip_build_root/pyfst中的1
回溯(最近一次呼叫最后一次):
文件“/usr/local/bin/pip”,第9行,在
加载入口点('pip==1.5.5','console脚本','pip')()
文件“/usr/local/lib/python2.7/dist-packages/pip-1.5.5-py2.7.egg/pip/_-init___;.py”,第185行,主文件
return command.main(cmd_args)
文件“/usr/local/lib/python2.7/dist packages/pip-1.5.5-py2.7.egg/pip/basecommand.py”,第161行,在main中
text='\n'.连接(完成日志)
UnicodeDecodeError:“ascii”编解码器无法解码位置42:序号不在范围(128)中的字节0xe2

但是OpenFST有一个纯python端口吗?

自从OpenFST1.5发布以来,它现在包含了一个python包装器。在1.5.3中,该包装比少数几个独立的OpenFST Python包装功能更加全面。我不知道有任何纯python FST实现。目前肯定没有任何知名的。

错误消息基本上意味着您没有安装
gcc