加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Python > 正文

在python中使用FST库

发布时间:2020-12-16 21:29:01 所属栏目:Python 来源:网络整理
导读:如何安装 OpenFST? 我一直这样做: wget http://www.openfst.org/twiki/pub/FST/FstDownload/openfst-1.4.1.tar.gztar -zxvf openfst-1.4.1.tar.gzcd openfst-1.4.1./configuremakemake install 有没有其他方法来安装它? 实际上我最终想要的是在python中使
如何安装 OpenFST?

我一直这样做:

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,我一直在使用这个包装器:https://github.com/vchahun/pyfst

安装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('rn','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)

但是有没有OpenFST的纯Python端口?

解决方法

自从OpenFST 1.5发布以来,它现在包含了一个Python包装器.在1.5.3中,包装器比少数独立的OpenFST Python包装器功能更全面.我不知道任何纯python FST实现.当时肯定没有任何知名人士.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读