Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using FST libraries in python

How do I install OpenFST?

I have been doing it as such:

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

Is there any other way to install this?

Actually what i eventually wanted is to use OpenFST in python, i've been using this wrapper: https://github.com/vchahun/pyfst

After installing OpenFST, when installing pyfst, I had the following problem. Anyone knows how to resolve that?:

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

But is there a pure python port of OpenFST?

like image 359
alvas Avatar asked Sep 29 '22 22:09

alvas


1 Answers

Since OpenFST 1.5 was released it now includes a Python wrapper. In 1.5.3 that wrapper is much more full-featured than the handful of independent OpenFST Python wrappers. I don't know of any pure-python FST implementations. There certainly aren't any well-known ones at this time.

like image 122
blambert Avatar answered Oct 03 '22 07:10

blambert