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

Added wrapper for Corpus2::Sentence

parent 904bad5f
Branches
No related merge requests found
#ifndef SWIG_LIBCORPUS2_SENTENCE_I
#define SWIG_LIBCORPUS2_SENTENCE_I
%module libcorpussentence
%{
#include <libcorpus2/sentence.h>
%}
%include "libcorpustoken.i"
%include "std_string.i"
%include "std_vector.i"
%include "boost_shared_ptr.i"
%feature("notabstract") Corpus2::Sentence;
%rename(__op_get__) Corpus2::Sentence::operator[](size_t idx) const;
namespace Corpus2 {
class Sentence {
public:
Sentence();
virtual ~Sentence();
virtual boost::shared_ptr<Sentence> clone_shared() const;
void release_tokens();
bool empty() const;
size_t size() const;
Token* operator[](size_t idx);
const std::vector<Token*>& tokens() const;
std::vector<Token*>& tokens();
virtual void append(Token* t);
const Token* first_token() const;
};
}
%template(SentenceSharedPtr) boost::shared_ptr<Corpus2::Sentence>;
using namespace boost;
using namespace std;
using namespace Corpus2;
#endif /* SWIG_LIBCORPUS2_SENTENCE_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