diff --git a/swig/Makefile b/swig/Makefile index d2e51bdbb937c7027f0268968089ee45aaa95024..c4b9c98d431ee200114f7ac093e56270280e6c4a 100644 --- a/swig/Makefile +++ b/swig/Makefile @@ -14,27 +14,33 @@ ANTLRLIB=/usr/lib/libantlr-pic.a CPPFLAGS=-fPIC -O2 CBIN=libcorpustag.o \ - libcorpustagset.o + libcorpustagset.o \ + libcorpustagsetmanager.o CBINOUT=_boost_shared_ptr.so \ _libcorpustag.so \ - _libcorpustagset.so + _libcorpustagset.so \ + _libcorpustagsetmanager.so CWRAP=boost_shared_ptr_wrap.cxx \ libcorpustag_wrap.cxx \ - libcorpustagset_wrap.cxx + libcorpustagset_wrap.cxx \ + libcorpustagsetmanager_wrap.cxx CWRAPBIN=boost_shared_ptr_wrap.o \ libcorpustag_wrap.o \ - libcorpustagset_wrap.o + libcorpustagset_wrap.o \ + libcorpustagsetmanager_wrap.o PYMODULES=boost_shared_ptr.py \ libcorpustag.py \ - libcorpustagset.py + libcorpustagset.py \ + libcorpustagsetmanager.py PYCBIN=boost_shared_ptr.pyc \ libcorpustag.pyc \ - libcorpustagset.pyc + libcorpustagset.pyc \ + libcorpustagsetmanager.pyc # ----------------------------------------------------------------------------- all:boost_shared_ptr.o $(CBIN) @@ -68,6 +74,13 @@ libcorpustagset.o: $(CPP) -shared libcorpustagset_wrap.o \ $(PWRUTILBIN) $(CORPUS2BIN) -o _libcorpustagset.so +# TagsetManager +libcorpustagsetmanager.o: + $(SWIG) $(SWIGOPTS_LANG) libcorpustagsetmanager.i + $(CPP) -c libcorpustagsetmanager_wrap.cxx -I$(PYTHONDIR) $(CPPFLAGS) + $(CPP) -shared libcorpustagsetmanager_wrap.o \ + $(PWRUTILBIN) $(CORPUS2BIN) -o _libcorpustagsetmanager.so + # ----------------------------------------------------------------------------- clean: rm -f $(CBIN) $(CBINOUT) $(CWRAP) $(CWRAPBIN) $(PYMODULES) $(PYCBIN) diff --git a/swig/libcorpustagsetmanager.i b/swig/libcorpustagsetmanager.i new file mode 100644 index 0000000000000000000000000000000000000000..eea54cb1f7a6e588e4556a362e407932cb6d4e02 --- /dev/null +++ b/swig/libcorpustagsetmanager.i @@ -0,0 +1,36 @@ +#ifndef SWIG_LIBCORPUS2_TAGSETMANAGER_I +#define SWIG_LIBCORPUS2_TAGSETMANAGER_I + +%module libcorpustagsetmanager +%{ + #include <libcorpus2/tagsetmanager.h> +%} + +%include "libcorpustagset.i" + +%include "std_string.i" +%include "std_vector.i" + +%feature("notabstract") Corpus2::TagsetManager; + +namespace Corpus2 { + class TagsetManager { + public: + TagsetManager(); + ~TagsetManager(); + + /* --------------------------------------------------------------------- */ + const Tagset& get_tagset(const std::string& name); + + // boost::shared_ptr<Tagset> get_cache_entry(const std::string& name); + + /* --------------------------------------------------------------------- */ + }; + + inline const Tagset& get_named_tagset(const std::string& name); +} + +using namespace std; +using namespace Corpus2; + +#endif /* SWIG_LIBCORPUS2_TAGSETMANAGER_I */