From b6245eddcc7c878e0862b4e8be18209119193a5a Mon Sep 17 00:00:00 2001 From: Adam Radziszewski <adam.radziszewski@pwr.wroc.pl> Date: Thu, 1 Dec 2011 11:00:51 +0100 Subject: [PATCH] swig shared_ptr create sent helper --- swig/sentence.i | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/swig/sentence.i b/swig/sentence.i index 955ad7d..09cca92 100644 --- a/swig/sentence.i +++ b/swig/sentence.i @@ -47,6 +47,12 @@ namespace Corpus2 { const Token* first_token() const; const std::string id() const; + + %extend { + static boost::shared_ptr<Corpus2::Sentence> create_sent(const std::string &id) { + return boost::shared_ptr<Corpus2::Sentence>(new Corpus2::Sentence(id)); + } + } }; } -- GitLab