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

(swig) Added wrapper for Wccl::MatchRule

parent 98c79359
Branches
No related merge requests found
......@@ -35,7 +35,8 @@ CBIN=libcclvalue.o \
libcclactionexeccontext.o \
libccltagaction.o \
libccltagrule.o \
libccltagrulesequence.o
libccltagrulesequence.o \
libcclmatchrule.o
CBINOUT=_libcclvalue.so \
_libcclstrset.so \
......@@ -58,6 +59,7 @@ CBINOUT=_libcclvalue.so \
_libccltagaction.so \
_libccltagrule.so \
_libccltagrulesequence.so \
_libcclmatchrule.so \
_boost_shared_ptr.so
CWRAP=libcclvalue_wrap.cxx \
......@@ -82,6 +84,7 @@ CWRAP=libcclvalue_wrap.cxx \
libccltagaction_wrap.cxx \
libccltagrule_wrap.cxx \
libccltagrulesequence_wrap.cxx \
libcclmatchrule_wrap.cxx \
boost_shared_ptr_wrap.cxx
CWRAPBIN=libcclvalue_wrap.o \
......@@ -105,6 +108,7 @@ CWRAPBIN=libcclvalue_wrap.o \
libccltagaction_wrap.o \
libccltagrule_wrap.o \
libccltagrulesequence_wrap.o \
libcclmatchrule_wrap.o \
boost_shared_ptr_wrap.o
PYMODULES=libcclvalue.py \
......@@ -128,6 +132,7 @@ PYMODULES=libcclvalue.py \
libccltagaction.py \
libccltagrule.py \
libccltagrulesequence.py \
libcclmatchrule.py \
boost_shared_ptr.py
PYCBIN=libcclvalue.pyc \
......@@ -151,6 +156,7 @@ PYCBIN=libcclvalue.pyc \
libccltagaction.pyc \
libccltagrule.pyc \
libccltagrulesequence.pyc \
libcclmatchrule.pyc \
boost_shared_ptr.pyc
all:boost_shared_ptr.o $(CBIN)
......@@ -323,6 +329,13 @@ libccltagrulesequence.o:
$(CPP) -shared libccltagrulesequence_wrap.o \
$(CCLBIN) $(ANTLRLIB) -o _libccltagrulesequence.so
# MatchRule
libcclmatchrule.o:
$(SWIG) $(SWIGOPTS_LANG) libcclmatchrule.i
$(CPP) -c libcclmatchrule_wrap.cxx -I$(PYTHONDIR) -I$(WCCLDIR) $(CPPFLAGS)
$(CPP) -shared libcclmatchrule_wrap.o \
$(CCLBIN) $(ANTLRLIB) -o _libcclmatchrule.so
# -----------------------------------------------------------------------------
clean:
rm -f $(CBIN) $(CBINOUT) $(CWRAP) $(CWRAPBIN) $(PYMODULES) $(PYCBIN)
#ifndef SWIG_LIBWCCL_MATCHRULE_I
#define SWIG_LIBWCCL_MATCHRULE_I
%module libcclmatchrule
%{
#include <libwccl/ops/matchrule.h>
%}
%include "libcclvariables.i"
%include "libcclparsedexpression.i"
%include "libcorpus/libcorpusannotatedsentence.i"
%include "std_string.i"
%include "boost_shared_ptr.i"
namespace Wccl {
class MatchRule : public ParsedExpression {
public:
MatchRule(
const Variables& variables,
const boost::shared_ptr<ApplyOperator>& apply
);
MatchRule(const MatchRule& other, bool clean = false);
MatchRule();
/* --------------------------------------------------------------------- */
%rename(OpFunMatchRule) operator()(const boost::shared_ptr<Corpus2::AnnotatedSentence>& s);
void operator()(const boost::shared_ptr<Corpus2::AnnotatedSentence>& s);
void apply(const boost::shared_ptr<Corpus2::AnnotatedSentence>& s);
/* --------------------------------------------------------------------- */
MatchRule clone() const;
MatchRule clone_clean() const;
boost::shared_ptr<MatchRule> clone_ptr() const;
boost::shared_ptr<MatchRule> clone_clean_ptr() const;
/* --------------------------------------------------------------------- */
%rename(OpEqMatchRule) *::operator=(const MatchRule& other);
/* --------------------------------------------------------------------- */
std::string to_string(const Corpus2::Tagset& tagset) const;
};
}
using namespace std;
using namespace Wccl;
#endif /* SWIG_LIBWCCL_MATCHRULE_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