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

Wprapper for Corpus2::AnnotationView

parent a3e846a8
Branches
No related merge requests found
......@@ -24,7 +24,8 @@ CBIN=libcorpustag.o \
libcorpustokenreader.o \
libcorpusiob.o \
libcorpusannotationchannel.o \
libcorpusannotatedsentence.o
libcorpusannotatedsentence.o \
libcorpusannotationview.o
CBINOUT=_boost_shared_ptr.so \
_libcorpustag.so \
......@@ -38,7 +39,8 @@ CBINOUT=_boost_shared_ptr.so \
_libcorpustokenreader.so \
_libcorpusiob.so \
_libcorpusannotationchannel.so \
_libcorpusannotatedsentence.so
_libcorpusannotatedsentence.so \
_libcorpusannotationview.so
CWRAP=boost_shared_ptr_wrap.cxx \
libcorpustag_wrap.cxx \
......@@ -52,7 +54,8 @@ CWRAP=boost_shared_ptr_wrap.cxx \
libcorpustokenreader_wrap.cxx \
libcorpusiob_wrap.cxx \
libcorpusannotationchannel_wrap.cxx \
libcorpusannotatedsentence_wrap.cxx
libcorpusannotatedsentence_wrap.cxx \
libcorpusannotationview_wrap.cxx
CWRAPBIN=boost_shared_ptr_wrap.o \
libcorpustag_wrap.o \
......@@ -66,7 +69,8 @@ CWRAPBIN=boost_shared_ptr_wrap.o \
libcorpustokenreader_wrap.o \
libcorpusiob_wrap.o \
libcorpusannotationchannel_wrap.o \
libcorpusannotatedsentence_wrap.o
libcorpusannotatedsentence_wrap.o \
libcorpusannotationview_wrap.o
PYMODULES=boost_shared_ptr.py \
libcorpustag.py \
......@@ -80,7 +84,8 @@ PYMODULES=boost_shared_ptr.py \
libcorpustokenreader.py \
libcorpusiob.py \
libcorpusannotationchannel.py \
libcorpusannotatedsentence.py
libcorpusannotatedsentence.py \
libcorpusannotationview.py
PYCBIN=boost_shared_ptr.pyc \
libcorpustag.pyc \
......@@ -94,7 +99,8 @@ PYCBIN=boost_shared_ptr.pyc \
libcorpustokenreader.pyc \
libcorpusiob.pyc \
libcorpusannotationchannel.pyc \
libcorpusannotatedsentence.pyc
libcorpusannotatedsentence.pyc \
libcorpusannotationview.pyc
# -----------------------------------------------------------------------------
all:boost_shared_ptr.o $(CBIN)
......@@ -198,6 +204,13 @@ libcorpusannotatedsentence.o:
$(CPP) -shared libcorpusannotatedsentence_wrap.o \
$(PWRUTILBIN) $(CORPUS2BIN) -o _libcorpusannotatedsentence.so
# AnnotationView
libcorpusannotationview.o:
$(SWIG) $(SWIGOPTS_LANG) libcorpusannotationview.i
$(CPP) -c libcorpusannotationview_wrap.cxx -I$(PYTHONDIR) $(CPPFLAGS)
$(CPP) -shared libcorpusannotationview_wrap.o \
$(PWRUTILBIN) $(CORPUS2BIN) -o _libcorpusannotationview.so
# -----------------------------------------------------------------------------
clean:
rm -f $(CBIN) $(CBINOUT) $(CWRAP) $(CWRAPBIN) $(PYMODULES) $(PYCBIN)
#ifndef SWIG_LIBCORPUS2_ANNOTATIONVIEW_I
#define SWIG_LIBCORPUS2_ANNOTATIONVIEW_I
%module libcorpusannotationview
%{
#include <libcorpus2/ann/view.h>
%}
%include "libcorpussentence.i"
%include "libcorpusannotationchannel.i"
%include "libcorpusannotatedsentence.i"
%include "std_string.i"
%include "boost_shared_ptr.i"
// %template(AnnotatedSentencePtr) boost::shared_ptr<AnnotatedSentence>;
%nodefaultctor Corpus2::TokenWriter;
namespace Corpus2 {
class AnnotationView : public Corpus2::Sentence {
public:
AnnotationView(const boost::shared_ptr<AnnotatedSentence>& original, const std::string& ann_name_);
~AnnotationView();
/* --------------------------------------------------------------------- */
Ptr clone_shared() const;
/* --------------------------------------------------------------------- */
void commit();
void commit_to(
const boost::shared_ptr<AnnotatedSentence>& original,
const std::string& ann_name);
/* --------------------------------------------------------------------- */
void release_original();
};
}
using namespace std;
using namespace Corpus2;
#endif /* SWIG_LIBCORPUS2_ANNOTATIONVIEW_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