2014-09-10 52 views
5

如何安裝OpenFST在python中使用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,我一直在使用這種包裝:https://github.com/vchahun/pyfst

安裝pyfst當安裝OpenFST,之後,我有以下問題。任何人都知道如何解決?:

$ 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) 

但有OpenFST的純Python端口?

+0

錯誤消息基本上意味着你沒有安裝'gcc'。 – tripleee 2016-07-23 06:25:28

回答

3

自OpenFST 1.5發佈以來,它現在包含一個Python包裝器。在1.5.3中,該包裝器比少數獨立的OpenFST Python包裝器更全面。我不知道任何純python FST實現。目前肯定沒有任何知名的。