- This repository is an initial attempt towards making a full fleged python wrapper for the Apertium Lttoolbox module.
- In this repository a trivial wrapping of the
transducer.cc
module has been attempted - Contents of the repository :
- Nessecary header files
- Nessecary
.cc
files setup.py
Disuitls file to set things up for building the wrapperbugs.md
Description of bugs and faults with this trivial system and a little insight on how to proceed with the project.transducer.i
The swig interface filetransducer.py
andtransducer.cxx
These are generated files and can be generated by building.o
and.so
files . These object and shared object files are also generated from the build
git clone repo
cd repo
swig -python -c++ transducer.i
python setup.py build_ext --inplace
g++ -c -fcip transducer_wrap.cxx transducer.cc -I/{{path to python header}} -std=c++11
g++ -shared transducer.o transducer_wrap.o -o _transducer.so
pkg-config --cflags --libs python3 lttoolbox-std=c++11
chmod +x run.sh
./run.sh
- After the above steps are completed just open python in the terminal and try to
import transducer
- Make sure to run the appropriate version of python
- To get the path to python header in the environment, enter
python-config --cflags
in the terminal