Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swig wrapper for cg-proc #37

Closed
wants to merge 5 commits into from

Conversation

singh-lokendra
Copy link

@singh-lokendra singh-lokendra commented Aug 11, 2019

guarded by ENABLE_PYTHON_BINDINGS

  • updated cmake minimum version to 3.0.2 for finding python interpreter
  • modified Grammar.hpp for including in swig wrapper
  • updated travis distro to xenial

Usage:

cg = constraint_grammar.CGProc(dictionary_path)
command = ['cg-proc', '-w']
cg.cg_proc(len(command), command, input_file.name, output_file.name)

added: CG3:: before class names in Grammar.hpp
pass arg -DENABLE_PYTHON_BINDINGS:BOOL=ON during cmake
@sushain97
Copy link

did you modify the travis.yml to verify the python bindings build? (if needed)

@singh-lokendra
Copy link
Author

do you mean 26c166f#diff-354f30a63fb0907d4ad57269548329e3R14?

@sushain97
Copy link

@TinoDidriksen could you please take a look at this PR?

@TinoDidriksen
Copy link
Member

The Grammar.hpp changes cannot possibly be necessary. It's in the CG3 namespace, and all headers it includes put their things in the CG3 namespace. It should not need qualification.

Bumping CMake to 3.0 is fine. Only CentOS 7 needs special handling for that.

Also note that CG-3 is not a git project - this is a read-only copy of the svn repo, so pushing changes are a bit more fiddly.

@singh-lokendra
Copy link
Author

The Grammar.hpp changes cannot possibly be necessary. It's in the CG3 namespace, and all headers it includes put their things in the CG3 namespace. It should not need qualification.

Grammar.hpp needs to be included https://github.com/TinoDidriksen/cg3/pull/37/files#diff-72aaa8a9e7ef602947a3afb265935f15R6 for making the inheritance visible to swig.
Without qualification, these errors are reported https://termbin.com/d1tu. Even swig v4.0 needs explicit qualification

@TinoDidriksen
Copy link
Member

That is rather bizarre. Surely using namespace CG3 will do instead then.

@singh-lokendra
Copy link
Author

Surely using namespace CG3 will do instead then.

Adding this before %include reports Error: Nothing known about namespace 'CG3'. And adding it after the include is still producing the above errors

list being mutable can't be used as dictionary keys
@sushain97
Copy link

@TinoDidriksen any further thoughts on Grammar.hpp?

@TinoDidriksen
Copy link
Member

Committed, without changing src/

TinoDidriksen added a commit that referenced this pull request Aug 11, 2021
…loses #37)

git-svn-author: lokendras1998@gmail.com


git-svn-id: svn+ssh://beta.visl.sdu.dk/usr/local/svn/repos/visl/tools/vislcg3/trunk@13554 cb2587b3-b7ff-0310-8c81-a2a651690ada
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants