Compiling Python API

Submitted by fcbr on Fri, 09/09/2016 - 14:59
Forums

Trying to compile Freeling 4.0 (latest from git) and I get this error when trying to compile the Python:

freeling_pythonAPI.cxx: In function ‘PyObject* _wrap_word_found_in_dict(PyObject*, PyObject*)’:
freeling_pythonAPI.cxx:62661:50: error: ‘const class freeling::word’ has no member named ‘found_in_dict’
result = (bool)((freeling::word const *)arg1)->found_in_dict();
^
freeling_pythonAPI.cxx: In function ‘PyObject* _wrap_word_set_found_in_dict(PyObject*, PyObject*)’:
freeling_pythonAPI.cxx:62691:11: error: ‘class freeling::word’ has no member named ‘set_found_in_dict’
(arg1)->set_found_in_dict(arg2);
^
freeling_pythonAPI.cxx: In function ‘PyObject* _wrap_word_is_locked(PyObject*, PyObject*)’:
freeling_pythonAPI.cxx:62756:50: error: ‘const class freeling::word’ has no member named ‘is_locked’
result = (bool)((freeling::word const *)arg1)->is_locked();

Linux is Fedora 21
Python 3.4.1 (python3.4m)
gcc 4.9.2
swig 3.0.6

The API definition files are not update everytime there is a change in the development version.
Development version is guaranteed to work from C++, but APIs for other languages go some steps behind.

You may try to fix this checking the differences between public APIs for word class in src/include/freeling/language.h and the public API for the same class declared in APIs/common/freeling.i

If you modify freeling.i to match the API in language.h, it should work.

If you do so, and want to contribute the changes, you'll be very welcome!

You dont need to do that, I fixed it last week

If you pull latest version from github, you will get an updated API for python