From 7fec8020de5f0c65e14728f66e8147608f68337f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pawe=C5=82=20K=C4=99dzia?= <pawel.kedzia@pwr.wroc.pl>
Date: Wed, 4 May 2011 12:48:19 +0200
Subject: [PATCH] Added wrapper for Wccl::MatchData

---
 swig/Makefile                |  8 ++++++++
 swig/libcclannotationmatch.i | 37 ++++++++++++++++++++++++++++++++++++
 2 files changed, 45 insertions(+)
 create mode 100644 swig/libcclannotationmatch.i

diff --git a/swig/Makefile b/swig/Makefile
index 338985e..4227906 100644
--- a/swig/Makefile
+++ b/swig/Makefile
@@ -23,6 +23,7 @@ CBIN=libcclvalue.o \
 	libcclmatch.o \
 	libcclmatchdata.o \
 	libccltokenmatch.o \
+	libcclannotationmatch.o \
 	libcclexpression.o \
 	libcclparsedexpression.o \
 	libcclfunctionaloperator.o \
@@ -192,6 +193,13 @@ libccltokenmatch.o:
 	$(CPP) -shared libccltokenmatch_wrap.o \
 		$(CCLBIN) $(ANTLRLIB) -o _libccltokenmatch.so
 
+# AnnotationMatch
+libcclannotationmatch.o:
+	$(SWIG) $(SWIGOPTS_LANG) libcclannotationmatch.i
+	$(CPP) -c libcclannotationmatch_wrap.cxx -I$(PYTHONDIR) -I$(WCCLDIR) $(CPPFLAGS)
+	$(CPP) -shared libcclannotationmatch_wrap.o \
+		$(CCLBIN) $(ANTLRLIB) -o _libcclannotationmatch.so
+
 # Expression
 libcclexpression.o:
 	$(SWIG) $(SWIGOPTS_LANG) libcclexpression.i
diff --git a/swig/libcclannotationmatch.i b/swig/libcclannotationmatch.i
new file mode 100644
index 0000000..791be9f
--- /dev/null
+++ b/swig/libcclannotationmatch.i
@@ -0,0 +1,37 @@
+#ifndef SWIG_LIBWCCL_ANNOTATIONMATCH_I
+#define SWIG_LIBWCCL_ANNOTATIONMATCH_I
+
+%module libcclannotationmatch
+%{
+  #include <libwccl/values/annotationmatch.h>
+%}
+
+%include "std_string.i"
+%include "libcclposition.i"
+%include "libcclmatchdata.i"
+%include "libcorpus/libcorpusannotatedsentence.i"
+
+%nodefaultctor Wccl::AnnotationMatch;
+
+namespace Wccl {
+  class AnnotationMatch : public MatchData {
+  public:
+    explicit AnnotationMatch(Position position, const std::string channel);
+    explicit AnnotationMatch(int pos, const std::string channel);
+
+    /* --------------------------------------------------------------------- */
+    bool empty() const;
+
+    /* --------------------------------------------------------------------- */
+    Position first_token(const boost::shared_ptr<Corpus2::AnnotatedSentence>&) const;
+    Position last_token(const boost::shared_ptr<Corpus2::AnnotatedSentence>&) const;
+
+    /* --------------------------------------------------------------------- */
+    std::string to_raw_string() const;
+  };
+}
+
+using namespace std;
+using namespace Wccl;
+
+#endif /* SWIG_LIBWCCL_ANNOTATIONMATCH_I */
-- 
GitLab