Skip to content
Snippets Groups Projects
Commit 98c79359 authored by Paweł Kędzia's avatar Paweł Kędzia
Browse files

(swig) Added wrapper for Wccl::TagRuleSequence

parent d68f1e0b
Branches
No related merge requests found
......@@ -34,7 +34,8 @@ CBIN=libcclvalue.o \
libcclparser.o \
libcclactionexeccontext.o \
libccltagaction.o \
libccltagrule.o
libccltagrule.o \
libccltagrulesequence.o
CBINOUT=_libcclvalue.so \
_libcclstrset.so \
......@@ -56,6 +57,7 @@ CBINOUT=_libcclvalue.so \
_libcclactionexeccontext.so \
_libccltagaction.so \
_libccltagrule.so \
_libccltagrulesequence.so \
_boost_shared_ptr.so
CWRAP=libcclvalue_wrap.cxx \
......@@ -79,6 +81,7 @@ CWRAP=libcclvalue_wrap.cxx \
libcclactionexeccontext_wrap.cxx \
libccltagaction_wrap.cxx \
libccltagrule_wrap.cxx \
libccltagrulesequence_wrap.cxx \
boost_shared_ptr_wrap.cxx
CWRAPBIN=libcclvalue_wrap.o \
......@@ -101,6 +104,7 @@ CWRAPBIN=libcclvalue_wrap.o \
libcclactionexeccontext_wrap.o \
libccltagaction_wrap.o \
libccltagrule_wrap.o \
libccltagrulesequence_wrap.o \
boost_shared_ptr_wrap.o
PYMODULES=libcclvalue.py \
......@@ -123,6 +127,7 @@ PYMODULES=libcclvalue.py \
libcclactionexeccontext.py \
libccltagaction.py \
libccltagrule.py \
libccltagrulesequence.py \
boost_shared_ptr.py
PYCBIN=libcclvalue.pyc \
......@@ -145,6 +150,7 @@ PYCBIN=libcclvalue.pyc \
libcclactionexeccontext.pyc \
libccltagaction.pyc \
libccltagrule.pyc \
libccltagrulesequence.pyc \
boost_shared_ptr.pyc
all:boost_shared_ptr.o $(CBIN)
......@@ -310,6 +316,13 @@ libccltagrule.o:
$(CPP) -shared libccltagrule_wrap.o \
$(CCLBIN) $(ANTLRLIB) -o _libccltagrule.so
# TagRuleSequence
libccltagrulesequence.o:
$(SWIG) $(SWIGOPTS_LANG) libccltagrulesequence.i
$(CPP) -c libccltagrulesequence_wrap.cxx -I$(PYTHONDIR) -I$(WCCLDIR) $(CPPFLAGS)
$(CPP) -shared libccltagrulesequence_wrap.o \
$(CCLBIN) $(ANTLRLIB) -o _libccltagrulesequence.so
# -----------------------------------------------------------------------------
clean:
rm -f $(CBIN) $(CBINOUT) $(CWRAP) $(CWRAPBIN) $(PYMODULES) $(PYCBIN)
#ifndef SWIG_LIBWCCL_TAGRULESEQUENCE_I
#define SWIG_LIBWCCL_TAGRULESEQUENCE_I
%module libccltagrulesequence
%{
#include <libwccl/ops/tagrulesequence.h>
%}
%include "libcclbool.i"
%include "libccltagrule.i"
%include "libcclexpression.i"
%include "libcorpus/libcorpussentence.i"
%include "std_string.i"
%include "std_vector.i"
%include "boost_shared_ptr.i"
%template(StdVectorTagRule) std::vector<TagRule>;
%template(TagRuleSequencPtr) boost::shared_ptr<Wccl::TagRuleSequence>;
namespace Wccl {
class TagRuleSequence : public std::vector<TagRule>, public Expression {
public:
TagRuleSequence(const std::vector<TagRule>& rules);
TagRuleSequence();
/* --------------------------------------------------------------------- */
%rename(OpFunTagRuleSequence) operator()(
const boost::shared_ptr<Corpus2::Sentence>& sentence
);
Bool operator()(const boost::shared_ptr<Corpus2::Sentence>& sentence);
/* --------------------------------------------------------------------- */
Bool execute_once(const boost::shared_ptr<Corpus2::Sentence>& sentence);
int execute_until_done(const boost::shared_ptr<Corpus2::Sentence>& sentence, int max_iter = 1000);
std::string to_string(const Corpus2::Tagset& tagset) const;
};
}
using namespace boost;
using namespace Wccl;
using namespace std;
#endif /* SWIG_LIBWCCL_TAGRULESEQUENCE_I */
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment