forked from vchahun/pyfst
-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.py
66 lines (50 loc) · 1.5 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import sys
import os
from distutils.core import setup
from distutils.extension import Extension
INC, LIB = [], []
if not os.path.exists('fst/_fst.cpp'):
os.system('./prepare_fst_cpp.sh')
# MacPorts
if sys.platform == 'darwin' and os.path.isdir('/opt/local/lib'):
INC.append('/opt/local/include')
LIB.append('/opt/local/lib')
ext_modules = [
Extension(name='fst._fst',
sources=['fst/_fst.cpp'],
libraries=['fst'],
extra_compile_args=['--std=c++11','-O2'],
include_dirs=INC,
library_dirs=LIB)
]
long_description = """
pyfst
=====
A Python interface for the OpenFst_ library.
.. _OpenFst: http://www.openfst.org
- Documentation: http://pyfst.github.io
- Source code: https://github.com/vchahun/pyfst
Example usage::
import fst
t = fst.Transducer()
t.add_arc(0, 1, 'a', 'A', 0.5)
t.add_arc(0, 1, 'b', 'B', 1.5)
t.add_arc(1, 2, 'c', 'C', 2.5)
t[2].final = 3.5
t.shortest_path() # 2 -(a:A/0.5)-> 1 -(c:C/2.5)-> 0/3.5
"""
setup(
name='pyfst',
version='0.2.3',
url='http://pyfst.github.io',
author='Victor Chahuneau',
description='A Python interface to OpenFst.',
long_description=long_description,
classifiers=['Topic :: Text Processing :: Linguistic',
'Programming Language :: Cython',
'Programming Language :: C++',
'Intended Audience :: Education',
'Intended Audience :: Science/Research'],
packages=['fst'],
ext_modules=ext_modules
)