From e54a8103d254068ad84e65b13fc255cc09ee56f7 Mon Sep 17 00:00:00 2001
From: Adam Radziszewski <adam.radziszewski@pwr.wroc.pl>
Date: Mon, 22 Oct 2012 20:30:05 +0200
Subject: [PATCH] add ann sent -> sent pointer cast to swig, useful in python

---
 CMakeLists.txt           | 4 ++--
 swig/annotatedsentence.i | 8 ++++++++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 43793e1..19ce20e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,8 +1,8 @@
 PROJECT(Corpus2Library)
 
 set(corpus2_ver_major "1")
-set(corpus2_ver_minor "1")
-set(corpus2_ver_patch "1")
+set(corpus2_ver_minor "2")
+set(corpus2_ver_patch "0")
 
 cmake_minimum_required(VERSION 2.8.0)
 
diff --git a/swig/annotatedsentence.i b/swig/annotatedsentence.i
index 0c59edb..c158c4a 100644
--- a/swig/annotatedsentence.i
+++ b/swig/annotatedsentence.i
@@ -59,6 +59,14 @@ namespace Corpus2 {
     std::string annotation_info() const;
   };
 
+  %extend AnnotatedSentence {
+    static boost::shared_ptr<Sentence> cast_as_sentence(
+      const boost::shared_ptr<AnnotatedSentence>& a)
+    {
+      return a;
+    }
+  }
+
 boost::shared_ptr<Corpus2::AnnotationView> create_view(
         const boost::shared_ptr<AnnotatedSentence>& s,
         const std::string& ann_name);
-- 
GitLab