From 44d47e4504c45e889d87f746b7c9b696731b4322 Mon Sep 17 00:00:00 2001
From: Adam Radziszewski <adam.radziszewski@pwr.wroc.pl>
Date: Fri, 21 Jun 2013 14:42:48 +0200
Subject: [PATCH] Lift const from Sentence::id_ and add id setter + swig
 wrapper for it.

---
 CMakeLists.txt        | 4 ++--
 libcorpus2/sentence.h | 7 ++++++-
 swig/sentence.i       | 2 ++
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f60324a..98ced3c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,8 +1,8 @@
 PROJECT(Corpus2Library)
 
 set(corpus2_ver_major "1")
-set(corpus2_ver_minor "3")
-set(corpus2_ver_patch "4")
+set(corpus2_ver_minor "4")
+set(corpus2_ver_patch "0")
 
 cmake_minimum_required(VERSION 2.8.0)
 
diff --git a/libcorpus2/sentence.h b/libcorpus2/sentence.h
index d182fda..72b2a49 100644
--- a/libcorpus2/sentence.h
+++ b/libcorpus2/sentence.h
@@ -118,12 +118,17 @@ public:
 		return id_;
 	}
 
+	/// Identifier setter
+	void set_id(const std::string &id) {
+		id_ = id;
+	}
+
 protected:
 	/// The tokens this sentence contains and owns
 	std::vector<Token*> tokens_;
 
 	/// The sentence identifer - default is empty
-	const std::string id_;
+	std::string id_;
 };
 
 } /* end ns Corpus2 */
diff --git a/swig/sentence.i b/swig/sentence.i
index 09cca92..437b1b6 100644
--- a/swig/sentence.i
+++ b/swig/sentence.i
@@ -48,6 +48,8 @@ namespace Corpus2 {
 
     const std::string id() const;
 
+    void set_id(const std::string &id);
+
     %extend {
       static boost::shared_ptr<Corpus2::Sentence> create_sent(const std::string &id) {
         return boost::shared_ptr<Corpus2::Sentence>(new Corpus2::Sentence(id));
-- 
GitLab