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

(swig) Added wrapper for Wccl::MatchVector

parent b37e38ed
Branches
No related tags found
No related merge requests found
...@@ -24,6 +24,7 @@ CBIN=libcclvalue.o \ ...@@ -24,6 +24,7 @@ CBIN=libcclvalue.o \
libcclmatchdata.o \ libcclmatchdata.o \
libccltokenmatch.o \ libccltokenmatch.o \
libcclannotationmatch.o \ libcclannotationmatch.o \
libcclmatchvector.o \
libcclexpression.o \ libcclexpression.o \
libcclparsedexpression.o \ libcclparsedexpression.o \
libcclfunctionaloperator.o \ libcclfunctionaloperator.o \
...@@ -45,6 +46,7 @@ CBINOUT=_libcclvalue.so \ ...@@ -45,6 +46,7 @@ CBINOUT=_libcclvalue.so \
_libcclmatchdata.so \ _libcclmatchdata.so \
_libccltokenmatch.so \ _libccltokenmatch.so \
_libcclannotationmatch.so \ _libcclannotationmatch.so \
_libcclmatchvector.so \
_libcclsentencecontext.so \ _libcclsentencecontext.so \
_libccloperator.so \ _libccloperator.so \
_libcclparser.so \ _libcclparser.so \
...@@ -64,6 +66,7 @@ CWRAP=libcclvalue_wrap.cxx \ ...@@ -64,6 +66,7 @@ CWRAP=libcclvalue_wrap.cxx \
libcclmatchdata_wrap.cxx \ libcclmatchdata_wrap.cxx \
libccltokenmatch_wrap.cxx \ libccltokenmatch_wrap.cxx \
libcclannotationmatch_wrap.cxx \ libcclannotationmatch_wrap.cxx \
libcclmatchvector_wrap.cxx \
libcclsentencecontext_wrap.cxx \ libcclsentencecontext_wrap.cxx \
libcorpussentence_wrap.cxx \ libcorpussentence_wrap.cxx \
libccloperator_wrap.cxx \ libccloperator_wrap.cxx \
...@@ -82,6 +85,7 @@ CWRAPBIN=libcclvalue_wrap.o \ ...@@ -82,6 +85,7 @@ CWRAPBIN=libcclvalue_wrap.o \
libcclmatchdata_wrap.o \ libcclmatchdata_wrap.o \
libccltokenmatch_wrap.o \ libccltokenmatch_wrap.o \
libcclannotationmatch_wrap.o \ libcclannotationmatch_wrap.o \
libcclmatchvector_wrap.o \
libcclsentencecontext_wrap.o \ libcclsentencecontext_wrap.o \
libccloperator_wrap.o \ libccloperator_wrap.o \
libcclparser_wrap.o \ libcclparser_wrap.o \
...@@ -101,6 +105,7 @@ PYMODULES=libcclvalue.py \ ...@@ -101,6 +105,7 @@ PYMODULES=libcclvalue.py \
libcclvariables.py \ libcclvariables.py \
libcclsentencecontext.py \ libcclsentencecontext.py \
libcclannotationmatch.py \ libcclannotationmatch.py \
libcclmatchvector.py \
libcclfunctionaloperator.py \ libcclfunctionaloperator.py \
libccloperator.py \ libccloperator.py \
boost_shared_ptr.py boost_shared_ptr.py
...@@ -118,6 +123,7 @@ PYCBIN=libcclvalue.pyc \ ...@@ -118,6 +123,7 @@ PYCBIN=libcclvalue.pyc \
libcclvariables.pyc \ libcclvariables.pyc \
libcclsentencecontext.pyc \ libcclsentencecontext.pyc \
libcclannotationmatch.pyc \ libcclannotationmatch.pyc \
libcclmatchvector.pyc \
libcclfunctionaloperator.pyc \ libcclfunctionaloperator.pyc \
libccloperator.pyc \ libccloperator.pyc \
libcclparser.pyc \ libcclparser.pyc \
...@@ -205,6 +211,13 @@ libcclannotationmatch.o: ...@@ -205,6 +211,13 @@ libcclannotationmatch.o:
$(CPP) -shared libcclannotationmatch_wrap.o \ $(CPP) -shared libcclannotationmatch_wrap.o \
$(CCLBIN) $(ANTLRLIB) -o _libcclannotationmatch.so $(CCLBIN) $(ANTLRLIB) -o _libcclannotationmatch.so
# MatchVector
libcclmatchvector.o:
$(SWIG) $(SWIGOPTS_LANG) libcclmatchvector.i
$(CPP) -c libcclmatchvector_wrap.cxx -I$(PYTHONDIR) -I$(WCCLDIR) $(CPPFLAGS)
$(CPP) -shared libcclmatchvector_wrap.o \
$(CCLBIN) $(ANTLRLIB) -o _libcclmatchvector.so
# Expression # Expression
libcclexpression.o: libcclexpression.o:
$(SWIG) $(SWIGOPTS_LANG) libcclexpression.i $(SWIG) $(SWIGOPTS_LANG) libcclexpression.i
......
#ifndef SWIG_LIBWCCL_MATCHVECTOR_I
#define SWIG_LIBWCCL_MATCHVECTOR_I
%module libcclmatchvector
%{
#include <libwccl/values/matchvector.h>
%}
%include "libcclmatch.i"
%include "libcclmatchdata.i"
%include "libccltokenmatch.i"
%include "libcclannotationmatch.i"
%include "libcorpus/libcorpusannotatedsentence.i"
%include "std_string.i"
%include "boost_shared_ptr.i"
%template(MatchVectorPtr) boost::shared_ptr<Wccl::MatchVector>;
namespace Wccl {
class MatchVector {
public:
MatchVector();
~MatchVector();
/* --------------------------------------------------------------------- */
bool empty() const;
/* --------------------------------------------------------------------- */
int first_token(const boost::shared_ptr<Corpus2::AnnotatedSentence>& s) const;
int last_token(const boost::shared_ptr<Corpus2::AnnotatedSentence>& s) const;
/* --------------------------------------------------------------------- */
std::string to_raw_string() const;
/* --------------------------------------------------------------------- */
void append(const boost::shared_ptr<Match>& m);
void append(const boost::shared_ptr<MatchData>& m);
void append(const boost::shared_ptr<MatchVector>& m);
void append(const boost::shared_ptr<TokenMatch>& m);
void append(const boost::shared_ptr<AnnotationMatch>& m);
/* --------------------------------------------------------------------- */
size_t size() const;
void clear();
/* --------------------------------------------------------------------- */
const boost::shared_ptr<Match>& submatch(size_t idx);
// const boost::shared_ptr<const Match> submatch(size_t idx) const;
};
}
using namespace std;
using namespace Wccl;
#endif /* SWIG_LIBWCCL_MATCHVECTOR_I */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment